ROS Cheat Sheet: Filesystem Command-Line Tools
ROS Cheat Sheet: Filesystem Command-Line Tools
rosrun
rosrun allows you to run an executable in an arbitrary package without having to cd (or roscd) there rst. Usage: $ rosrun package executable Example: Run turtlesim: $ rosrun turtlesim turtlesim node
Examples: Publish hello at 10 Hz: $ rostopic pub -r 10 /topic name std msgs/String hello Clear the screen after each message is published: $ rostopic echo -c /topic name Display messages that match a given Python expression: $ rostopic echo --filter "m.data==foo" /topic name Pipe the output of rostopic to rosmsg to view the msg type: $ rostopic type /topic name | rosmsg show
rosparam
A tool for getting and setting ROS parameters on the parameter server using YAML-encoded les. Commands: rosparam set rosparam get rosparam load rosparam dump rosparam delete rosparam list Set a parameter. Get a parameter. Load parameters from a le. Dump parameters to a le. Delete a parameter. List parameter names.
rosnode
Displays debugging information about ROS nodes, including publications, subscriptions and connections. Commands: rosnode ping rosnode list rosnode info rosnode machine rosnode kill Test connectivity to node. List active nodes. Print information about a node. List nodes running on a particular machine. Kills a running node.
Usage: $ rospack find [package] $ roscd [package[/subdir]] $ rosls [package[/subdir]] $ roscreate-pkg [package name] $ rosmake [package] $ rosdep install [package] $ roswtf or roswtf [file] $ rxdeps [options]
Examples: Kill all nodes: $ rosnode kill -a List nodes on a machine: $ rosnode machine aqy.local Ping all nodes: $ rosnode ping --all
Examples: List all the parameters in a namespace: $ rosparam list /namespace Setting a list with one as a string, integer, and oat: $ rosparam set /foo "[1, 1, 1.0]" Dump only the parameters in a specic namespace to le: $ rosparam dump dump.yaml /namespace
roslaunch
Starts ROS nodes locally and remotely via SSH, as well as setting parameters on the parameter server. Examples: Launch on a dierent port: $ roslaunch -p 1234 package filename.launch Launch a le in a package: $ roslaunch package filename.launch Launch on the local nodes: $ roslaunch --local package filename.launch
rosservice
A tool for listing and querying ROS services. Commands: rosservice list rosservice node rosservice rosservice rosservice rosservice rosservice call args type uri find Print information about active services. Print the name of the node providing a service. Call the service with the given args. List the arguments of a service. Print the service type. Print the service ROSRPC uri. Find services by service type.
rosmsg/rossrv
rosmsg/rossrv displays Message/Service (msg/srv) data structure denitions. Commands: rosmsg show Display the elds in the msg. rosmsg users Search for code using the msg. rosmsg md5 Display the msg md5 sum. rosmsg package List all the messages in a package. rosnode packages List all the packages with messages. Examples: Display the Pose msg: $ rosmsg show Pose List the messages in nav msgs: $ rosmsg package nav msgs List the les using sensor msgs/CameraInfo: $ rosmsg users sensor msgs/CameraInfo
rostopic
A tool for displaying debug information about ROS topics, including publishers, subscribers, publishing rate, and messages. Commands: rostopic bw rostopic echo rostopic hz rostopic list rostopic pub rostopic type rostopic find Display bandwidth used by topic. Print messages to screen. Display publishing rate of topic. Print information about active topics. Publish data to topic. Print topic type. Find topics by type.
Examples: Call a service from the command-line: $ rosservice call /add two ints 1 2 Pipe the output of rosservice to rossrv to view the srv type: $ rosservice type add two ints | rossrv show Display all services of a particular type: $ rosservice find rospy tutorials/AddTwoInts
rxbag
A tool for visualizing, inspecting, and replaying histories (bag les) of ROS messages.
rxconsole
A tool for displaying and ltering messages published on rosout.
Graphical Tools
rxgraph
Displays a graph of the ROS nodes that are currently running, as well as the ROS topics that connect them.
tf Command-line Tools
tf echo
A tool that prints the information about a particular transformation between a source frame and a target frame. Usage: $ rosrun tf tf echo <source frame> <target frame> Examples: To echo the transform between /map and /odom: $ rosrun tf tf echo /map /odom
rxplot
A tool for plotting data from one or more ROS topic elds using matplotlib.
Examples: To graph the data in dierent plots: $ rxplot /topic1/field1 /topic2/field2 To graph the data all on the same plot: $ rxplot /topic1/field1,/topic2/field2 To graph multiple elds of a message: $ rxplot /topic1/field1:field2:field3
view frames
A tool for visualizing the full tree of coordinate transforms. Usage: $ rosrun tf view frames $ evince frames.pdf
Copyright c 2010 Willow Garage