├── .gitignore ├── LICENSE ├── README.md ├── cli ├── Makefile ├── cli_cheats_sheet.pdf └── cli_cheats_sheet.tex └── colcon ├── Makefile ├── colcon_cheats_sheet.pdf └── colcon_cheats_sheet.tex /.gitignore: -------------------------------------------------------------------------------- 1 | *.synctex.gz 2 | build/ 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2019 Canonical 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ros2_cheats_sheet 2 | A collection of ROS2-related cheats sheet 3 | 4 | ### Cheats Sheet list 5 | * [Command Line Interface](cli/cli_cheats_sheet.pdf) 6 | * [Colcon](colcon/colcon_cheats_sheet.pdf) 7 | -------------------------------------------------------------------------------- /cli/Makefile: -------------------------------------------------------------------------------- 1 | PDFLATEX = pdflatex -shell-escape -interaction=nonstopmode -file-line-error 2 | 3 | CLI = cli_cheats_sheet 4 | 5 | all: $(CLI).pdf clean 6 | 7 | $(CLI).pdf: $(CLI).tex 8 | $(PDFLATEX) $(CLI).tex 9 | 10 | clean : 11 | rm -f $(CLI).log $(CLI).aux $(CLI).blg $(CLI).toc 12 | -------------------------------------------------------------------------------- /cli/cli_cheats_sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubuntu-robotics/ros2_cheats_sheet/6b9d0506bc665c3cfb31bc5ef2e1396f26293971/cli/cli_cheats_sheet.pdf -------------------------------------------------------------------------------- /cli/cli_cheats_sheet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[9pt,a4paper]{article} 2 | \usepackage[margin=1cm,landscape]{geometry} 3 | \geometry{ 4 | a4paper, 5 | left=10mm, 6 | right=10mm, 7 | headheight=1cm, 8 | top=1cm, 9 | bottom=1.5cm, 10 | footskip=1cm, 11 | %showframe 12 | } 13 | 14 | %\usepackage{lipsum} 15 | 16 | \usepackage{hyperref} % For hyperlinks 17 | \hypersetup{ 18 | colorlinks=true, 19 | %linkcolor=blue, 20 | %filecolor=magenta, 21 | urlcolor=cyan, 22 | } 23 | 24 | \usepackage{multicol} % For overall column layout 25 | \usepackage{xcolor} % For colors 26 | \usepackage{tabularx} 27 | \usepackage{fancyhdr} % For footer 28 | 29 | \pagenumbering{gobble} % No page numbering 30 | \pagestyle{fancy} 31 | \fancyhead{} % No header 32 | \renewcommand{\headrulewidth}{0pt} % No header rule 33 | 34 | \cfoot{\copyright~2019 Canonical} % Actual footer text 35 | 36 | % A bunch of command for boilerplate text 37 | \newcommand{\clicmd}[1]{\textbf{\sffamily\color{blue}#1}~~} 38 | \newcommand{\cliverb}[1]{{\sffamily\color{blue}#1}~~} 39 | \newcommand{\cliopt}[1]{{\sffamily#1}~~} 40 | \newcommand{\textangles}[1]{\textless #1\textgreater} 41 | \newcommand{\smallhspace}{\-\hspace{0.3cm}} 42 | \newcommand{\terminal}[1]{\-\hspace{0.5cm}{\sffamily\$ #1}} 43 | \newcommand{\terminalinebreak}[1]{\ \textbackslash\hfill\phantom{.}\linebreak\-\hspace{0.5cm}~} 44 | \newcommand{\ddash}{-{}-} 45 | \newcommand{\deprecated}[1]{{\color{orange}(deprecated)#1}} 46 | 47 | \begin{document} 48 | \setlength\parindent{0pt} 49 | \begin{multicols*}{3}[] 50 | 51 | \begin{center} 52 | \textbf{\Large ROS 2 Cheats Sheet} 53 | \end{center} 54 | % 55 | 56 | \hrulefill 57 | 58 | \textbf{Command Line Interface} 59 | 60 | % 61 | All ROS 2 CLI tools start with the prefix `ros2' followed by a command, 62 | a verb and (possibly) positional/optional arguments. 63 | 64 | For any tool, the documentation is accessible with,\\ 65 | % 66 | \terminal{ros2 \clicmd{command} \ddash help}\\ 67 | % 68 | and similarly for verb documentation,\\ 69 | % 70 | \terminal{ros2 \clicmd{command} \cliverb{verb} -h} 71 | 72 | Similarly, auto-completion is available for all commands/verbs and 73 | most positional/optional arguments. E.g.,\\ 74 | % 75 | \terminal{ros2 \clicmd{command} [tab][tab]} 76 | 77 | Some of the examples below rely on:\\ 78 | \href{https://github.com/ros2/demos}{ROS 2 demos package}. 79 | 80 | \hrulefill 81 | 82 | % 83 | \clicmd{action} Allows to manually send a goal and 84 | displays debugging information about actions. 85 | \\ 86 | Verbs: 87 | \\ 88 | \begin{tabularx}{\linewidth}{lX} 89 | \smallhspace \cliverb{info} & Output information about an action. \\ 90 | \smallhspace \cliverb{list} & Output a list of action names. \\ 91 | \smallhspace \cliverb{send\_goal} & Send an action goal. \\ 92 | \smallhspace \cliverb{show} & Output the action definition. 93 | \end{tabularx} 94 | % 95 | Examples: 96 | \\ 97 | \terminal{ros2 action info /fibonacci} \\ 98 | \terminal{ros2 action list} \\ 99 | \terminal{ros2 action send\_goal /fibonacci 100 | \terminalinebreak~action\_tutorials/action/Fibonacci "{order: 5}"} \\ 101 | \terminal{ros2 action show action\_tutorials/action/Fibonacci} 102 | 103 | \hrulefill 104 | 105 | % 106 | \clicmd{bag} Allows to record/play topics to/from a rosbag. 107 | \\ 108 | Verbs: 109 | \\ 110 | % 111 | \begin{tabularx}{\linewidth}{lX} 112 | \smallhspace \cliverb{info} & Output information of a bag.\\ 113 | \smallhspace \cliverb{play} & Play a bag.\\ 114 | \smallhspace \cliverb{record} & Record a bag. 115 | \end{tabularx} 116 | % 117 | \\ 118 | Examples: 119 | \\ 120 | \terminal{ros2 info \textangles{bag-name}}\\ 121 | \terminal{ros2 play \textangles{bag-name}}\\ 122 | \terminal{ros2 record -a} 123 | % 124 | 125 | \hrulefill 126 | 127 | % 128 | \clicmd{component} Various component related verbs.\\ 129 | Verbs: 130 | \\ 131 | % 132 | \begin{tabularx}{\linewidth}{lX} 133 | \smallhspace \cliverb{list} & Output a list of running containers and components. \\ 134 | \smallhspace \cliverb{load} & Load a component into a container node. \\ 135 | \smallhspace \cliverb{standalone} & Run a component into its own standalone container node. \\ 136 | \smallhspace \cliverb{types} & Output a list of components registered in the ament index. \\ 137 | \smallhspace \cliverb{unload} & Unload a component from a container node. 138 | \end{tabularx} 139 | % 140 | \\ 141 | Examples: 142 | \\ 143 | \terminal{ros2 component list}\\ 144 | \terminal{ros2 component load /ComponentManager\terminalinebreak~composition composition::Talker}\\ 145 | \terminal{ros2 component types}\\ 146 | \terminal{ros2 component unload /ComponentManager 1} 147 | 148 | \hrulefill 149 | 150 | % 151 | \clicmd{daemon} Various daemon related verbs.\\ 152 | Verbs: 153 | \\ 154 | \begin{tabularx}{\linewidth}{lX} 155 | \smallhspace \cliverb{start} & Start the daemon if it isn't running. \\ 156 | \smallhspace \cliverb{status} & Output the status of the daemon. \\ 157 | \smallhspace \cliverb{stop} & Stop the daemon if it is running 158 | \end{tabularx} 159 | % 160 | 161 | \hrulefill 162 | 163 | % 164 | \clicmd{doctor} A tool to check ROS setup and other potential issues such as network, package versions, 165 | rmw middleware etc. \\ 166 | Alias: \clicmd{wtf} (where's the fire). \\ 167 | % 168 | Arguments: \\ 169 | % 170 | \begin{tabularx}{\linewidth}{lX} 171 | \smallhspace \cliopt{\ddash report/-r} & Output report of all checks. \\ 172 | \smallhspace \cliopt{\ddash report-fail/-rf} & Output report of failed checks only. \\ 173 | \smallhspace \cliopt{\ddash include-warning/-iw} & Include warnings as failed checks. \\ 174 | \end{tabularx} 175 | % 176 | Examples: 177 | \\ 178 | \terminal{ros2 doctor} \\ 179 | \terminal{ros2 doctor \ddash report} \\ 180 | \terminal{ros2 doctor \ddash report-fail} \\ 181 | \terminal{ros2 doctor \ddash include-warning} \\ 182 | \terminal{ros2 doctor \ddash include-warning \ddash report-fail} \\ 183 | or similarly, \\ 184 | \terminal{ros2 wtf} 185 | % 186 | 187 | \hrulefill 188 | 189 | % 190 | \clicmd{extension\_points} List extension points. 191 | % 192 | 193 | \hrulefill 194 | 195 | % 196 | \clicmd{extensions} List extensions. 197 | % 198 | 199 | \hrulefill 200 | 201 | % 202 | \clicmd{interface} Various ROS interfaces 203 | (actions/topics/services)-related verbs. 204 | Interface type can be filtered with either of the following option, 205 | `\ddash only-actions', `\ddash only-msgs', `\ddash only-srvs'. 206 | % 207 | \\ 208 | Verbs: 209 | \\ 210 | % 211 | \begin{tabularx}{\linewidth}{lX} 212 | \smallhspace \cliverb{list} & List all interface types available. \\ 213 | \smallhspace \cliverb{package} & Output a list of available interface types within one package. \\ 214 | \smallhspace \cliverb{packages} & Output a list of packages that provide interfaces. \\ 215 | \smallhspace \cliverb{proto} & Print the prototype (body) of an interfaces. \\ 216 | \smallhspace \cliverb{show} & Output the interface definition. 217 | \end{tabularx} 218 | % 219 | Examples: 220 | \\ 221 | \terminal{ros2 interface list} \\ 222 | \terminal{ros2 interface package std\_msgs} \\ 223 | \terminal{ros2 interface packages \ddash only-msgs} \\ 224 | \terminal{ros2 interface proto example\_interfaces/srv/AddTwoInts} \\ 225 | \terminal{ros2 interface show geometry\_msgs/msg/Pose} 226 | 227 | \hrulefill 228 | 229 | % 230 | \clicmd{launch} Allows to run a launch file in an arbitrary package 231 | without to `cd' there first. 232 | \\ 233 | Usage: 234 | \\ 235 | \terminal{ros2 launch \textangles{package}~\textangles{launch-file}} 236 | \\ 237 | Example: 238 | \\ 239 | \terminal{ros2 launch demo\_nodes\_cpp add\_two\_ints.launch.py} 240 | % 241 | 242 | \hrulefill 243 | 244 | % 245 | \clicmd{lifecycle} Various lifecycle related verbs. 246 | \\ 247 | Verbs: 248 | \\ 249 | % 250 | \begin{tabularx}{\linewidth}{lX} 251 | \smallhspace \cliverb{get} & Get lifecycle state for one or more nodes. \\ 252 | \smallhspace \cliverb{list} & Output a list of available transitions. \\ 253 | \smallhspace \cliverb{nodes} & Output a list of nodes with lifecycle. \\ 254 | \smallhspace \cliverb{set} & Trigger lifecycle state transition. 255 | \end{tabularx} 256 | % 257 | 258 | \hrulefill 259 | 260 | % 261 | \clicmd{msg} \deprecated~Displays debugging information about messages. 262 | \\ 263 | Verbs: 264 | \\ 265 | \begin{tabularx}{\linewidth}{lX} 266 | \smallhspace \cliverb{list} & Output a list of message types. \\ 267 | \smallhspace \cliverb{package} & Output a list of message types within a given package. \\ 268 | \smallhspace \cliverb{packages} & Output a list of packages which contain messages. \\ 269 | \smallhspace \cliverb{show} & Output the message definition. 270 | \end{tabularx} 271 | % 272 | Examples: 273 | \\ 274 | \terminal{ros2 msg list} \\ 275 | \terminal{ros2 msg package std\_msgs} \\ 276 | \terminal{ros2 msg packages} \\ 277 | \terminal{ros2 msg show geometry\_msgs/msg/Pose} 278 | % 279 | 280 | \hrulefill 281 | 282 | % 283 | \clicmd{multicast} Various multicast related verbs. 284 | \\ 285 | Verbs: 286 | \\ 287 | \begin{tabularx}{\linewidth}{lX} 288 | \smallhspace \cliverb{receive} & Receive a single UDP multicast packet. \\ 289 | \smallhspace \cliverb{send} & Send a single UDP multicast packet. 290 | \end{tabularx} 291 | % 292 | 293 | \hrulefill 294 | 295 | % 296 | \clicmd{node} Displays debugging information about nodes. 297 | \\ 298 | Verbs: 299 | \\ 300 | \begin{tabularx}{\linewidth}{lX} 301 | \smallhspace \cliverb{info} & Output information about a node. \\ 302 | \smallhspace \cliverb{list} & Output a list of available nodes. 303 | \end{tabularx} 304 | % 305 | Examples: 306 | \\ 307 | \terminal{ros2 node info /talker} \\ 308 | \terminal{ros2 node list} 309 | % 310 | 311 | \hrulefill 312 | 313 | % 314 | \clicmd{param} Allows to manipulate parameters. 315 | \\ 316 | Verbs: 317 | \\ 318 | \begin{tabularx}{\linewidth}{lX} 319 | \smallhspace \cliverb{delete} & Delete parameter. \\ 320 | \smallhspace \cliverb{describe} & Show descriptive information about declared parameters. \\ 321 | \smallhspace \cliverb{dump} & Dump the parameters of a given node in yaml format, either in terminal or in a file.\\ 322 | \smallhspace \cliverb{get} & Get parameter. \\ 323 | \smallhspace \cliverb{list} & Output a list of available parameters. \\ 324 | \smallhspace \cliverb{set} & Set parameter 325 | \end{tabularx} 326 | % 327 | Examples: 328 | \\ 329 | \terminal{ros2 param delete /talker /use\_sim\_time} \\ 330 | \terminal{ros2 param get /talker /use\_sim\_time} \\ 331 | \terminal{ros2 param list} \\ 332 | \terminal{ros2 param set /talker /use\_sim\_time false} 333 | % 334 | 335 | \hrulefill 336 | 337 | % 338 | \clicmd{pkg} Create a ros2 package or output package(s)-related information. 339 | \\ 340 | Verbs: 341 | \\ 342 | \begin{tabularx}{\linewidth}{lX} 343 | \smallhspace \cliverb{create} & Create a new ROS2 package. \\ 344 | \smallhspace \cliverb{executables} & Output a list of package specific executables. \\ 345 | \smallhspace \cliverb{list} & Output a list of available packages. \\ 346 | \smallhspace \cliverb{prefix} & Output the prefix path of a package. \\ 347 | \smallhspace \cliverb{xml} & Output the information contained in the package xml manifest. 348 | \end{tabularx} 349 | % 350 | Examples: 351 | \\ 352 | \terminal{ros2 pkg executables demo\_nodes\_cpp} \\ 353 | \terminal{ros2 pkg list} \\ 354 | \terminal{ros2 pkg prefix std\_msgs} \\ 355 | \terminal{ros2 pkg xml -t version} 356 | % 357 | 358 | \hrulefill 359 | 360 | % 361 | \clicmd{run} Allows to run an executable in an arbitrary package 362 | without having to `cd' there first. 363 | \\ 364 | Usage: 365 | \\ 366 | \terminal{ros2 run \textangles{package}~\textangles{executable}} 367 | \\ 368 | Example: 369 | \\ 370 | \terminal{ros2 run demo\_node\_cpp talker} 371 | % 372 | 373 | \hrulefill 374 | 375 | % 376 | \clicmd{security} Various security related verbs. 377 | \\ 378 | Verbs: 379 | \\ 380 | % 381 | \begin{tabularx}{\linewidth}{lX} 382 | \smallhspace \cliverb{create\_key} & Create key. \\ 383 | \smallhspace \cliverb{create\_permission} & Create keystore. \\ 384 | \smallhspace \cliverb{generate\_artifacts} & Create permission. \\ 385 | \smallhspace \cliverb{list\_keys} & Distribute key. \\ 386 | \smallhspace \cliverb{create\_keystore} & Generate keys and permission 387 | files from a list of identities and policy files. \\ 388 | \smallhspace \cliverb{distribute\_key} & Generate XML policy file from ROS graph data.\\ 389 | \smallhspace \cliverb{generate\_policy} & List keys. 390 | \end{tabularx} 391 | % 392 | Examples (see \href{https://github.com/ros2/sros2}{sros2 package}): 393 | \\ 394 | \terminal{ros2 security create\_key demo\_keys /talker} \\ 395 | \terminal{ros2 security create\_permission demo\_keys /talker 396 | \terminalinebreak~policies/sample\_policy.xml} \\ 397 | \terminal{ros2 security generate\_artifacts} \\ 398 | %\terminal{ros2 security list\_keys} \\ 399 | \terminal{ros2 security create\_keystore demo\_keys} 400 | %\terminal{ros2 security distribute\_key} \\ 401 | %\terminal{ros2 security generate\_policy} 402 | 403 | \hrulefill 404 | 405 | % 406 | \clicmd{service} Allows to manually call a service and displays debugging 407 | information about services. 408 | \\ 409 | Verbs: 410 | \\ 411 | \begin{tabularx}{\linewidth}{lX} 412 | \smallhspace \cliverb{call} & Call a service. \\ 413 | \smallhspace \cliverb{find} & Output a list of services of a given type. \\ 414 | \smallhspace \cliverb{list} & Output a list of service names. \\ 415 | \smallhspace \cliverb{type} & Output service's type. 416 | \end{tabularx} 417 | % 418 | Examples: 419 | \\ 420 | \terminal{ros2 service call /add\_two\_ints 421 | \terminalinebreak~example\_interfaces/AddTwoInts "{a: 1, b: 2}"} \\ 422 | \terminal{ros2 service find rcl\_interfaces/srv/ListParameters} \\ 423 | \terminal{ros2 service list} \\ 424 | \terminal{ros2 service type /talker/describe\_parameters} 425 | % 426 | 427 | \hrulefill 428 | 429 | % 430 | \clicmd{srv} \deprecated~Various srv related verbs. 431 | \\ 432 | Verbs: 433 | \\ 434 | % 435 | \begin{tabularx}{\linewidth}{lX} 436 | \smallhspace \cliverb{list} & Output a list of available service types.\\ 437 | \smallhspace \cliverb{package} & Output a list of available service types within one package.\\ 438 | \smallhspace \cliverb{packages} & Output a list of packages which contain services.\\ 439 | \smallhspace \cliverb{show} & Output the service definition. 440 | \end{tabularx} 441 | % 442 | 443 | \hrulefill 444 | 445 | % 446 | \clicmd{test} Run a ROS2 launch test. 447 | % 448 | 449 | \hrulefill 450 | 451 | % 452 | \clicmd{topic} A tool for displaying debug information about ROS topics, 453 | including publishers, subscribers, publishing rate, and 454 | messages. 455 | \\ 456 | Verbs: 457 | \\ 458 | % 459 | \begin{tabularx}{\linewidth}{lX} 460 | \smallhspace \cliverb{bw} & Display bandwidth used by topic. \\ 461 | \smallhspace \cliverb{delay} & Display delay of topic from timestamp in header. \\ 462 | \smallhspace \cliverb{echo} & Output messages of a given topic to screen. \\ 463 | \smallhspace \cliverb{find} & Find topics of a given type type. \\ 464 | \smallhspace \cliverb{hz} & Display publishing rate of topic. \\ 465 | \smallhspace \cliverb{info} & Output information about a given topic. \\ 466 | \smallhspace \cliverb{list} & Output list of active topics. \\ 467 | \smallhspace \cliverb{pub} & Publish data to a topic. \\ 468 | \smallhspace \cliverb{type} & Output topic's type. 469 | \end{tabularx} 470 | % 471 | Examples: 472 | \\ 473 | \terminal{ros2 topic bw /chatter} \\ 474 | %\terminal{ros2 topic delay} \\ 475 | \terminal{ros2 topic echo /chatter} \\ 476 | \terminal{ros2 topic find rcl\_interfaces/msg/Log} \\ 477 | \terminal{ros2 topic hz /chatter} \\ 478 | \terminal{ros2 topic info /chatter} \\ 479 | \terminal{ros2 topic list} \\ 480 | \terminal{ros2 topic pub /chatter std\_msgs/msg/String 481 | \terminalinebreak~'data: Hello ROS 2 world'} \\ 482 | \terminal{ros2 topic type /rosout} \\ 483 | 484 | \end{multicols*} 485 | \end{document} 486 | -------------------------------------------------------------------------------- /colcon/Makefile: -------------------------------------------------------------------------------- 1 | PDFLATEX = pdflatex -shell-escape -interaction=nonstopmode -file-line-error 2 | 3 | MAIN = colcon_cheats_sheet 4 | 5 | all: $(MAIN).pdf clean 6 | 7 | $(MAIN).pdf: $(MAIN).tex 8 | $(PDFLATEX) $(MAIN).tex 9 | 10 | clean : 11 | rm -f $(MAIN).log $(MAIN).aux $(MAIN).blg $(MAIN).toc 12 | -------------------------------------------------------------------------------- /colcon/colcon_cheats_sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubuntu-robotics/ros2_cheats_sheet/6b9d0506bc665c3cfb31bc5ef2e1396f26293971/colcon/colcon_cheats_sheet.pdf -------------------------------------------------------------------------------- /colcon/colcon_cheats_sheet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[9pt,a4paper]{article} 2 | \usepackage[margin=1cm,landscape]{geometry} 3 | \geometry{ 4 | a4paper, 5 | left=10mm, 6 | right=10mm, 7 | headheight=1cm, 8 | top=1cm, 9 | bottom=1.5cm, 10 | footskip=1cm, 11 | %showframe 12 | } 13 | 14 | %\usepackage{lipsum} 15 | 16 | \usepackage{hyperref} % For hyperlinks 17 | \hypersetup{ 18 | colorlinks=true, 19 | %linkcolor=blue, 20 | %filecolor=magenta, 21 | urlcolor=cyan, 22 | } 23 | 24 | \usepackage{multicol} % For overall column layout 25 | \usepackage{xcolor} % For colors 26 | \usepackage{tabularx} 27 | \usepackage{fancyhdr} % For footer 28 | 29 | \pagenumbering{gobble} % No page numbering 30 | \pagestyle{fancy} 31 | \fancyhead{} % No header 32 | \renewcommand{\headrulewidth}{0pt} % No header rule 33 | 34 | \cfoot{\copyright~2019 Canonical} % Actual footer text 35 | 36 | % A bunch of command for boilerplate text 37 | \newcommand{\colconcmd}[1]{\textbf{\sffamily\color{blue}#1}~~} 38 | \newcommand{\colconverb}[1]{{\sffamily\color{blue}#1}~~} %\verb already defined 39 | \newcommand{\textangles}[1]{\textless #1\textgreater} 40 | \newcommand{\smallhspace}{\-\hspace{0.3cm}} 41 | \newcommand{\terminalfont}[1]{{\sffamily#1}} 42 | \newcommand{\terminal}[1]{\-\hspace{0.5cm}\terminalfont{\$ #1}} 43 | \newcommand{\terminalinebreak}[1]{\ \textbackslash\hfill\phantom{.}\linebreak\-\hspace{0.5cm}~} 44 | \newcommand{\ddash}{-{}-} 45 | 46 | \begin{document} 47 | \setlength\parindent{0pt} 48 | \begin{multicols*}{3}[] 49 | 50 | \begin{center} 51 | \textbf{\Large ROS 2 Cheats Sheet} 52 | \end{center} 53 | % 54 | 55 | \hrulefill 56 | 57 | \textbf{colcon - collective construction}\\ 58 | colcon is a command line tool to improve the workflow of building, 59 | testing and using multiple software packages. 60 | It automates the process, 61 | handles the ordering and sets up the environment to use the packages. 62 | 63 | All colcon tools start with the prefix `colcon' followed by a command 64 | and (likely) positional/optional arguments. 65 | 66 | For any tool, the documentation is accessible with,\\ 67 | % 68 | \terminal{colcon \colconcmd{command} \ddash help}\\ 69 | % 70 | Moreover, colcon offers auto-completion for all verbs and 71 | most positional/optional arguments. E.g.,\\ 72 | % 73 | \terminal{colcon \colconcmd{command} [tab][tab]} 74 | 75 | Find out how to enable auto-completion at 76 | \href{https://colcon.readthedocs.io/en/released/index.html} 77 | {colcon's online documentation}. 78 | 79 | \hrulefill 80 | 81 | Environment variables:\\ 82 | % 83 | % \begin{tabularx}{\linewidth}{X} 84 | $\circ$ \terminalfont{CMAKE\_COMMAND} 85 | \smallhspace 86 | The full path to the CMake executable. \\ 87 | % 88 | $\circ$ \terminalfont{COLCON\_ALL\_SHELLS} 89 | \smallhspace 90 | Flag to enable all shell extensions. \\ 91 | % 92 | $\circ$ \terminalfont{COLCON\_COMPLETION\_LOGFILE} 93 | \smallhspace 94 | Set the logfile for completion time. \\ 95 | % 96 | $\circ$ \terminalfont{COLCON\_DEFAULTS\_FILE} 97 | \smallhspace 98 | Set path to the yaml file containing the default values for 99 | the command line arguments (default:\$COLCON\_HOME/defaults.yaml). \\ 100 | % 101 | $\circ$ \terminalfont{COLCON\_DEFAULT\_EXECUTOR} 102 | \smallhspace 103 | Select the default executor extension. \\ 104 | % 105 | $\circ$ \terminalfont{COLCON\_EXTENSION\_BLACKLIST} 106 | \smallhspace 107 | Blacklist extensions which should not be used. \\ 108 | % 109 | $\circ$ \terminalfont{COLCON\_HOME} 110 | \smallhspace 111 | Set the configuration directory (default: ~/.colcon.) \\ 112 | % 113 | $\circ$ \terminalfont{COLCON\_LOG\_LEVEL} 114 | \smallhspace 115 | Set the log level (debug|10, info|20, warn|30, error|40, critical|50, 116 | or any other positive numeric value). \\ 117 | % 118 | $\circ$ \terminalfont{COLCON\_LOG\_PATH} 119 | \smallhspace 120 | Set the log directory (default: \$COLCON\_HOME/log). \\ 121 | % 122 | $\circ$ \terminalfont{CTEST\_COMMAND} 123 | \smallhspace 124 | The full path to the CTest executable. \\ 125 | % 126 | $\circ$ \terminalfont{POWERSHELL\_COMMAND} 127 | \smallhspace 128 | The full path to the PowerShell executable. 129 | % 130 | % \end{tabularx} 131 | % 132 | 133 | \hrulefill 134 | 135 | Global options:\\ 136 | % 137 | $\circ$ \terminalfont{\ddash log-base \textangles{path}} 138 | The base path for all log directories (default: log). \\ 139 | % 140 | $\circ$ \terminalfont{\ddash log-level \textangles{level}} 141 | Set log level for the console output, either by numeric or string value (default: warn) 142 | 143 | \hrulefill 144 | 145 | % 146 | \colconcmd{build} Build a set of packages. 147 | \\ 148 | Examples: 149 | \\ 150 | Build the whole workspace: \\ 151 | \terminal{colcon build} \\ 152 | % 153 | Build a single package excluding dependencies: \\ 154 | \terminal{colcon build \ddash packages-selected demo\_nodes\_cpp} \\ 155 | % 156 | Build two packages including dependencies, 157 | use symlinks instead of copying files where possible and 158 | print immediately on terminal:\\ 159 | \terminal{colcon build \ddash packages-up-to demo\_nodes\_cpp 160 | \terminalinebreak~action\_tutorials \ddash symlink-install 161 | \terminalinebreak~\ddash event-handlers console\_direct+} 162 | % 163 | 164 | \hrulefill 165 | 166 | % 167 | \colconcmd{extension-points} List extension points. 168 | % 169 | 170 | \hrulefill 171 | 172 | % 173 | \colconcmd{extensions} Package information. 174 | % 175 | 176 | \hrulefill 177 | 178 | % 179 | \colconcmd{info} List extension points. 180 | % 181 | 182 | \hrulefill 183 | 184 | % 185 | \colconcmd{list} List packages, optionally in topological ordering. 186 | \\ 187 | Example: 188 | \\ 189 | List all packages in the workspace:\\ 190 | \terminal{colcon list} \\ 191 | % 192 | List all packages names in topological order up-to a given package:\\ 193 | \terminal{colcon list \ddash names-only \ddash topological-order 194 | \terminalinebreak~\ddash packages-up-to demo\_nodes\_cpp} 195 | % 196 | 197 | \hrulefill 198 | 199 | % 200 | \colconcmd{metadata} Manage metadata of packages. 201 | % 202 | % \\ 203 | % 204 | % Examples: 205 | % \\ 206 | % \terminal{todo} 207 | 208 | \hrulefill 209 | 210 | % 211 | \colconcmd{test} Test a set of packages. 212 | \\ 213 | Example: 214 | \\ 215 | Test the whole workspace:\\ 216 | \terminal{colcon test} \\ 217 | % 218 | Test a single package excluding dependencies:\\ 219 | \terminal{colcon test \ddash packages-select demo\_nodes\_cpp} \\ 220 | % 221 | Test a package including packages that depend on it:\\ 222 | \terminal{colcon test \ddash packages-above demo\_nodes\_py} \\ 223 | % 224 | Test two packages including dependencies, 225 | and print on terminal:\\ 226 | \terminal{colcon test \ddash packages-up-to demo\_nodes\_cpp 227 | \terminalinebreak~demo\_nodes\_py 228 | \ddash event-handlers console\_direct+} \\ 229 | % 230 | Pass arguments to pytest (e.g. to print a coverage report):\\ 231 | \terminal{colcon test \ddash packages-select demo\_nodes\_cpp 232 | \terminalinebreak~\ddash event-handlers console\_direct+ 233 | \terminalinebreak~\ddash pytest-args \ddash cov=sros2} 234 | % 235 | 236 | \hrulefill 237 | 238 | % 239 | \colconcmd{test-result} Show the test results generated when testing a set of packages. 240 | % 241 | \\ 242 | Example: 243 | \\ 244 | Show all test results generated, including successful tests:\\ 245 | \terminal{colcon test-result \ddash all} 246 | % 247 | 248 | \hrulefill 249 | 250 | % 251 | \colconcmd{version-check} Compare local package versions with PyPI. 252 | \\ 253 | Examples: 254 | \\ 255 | \terminal{todo} 256 | % 257 | 258 | \hrulefill 259 | 260 | Must know colcon flags. 261 | 262 | $\circ$ \terminalfont{\ddash symlink-install} 263 | \smallhspace 264 | Use `symlinks' instead of installing (copying) files where possible. 265 | 266 | $\circ$ \terminalfont{\ddash continue-on-error} 267 | \smallhspace 268 | Continue other packages when a package fails to build. 269 | Packages recursively depending on the failed package are skipped. 270 | 271 | $\circ$ \terminalfont{\ddash event-handlers console\_direct+} 272 | \smallhspace 273 | Show output on console. 274 | 275 | $\circ$ \terminalfont{\ddash event-handlers console\_cohesion+} 276 | \smallhspace 277 | Show output on console after a package has finished. 278 | 279 | $\circ$ \terminalfont{\ddash packages-select} 280 | \smallhspace 281 | Build only specific package(s). 282 | 283 | $\circ$ \terminalfont{\ddash packages-up-to} 284 | \smallhspace 285 | Build specific package(s) and its/their recursive dependencies. 286 | 287 | $\circ$ \terminalfont{\ddash packages-above} 288 | \smallhspace 289 | Build specific package(s) and other packages that recursively depending on it. 290 | 291 | $\circ$ \terminalfont{\ddash packages-skip} 292 | \smallhspace 293 | Skip package(s). 294 | 295 | $\circ$ \terminalfont{\ddash packages-skip-build-finished} 296 | \smallhspace 297 | Skip a set of packages which have finished to build previously. 298 | 299 | $\circ$ \terminalfont{\ddash cmake-args} 300 | \smallhspace 301 | Pass arguments to CMake projects. 302 | 303 | $\circ$ \terminalfont{\ddash cmake-clean-cache} 304 | \smallhspace 305 | Remove CMake cache before the build (implicitly forcing CMake configure step). 306 | 307 | $\circ$ \terminalfont{\ddash cmake-clean-first} 308 | \smallhspace 309 | Build target `clean' first, then build (to only clean use '--cmake-target clean'). 310 | 311 | $\circ$ \terminalfont{\ddash cmake-force-configure} 312 | \smallhspace 313 | Force CMake configure step. 314 | 315 | \end{multicols*} 316 | \end{document} 317 | --------------------------------------------------------------------------------