You are on page 1of 6

IN 5 PAGES

www.robotigniteacademy.com ©2017 The Construct Sim, Inc. All Rights Reserved


IN 5 PAGES
Common Command-line Tools

roscore
A collection of nodes and programs that are
pre-requisites of a ROS-based system. You must have a
roslaunch
roscore running in order for ROS nodes to communicate. Starts ROS nodes locally and remotely via SSH, as well as setting
· Usage: parameters on the parameter server.
$ roscore · Examples: - Execute launch file keyboard_teleop.launch from
package turtlebot_teleop:
$ roslaunch turtlebot_teleop keyboard_teleop.launch

rosrun
rosrun allows you to run an executable in an arbitrary package without having to cd (or roscd) there first.
· Usage:
$ rosrun package executable
· Examples: - Run Python file teleop_twist_keyboard.py from package teleop_twist_keyboard:
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

rosnode
Display debugging information about ROS nodes, including publications, subscriptions and connections.
· Commands: rosnode list List active nodes.
rosnode info Print information about a node.
rosnode kill Kills a running node.
· Examples: - Get list of running nodes: rosnode list

COMMON - Kill node /cmd_el_mux:


- Get info from node /gazebo:
rosnode kill /cmd_vel_mux
rosnode info /gazebo
COMMAND-LINE
TOOLS rosmsg/rossrv
rosmsg/rossrv displays Message/Service (msg/srv) data structure definitions.
· Commands: rosmsg show Display the fields in the msg.
rossrv show Display the fields in a service msg
· Examples: - Show structure of message Twist: $ rosmsg show geometry_msgs/Twist
1 - Show structure of service message Trigger: $ rossrv show std_srvs/Trigger
www.robotigniteacademy.com ©2017 The Construct Sim, Inc. All Rights Reserved
IN 5 PAGES
Common Command-line Tools

rostopic
A tool for displaying debug information about ROS topics, including publishers, subscribers, publishing rate, and messages.
· Commands: rostopic echo Print messages to screen.
rostopic info Print information about a topics.
rostopic list Print information about active topics.
rostopic pub Publish data to topic.
· Examples:
- Get list of running topics: rostopic list
- Get info from topic /cmd_vel: rostopic info /cmd_vel
- Listen to topic /cmd_vel: rostopic echo /cmd_vel
- Publish a Twist message into topic /cmd_vel: rostopic pub /cmd_vel geometry_msgs/ Twist "linear:
x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0"

rosparam
A tool for getting and setting ROS parameters on the parameter server using YAML-encoded files.
· Commands: rosparam set Set a parameter.
rosparam get Get a parameter.
rosparam delete Delete a parameter.
rosparam list List parameter names.
· Examples: - List parameters loaded on the ROS Param Server: rosparam list
- Get value of parameter /camera/imager_rate: rosparam get /camera/imager_rate
- Set parameter /camera/imager_rate to 3.0: rosparam set /camera/imager_rate 3.0

rosservice
COMMON A tool for listing and querying ROS services.

COMMAND-LINE · Commands: rosservice


rosservice
list
type
Print information about active services.
Print the service type.
TOOLS rosservice info Get information from a service
rosservice call Call the service with the given args.
· Examples:
- Get list of running services: rosservice list
- Get service message used by the service /gazebo/delete_model: rosservice type /gazebo/delete_model
- Get information from the service /gazebo/delete_model: rosservice info /gazebo/delete_model
2 - Call service /gazebo/delete_model and provide argument model_name:
rosservice call /gazebo/delete_model "model_name:'bowl'"
www.robotigniteacademy.com ©2017 The Construct Sim, Inc. All Rights Reserved
IN 5 PAGES
Filesystem Command-line Tools

Filesystem Command-line Tools


· Commands: rospack A tool inspecting packages.
roscd Changes directories to a package or stack.
rosswtf Displays a errors and warnings about a running ROS system or launch file.
catkin_create_pkg A tool for creating a new packages.
· Usage:
$ rospack find [package]
$ roscd [package [/subdir]]
$ roswtf or roswtf [file]
$ catkin_create_pkg [name_of_pkg][dependencies]
· Examples:
- Find pack of package turtlebot_gazebo: $ rospack find turtlebot_gazebo
- Go to package turtlebot_gazebo: $ roscd turtlebot_gazebo
- Check for errors in keyboard_teleop.launch file: $ roswtf keyboard_teleop.launch

FILESYSTEM
COMMAND-LINE
TOOLS

3
www.robotigniteacademy.com ©2017 The Construct Sim, Inc. All Rights Reserved
IN 5 PAGES
Logging Command-line Tools

rosbag
This is a set of tools for recording from and playing back to ROS topics. It is intended to be high performance and
avoids deserialization and reserialization of the messages.
rosbag record will generate a ".bag" file (so named for historical reasons) with the contents of all topics that you
pass to it.
· Examples:
- Record all topics: $ rosbag record -a
- Record select topics: $ rosbag record topic1 topic2

rosbag play will take the contents of one or more bag file, and play them back in a time-synchronized fashion.
· Examples:
- Replay test.bag file: $ rosbag play test.bag
- Replay several bag files at once: $ rosbag info test.bag

LOGGING
COMMAND-LINE
TOOLS

4
www.robotigniteacademy.com ©2017 The Construct Sim, Inc. All Rights Reserved
IN 5 PAGES
Graphical Tools

rx_graph
Displays a graph of the ROS nodes that
are currently running, as well as the ROS
topics that connect them.
· Usage:
$ rqt_graph

view_frames
A tool for visualizing the full tree of coordinate transforms.
· Usage:
$ rosrun tf view_frames
$ evince frames.pdf

rx_plot
A tool for plotting data from one
or more ROS topic fields.
· Usage:
GRAPHICAL $ rqt_plot

TOOLS

5
www.robotigniteacademy.com ©2017 The Construct Sim, Inc. All Rights Reserved

You might also like