cli_cheats_sheet

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ROS 2 Cheats Sheet list Output a list of running containers and

components. interface Various ROS interfaces (actions/topics/services)-


load Load a component into a container related verbs. Interface type can be filtered with either of
Command Line Interface node. the following option, ‘--only-actions’, ‘--only-msgs’, ‘--only-
All ROS 2 CLI tools start with the prefix ‘ros2’ followed standalone Run a component into its own stan- srvs’.
by a command, a verb and (possibly) positional/optional dalone container node. Verbs:
arguments. types Output a list of components registered list List all interface types available.
For any tool, the documentation is accessible with, in the ament index. package Output a list of available interface types
$ ros2 command --help unload Unload a component from a container within one package.
and similarly for verb documentation, node. packages Output a list of packages that provide in-
$ ros2 command verb -h Examples: terfaces.
Similarly, auto-completion is available for all com- $ ros2 component list proto Print the prototype (body) of an inter-
mands/verbs and most positional/optional arguments. $ ros2 component load /ComponentManager \ faces.
E.g., composition composition::Talker show Output the interface definition.
$ ros2 command [tab][tab] $ ros2 component types Examples:
$ ros2 component unload /ComponentManager 1 $ ros2 interface list
Some of the examples below rely on:
$ ros2 interface package std msgs
ROS 2 demos package.
daemon Various daemon related verbs. $ ros2 interface packages --only-msgs
Verbs: $ ros2 interface proto example interfaces/srv/AddTwoInts
action Allows to manually send a goal and displays de- start Start the daemon if it isn’t running. $ ros2 interface show geometry msgs/msg/Pose
bugging information about actions. status Output the status of the daemon.
Verbs: stop Stop the daemon if it is running
info Output information about an action. launch Allows to run a launch file in an arbitrary package
list Output a list of action names. doctor A tool to check ROS setup and other potential without to ‘cd’ there first.
send goal Send an action goal. issues such as network, package versions, rmw middleware Usage:
show Output the action definition. etc. $ ros2 launch <package> <launch-file>
Examples: Alias: wtf (where’s the fire). Example:
$ ros2 action info /fibonacci Arguments: $ ros2 launch demo nodes cpp add two ints.launch.py
$ ros2 action list --report/-r Output report of all checks.
$ ros2 action send goal /fibonacci \ --report-fail/-rf Output report of failed checks lifecycle Various lifecycle related verbs.
action tutorials/action/Fibonacci ”order: 5” only. Verbs:
$ ros2 action show action tutorials/action/Fibonacci --include-warning/-iw Include warnings as failed get Get lifecycle state for one or more nodes.
checks. list Output a list of available transitions.
Examples: nodes Output a list of nodes with lifecycle.
bag Allows to record/play topics to/from a rosbag.
$ ros2 doctor set Trigger lifecycle state transition.
Verbs:
info Output information of a bag. $ ros2 doctor --report msg (deprecated) Displays debugging information about
play Play a bag. $ ros2 doctor --report-fail messages.
record Record a bag. $ ros2 doctor --include-warning Verbs:
Examples: $ ros2 doctor --include-warning --report-fail list Output a list of message types.
$ ros2 info <bag-name> or similarly, package Output a list of message types within a
$ ros2 play <bag-name> $ ros2 wtf given package.
$ ros2 record -a packages Output a list of packages which contain
extension points List extension points. messages.
component Various component related verbs. show Output the message definition.
Verbs: extensions List extensions. Examples:

c 2019 Canonical
$ ros2 msg list $ ros2 pkg executables demo nodes cpp
$ ros2 msg package std msgs $ ros2 pkg list srv (deprecated) Various srv related verbs.
$ ros2 msg packages $ ros2 pkg prefix std msgs Verbs:
$ ros2 msg show geometry msgs/msg/Pose $ ros2 pkg xml -t version list Output a list of available service types.
package Output a list of available service types
multicast Various multicast related verbs. run Allows to run an executable in an arbitrary package within one package.
Verbs: without having to ‘cd’ there first. packages Output a list of packages which contain
receive Receive a single UDP multicast packet. Usage: services.
send Send a single UDP multicast packet. $ ros2 run <package> <executable> show Output the service definition.

node Displays debugging information about nodes. Example: test Run a ROS2 launch test.
Verbs: $ ros2 run demo node cpp talker
info Output information about a node. topic A tool for displaying debug information about ROS
list Output a list of available nodes. security Various security related verbs. topics, including publishers, subscribers, publishing rate,
Examples: Verbs: and messages.
$ ros2 node info /talker create key Create key. Verbs:
$ ros2 node list create permission Create keystore. bw Display bandwidth used by topic.
generate artifacts Create permission. delay Display delay of topic from timestamp in
list keys Distribute key. header.
param Allows to manipulate parameters.
create keystore Generate keys and permission echo Output messages of a given topic to screen.
Verbs:
delete Delete parameter. files from a list of identities and find Find topics of a given type type.
describe Show descriptive information about de- policy files. hz Display publishing rate of topic.
clared parameters. distribute key Generate XML policy file from info Output information about a given topic.
dump Dump the parameters of a given node in ROS graph data. list Output list of active topics.
yaml format, either in terminal or in a file. generate policy List keys. pub Publish data to a topic.
get Get parameter. Examples (see sros2 package): type Output topic’s type.
list Output a list of available parameters. $ ros2 security create key demo keys /talker Examples:
set Set parameter $ ros2 security create permission demo keys /talker \ $ ros2 topic bw /chatter
Examples: policies/sample policy.xml $ ros2 topic echo /chatter
$ ros2 param delete /talker /use sim time $ ros2 security generate artifacts $ ros2 topic find rcl interfaces/msg/Log
$ ros2 param get /talker /use sim time $ ros2 security create keystore demo keys $ ros2 topic hz /chatter
$ ros2 param list $ ros2 topic info /chatter
$ ros2 param set /talker /use sim time false service Allows to manually call a service and displays de- $ ros2 topic list
bugging information about services. $ ros2 topic pub /chatter std msgs/msg/String \
pkg Create a ros2 package or output package(s)-related Verbs: ’data: Hello ROS 2 world’
information. call Call a service. $ ros2 topic type /rosout
Verbs: find Output a list of services of a given type.
create Create a new ROS2 package. list Output a list of service names.
executables Output a list of package specific exe- type Output service’s type.
cutables. Examples:
list Output a list of available packages. $ ros2 service call /add two ints \
prefix Output the prefix path of a package. example interfaces/AddTwoInts ”a: 1, b: 2”
xml Output the information contained in $ ros2 service find rcl interfaces/srv/ListParameters
the package xml manifest. $ ros2 service list
Examples: $ ros2 service type /talker/describe parameters

c 2019 Canonical

You might also like