-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tex
More file actions
319 lines (255 loc) · 10.8 KB
/
Copy pathmain.tex
File metadata and controls
319 lines (255 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
% ROS CHEAT SHEET created by Gary - gary.granados@gmail.com.
% For learning ROS, this documents attempts to make easier looking for
% specific *basic* stuff while starting to use ROS
%
%
%
% Copyright (C) 2018 Edgar Granados Osegueda.
% Permission is granted to copy, distribute and/or modify this document
% under the terms of the GNU Free Documentation License, Version 1.3
% or any later version published by the Free Software Foundation;
% with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
% A copy of the license is included in the section entitled "GNU
% Free Documentation License".
%
%
%
\documentclass[10pt,letterpaper]{article}
\usepackage{multicol}
\usepackage{calc}
\usepackage{ifthen}
\usepackage[landscape]{geometry}
\usepackage{hyperref}
\usepackage[explicit]{titlesec}
\ifthenelse
{
\lengthtest
{
\paperwidth = 11in
}
}
{ \geometry{top=.5in,left=.5in,right=.5in,bottom=.5in} }
{\ifthenelse{ \lengthtest{ \paperwidth = 297mm}}
{\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
{\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
}
% Turn off header and footer
\pagestyle{empty}
% Redefine section commands to use less space
\makeatletter
% \titleformat{\section}{\large\bfseries}{\thesection}{1em}{\hrule}
\renewcommand\section{\@startsection{section}{1}{0mm}%
{-1ex plus -.5ex minus -.2ex}%
{0.5ex plus .2ex}%x
{\normalfont\large\bfseries}
}%
% \renewcommand\subsection{\@startsection{subsection}{2}{0mm}%
% {-1ex plus -.5ex minus -.2ex}%
% {0.5ex plus .2ex}%x
% {\normalfont\small\bfseries}
% }%
\renewcommand\subsection{\@startsection{subsection}{2}{0mm}%
{-1ex plus -.5ex minus -.2ex}%
{0.5ex plus .2ex}%
{\normalfont\small\bfseries}%
}%
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{0mm}%
{-1ex plus -.5ex minus -.2ex}%
{1ex plus .2ex}%
{\normalfont\tiny\bfseries}}
\makeatother
% Define BibTeX command
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
% Don't print section numbers
\setcounter{secnumdepth}{0}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.5ex}
% -----------------------------------------------------------------------
\begin{document}
\raggedright
\footnotesize
\begin{multicols}{3}
\setlength{\premulticols}{1pt}
\setlength{\postmulticols}{1pt}
\setlength{\multicolsep}{1pt}
\setlength{\columnsep}{2pt}
\begin{center}
\Large{\textbf{ROS CHEAT SHEET}} \\
\end{center}
\section{Usage of the Cheat Sheet}
\begin{tabular}{@{}ll@{}}
\verb!command! & Explanation of command, ``$ \vdash $'' marks options. \\
$\vdash $ opt\_1 & Use as written \\
$\vdash $ $\vdash $ \textit{options} & If italics, replace with adecuate value for \textit{opt\_1} \\
$\vdash $ [\textit{other}]$^+$ & Use one or more \textit{other} options \\
% \verb!! & \\
% \verb!! & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
\end{tabular}
\section{File System}
\begin{tabular}{@{}ll@{}}
\verb!catkin_make! & Compile a project. \\
$\vdash $ \verb!clean! & Remove build, devel \& install spaces \\
$\vdash $ \verb!--pkg! [\textit{pkg}]$^+$ & Compile only \textit{PKG \dots} \\
\verb!catkin_create_pkg ! & Creates a new catkin package \\
$\vdash $ \textit{pkg\_name} & Init package of name \textit{pkg\_name} \\
$\vdash $ $\vdash $ \textit{deps} & Init pkg with specified dependencies \\
\verb!source! & Executes commands from a file \\
$\vdash $ devel/setup.bash & \textit{Tells } the terminal about the compiled \\
& workspace. Run it in each terminal. \\
\end{tabular}
\subsection{Create a New Project}
\verb!mkdir -p !\textit{project\_name}\verb!/src! \\
\verb!catkin_make!
\section{Common Tools}
\begin{tabular}{@{}ll@{}}
\verb!roscore! & Starts a Master, the Parameter Server and a rosout \\
\textbar & logging node. A Master must be always up.\\
% \textbar & \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!rosmsg!/\verb!rossrv! & Get info of ROS messages/services \\
$\vdash $ show & Show message/services description \\
$\vdash $ list & List all messages/services \\
$\vdash $ package & List messages in a package \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!rosrun ! & Used to execute ROS nodes \\
$\vdash $ \textit{PKG} \textit{EXEC} & Execute \textit{EXEC} of package \textit{PKG} \\
$\vdash $ $\vdash $ [\textit{ARGS}]$^+$ & Execute with \textit{ARGS} \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!rosnode! & Prints info of ROS nodes \\
$\vdash $ ping \textit{node} & Test connectivity of \textit{node} \\
$\vdash $ list & Prints all ROS nodes available \\
$\vdash $ info \textit{node} & Prints information of \textit{node} \\
$\vdash $ machine \textit{node} & Prints the machine \textit{node} is running \\
$\vdash $ kill \textit{node} & Kills the running \textit{node} \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!roslaunch! & Easily launch multiple nodes. If there is\\
\textbar & no Master up, it also starts one. \\
$\vdash $ \textit{pkg} \textit{file} & Launches \textit{file} from \textit{pkg} \\
$\vdash $ $\vdash $ \textit{arg}:=\textit{val} & Use \textit{arg} with value \textit{val} \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!rostopic! & Prints info of ROS topics \\
$\vdash $ echo /\textit{topic}& Prints message from /\textit{topic} to screen \\
$\vdash $ $\vdash $ -n \textit{num} & Prints \textit{num} messages \\
$\vdash $ hz & display publishing rate of topic \\
$\vdash $ info /\textit{topic} & Prints info of /\textit{topic} \\
$\vdash $ list & Prints all ROS topics available \\
$\vdash $ pub /\textit{X} \textit{Y} \textit{m} & Publishes \textit{m} to /\textit{X} of type \textit{Y} \\
$\vdash $ $\vdash $ \verb!'{!\textit{field}\verb!}'! & Create message in-line \\
$\vdash $ type /\textit{topic} & Prints the message type of /\textit{topic} \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!rosservice! & Prints info of ROS services \\
$\vdash $ args /\textit{srv} & Print service arguments \\
$\vdash $ call /\textit{srv} [\textit{args}]$^*$ & call /\textit{srv} with \textit{args} \\
$\vdash $ info /\textit{srv} & Print info of service /\textit{srv} \\
$\vdash $ list & Print all ROS services available \\
$\vdash $ type /\textit{srv} & Prints the type of \textit{srv} \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!rosparam! & Change params of the Param Server \\
$\vdash $ set \textit{par} \textit{v} & Set \textit{par} with value \textit{v} \\
$\vdash $ get \textit{par} & Get the value of \textit{par} \\
$\vdash $ delete \textit{par} & Delete \textit{par} \\
$\vdash $ list & Print all available parameters \\
\end{tabular}
\section{ROS Variables}
Linux environment variables specific of ROS, set for each terminal. \\
\begin{tabular}{@{}ll@{}}
\verb!ROS_ROOT! & Path to where ROS is installed \\
\verb!ROS_MASTER_URI! & Tells nodes where to locate the \\
\textbar & Master, by default: http://localhost:11311/ \\
\verb!ROS_HOSTNAME! & Specifies the host name of the nodes. \\
\textbar & It takes precedence over \verb!ROS_IP! \\
\verb!ROS_IP! & Specifies the IP of the nodes \\
\verb!ROS_DISTRO! & Specifies the current ROS distribution\\
\end{tabular}
\subsection{Linux Commands for Env. Vars.}
\begin{tabular}{@{}ll@{}}
\verb!export! \textit{var}=\textit{val} & Exports (\textit{sets}) \textit{var} to \textit{val} \\
\verb!echo! \$\textit{var} & Prints the value of \textit{var} \\
\end{tabular}
\subsection{Connect Multiple Machines}
Define where the Master is going to run and get the ip (\textit{master\_ip}). In each terminal of all computers: \\
\verb!export ROS_HOSTNAME=computer_hostname!
\verb!export ROS_MASTER_URI=http://master_ip:11311/!
\section{Useful Packages}
\begin{tabular}{@{}ll@{}}
\verb!rosbag! & Tool for using ROSBags \\
$\vdash $ info \textit{bag} & Prints the metadata of a rosbag \\
$\vdash $ record [/\textit{topic}]$^*$ & Records topic data to a bag file \\
$\vdash $ $\vdash $ -a & Record all topics \\
$\vdash $ $\vdash $ -O \textit{name} & Save bag file as \textit{name}.bag \\
$\vdash $ $\vdash $ --node=\textit{N} & Save all topics from node \textit{N}\\
$\vdash $ check \textit{bag} & Determine if a bag is playable \\
$\vdash $ filter \textit{in} \textit{out} \textit{exp} & Creates \textit{out} by filtering \textit{in} using \textit{exp} \\
$\vdash $ fix \textit{bag} & Attempts to fix a corrupted bag \\
$\vdash $ play \textit{bag} & Plays \textit{bag} \\
\verb!rqt! & Launch the main widget.\\
\verb!rqt_bag! & GUI for handling rosbags \\
\verb!rqt_graph! & Vizualize nodes, topics \& services\\
\verb!rqt_image_view! & Display images from topics \\
\verb!rqt_plot! & Plot data from topics \\
\verb!rviz! & 3D visualization tool for ROS\\
\verb!Gazebo! & Robot simulator\\
\verb!rosserial_python! & Connect serial devices, rosrun required. \\
$\vdash $ serial\_node \textit{p} & Connect a device in port \textit{p} with ROS. \\
\end{tabular}
\section{CMakeLists}
\begin{tabular}{@{}ll@{}}
\verb!find_package( catkin! & Find catkin macros and libraries \\
$\vdash $ REQUIRED COMPONENTS & find other catkin packages \\
$\vdash $ $\vdash $ roscpp & ROS library for c++ \\
$\vdash $ $\vdash $ rospy & ROS library for python \\
$\vdash $ $\vdash $ std\_msgs & ROS standard messages \\
$\vdash $ $\vdash $ geometry\_msgs & ROS geometry messages \\
$\vdash $ ) & \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!include_directories(! & Other locations of headers \\
$\vdash $ include & \\
$\vdash $ \$\{catkin\_INCLUDE\_DIRS\} & catkin directories \\
$\vdash $ ) & \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!add_executable(! & Create an executable \\
$\vdash $ \textit{exec\_name} & of name \textit{exec\_name} \\
$\vdash $ \textit{file.cpp} & from the source \textit{file.cpp} \\
$\vdash $ ) & \\
\end{tabular}
\begin{tabular}{@{}ll@{}}
\verb!target_link_libraries(! & Tell cmake to link the executable \\
$\vdash $ \textit{exec\_name} & \textit{exec\_name} against the libraries \\
$\vdash $ [\$\{ \textit{lib\_name} \}]$^+$ & \textit{lib\_name} \\
$\vdash $ ) & \\
\end{tabular}
% \verb!! & \\
% \verb!! & \\
% \verb!! & \\
% \verb!! & \\
% \verb!! & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
% $\vdash $ & \\
\rule{0.3\linewidth}{0.25pt}
\scriptsize
Created by Gary, 2018.
\href{https://github.com/garygra/ROS_cheat_sheet}{Github Page}
\end{multicols}
\end{document}