Ros Cheatsheet
Ros Cheatsheet
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
ROS 2 Cheats Sheet Global options: Test two packages including dependencies, and print on ter-
◦ --log-base <path> The base path for all log directories minal:
(default: log). $ colcon test --packages-up-to demo nodes cpp \
colcon - collective construction ◦ --log-level <level> Set log level for the console output, demo nodes py --event-handlers console direct+
colcon is a command line tool to improve the workflow of either by numeric or string value (default: warn) Pass arguments to pytest (e.g. to print a coverage report):
building, testing and using multiple software packages. It $ colcon test --packages-select demo nodes cpp \
automates the process, handles the ordering and sets up build Build a set of packages. --event-handlers console direct+ \
the environment to use the packages. Examples: --pytest-args --cov=sros2
All colcon tools start with the prefix ‘colcon’ followed by a Build the whole workspace:
command and (likely) positional/optional arguments. $ colcon build test-result Show the test results generated when testing
For any tool, the documentation is accessible with, Build a single package excluding dependencies: a set of packages.
$ colcon command --help $ colcon build --packages-selected demo nodes cpp Example:
Moreover, colcon offers auto-completion for all verbs and Build two packages including dependencies, use symlinks Show all test results generated, including successful tests:
most positional/optional arguments. E.g., instead of copying files where possible and print immedi- $ colcon test-result --all
$ colcon command [tab][tab] ately on terminal:
Find out how to enable auto-completion at colcon’s online $ colcon build --packages-up-to demo nodes cpp \ version-check Compare local package versions with PyPI.
documentation. action tutorials --symlink-install \ Examples:
--event-handlers console direct+ $ todo
Environment variables:
◦ CMAKE COMMAND The full path to the CMake exe- extension-points List extension points. Must know colcon flags.
cutable. ◦ --symlink-install Use ‘symlinks’ instead of installing
◦ COLCON ALL SHELLS Flag to enable all shell exten- extensions Package information. (copying) files where possible.
sions. ◦ --continue-on-error Continue other packages when a
◦ COLCON COMPLETION LOGFILE Set the logfile for info List extension points. package fails to build. Packages recursively depending on
completion time. the failed package are skipped.
◦ COLCON DEFAULTS FILE Set path to the yaml file con- list List packages, optionally in topological ordering. ◦ --event-handlers console direct+ Show output on console.
taining the default values for the command line arguments Example: ◦ --event-handlers console cohesion+ Show output on con-
(default:$COLCON HOME/defaults.yaml). List all packages in the workspace: sole after a package has finished.
◦ COLCON DEFAULT EXECUTOR Select the default ex- $ colcon list ◦ --packages-select Build only specific package(s).
ecutor extension. List all packages names in topological order up-to a given ◦ --packages-up-to Build specific package(s) and its/their
◦ COLCON EXTENSION BLACKLIST Blacklist exten- package: recursive dependencies.
sions which should not be used. $ colcon list --names-only --topological-order \ ◦ --packages-above Build specific package(s) and other
◦ COLCON HOME Set the configuration directory (de- --packages-up-to demo nodes cpp packages that recursively depending on it.
fault: /.colcon.) ◦ --packages-skip Skip package(s).
◦ COLCON LOG LEVEL Set the log level (debug—10, metadata Manage metadata of packages. ◦ --packages-skip-build-finished Skip a set of packages
info—20, warn—30, error—40, critical—50, or any other which have finished to build previously.
positive numeric value). test Test a set of packages. ◦ --cmake-args Pass arguments to CMake projects.
◦ COLCON LOG PATH Set the log directory (default: Example: ◦ --cmake-clean-cache Remove CMake cache before the
$COLCON HOME/log). Test the whole workspace: build (implicitly forcing CMake configure step).
◦ CTEST COMMAND The full path to the CTest exe- $ colcon test ◦ --cmake-clean-first Build target ‘clean’ first, then build
cutable. Test a single package excluding dependencies: (to only clean use ’–cmake-target clean’).
◦ POWERSHELL COMMAND The full path to the Pow- $ colcon test --packages-select demo nodes cpp ◦ --cmake-force-configure Force CMake configure step.
erShell executable. Test a package including packages that depend on it:
$ colcon test --packages-above demo nodes py
c 2019 Canonical