Skip to content

Commit 02735cd

Browse files
author
--global
committed
pre-commit update
1 parent 61695cb commit 02735cd

39 files changed

+640
-627
lines changed

.docker/ros_entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -e
44
# setup ros environment
55
cd /
66
source "/opt/ros/$ROS_DISTRO/setup.bash"
7-
exec "$@"
7+
exec "$@"

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
default_language_version:
2+
python: python3
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.6.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: check-yaml
11+
- id: check-json
12+
- id: check-merge-conflict
13+
- id: mixed-line-ending
14+
- id: check-added-large-files
15+
- id: detect-private-key

export.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,3 @@ def export_pdf(config_yaml):
5858
export_slides(day_dir, id, slides)
5959

6060
export_pdf(os.path.join(root_dir, "export_list.yaml"))
61-

export_list.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ export:
22
- Day: 1
33
slides:
44
1: slides/Basics/source/Core_concepts.html
5-
2: slides/Basics/source/filesystem.html
6-
5+
2: slides/Basics/source/filesystem.html
6+
77
- Day: 2
88
slides:
99
1: slides/Basics/source/CLI.html
@@ -14,4 +14,4 @@ export:
1414
slides:
1515
1: slides/Navigation/source/Basics.html
1616
2: slides/Navigation/source/SLAM.html
17-
3: slides/Navigation/source/Navigation2.html
17+
3: slides/Navigation/source/Navigation2.html

readme.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ This repository contains source of training material for `ROS 2 Foxy`. The topic
1010
- Manipulation
1111
- Basics of manipulation
1212

13+
## Development
14+
15+
Enable pre-commit hooks to keep formatting tidy before pushing changes:
16+
17+
```sh
18+
pip install pre-commit
19+
pre-commit install
20+
pre-commit run --all-files
21+
```
22+
1323
***
1424
<!--
1525
ROSIN acknowledgement from the ROSIN press kit
@@ -20,12 +30,12 @@ This repository contains source of training material for `ROS 2 Foxy`. The topic
2030
<img src="https://raw.githubusercontent.com/rosin-project/press_kit/master/img/rosin_ack_logo_wide.png" alt="rosin_logo" height="60" >
2131
</a>
2232

23-
Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components.
33+
Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components.
2434
More information: <a href="http://rosin-project.eu">rosin-project.eu</a>
2535

2636
<img src="https://raw.githubusercontent.com/rosin-project/press_kit/master/img/rosin_eu_flag.jpg" alt="eu_flag" height="45" align="left" >
2737

28-
This project has received funding from the European Union’s Horizon 2020
38+
This project has received funding from the European Union’s Horizon 2020
2939
research and innovation programme under grant agreement no. 732287.
3040
***
3141
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.

slides/Basics/source/CLI.html

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@
3838
---
3939

4040
## 1.1 Installing and Sourcing ROS 2
41-
* Two types of installation - [Binary](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html) (recommended) or [Source](https://docs.ros.org/en/foxy/Installation/Ubuntu-Development-Setup.html).
42-
* Live USB has ROS 2 Foxy Binary - Verify :
43-
`ll /opt/ros/foxy`.
44-
* Source ROS 2 to use commands, libraries, packages etc..:
45-
`source /opt/ros/foxy/setup.bash`
46-
* Source your local workspace as needed (which source ROS as well):
41+
* Two types of installation - [Binary](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html) (recommended) or [Source](https://docs.ros.org/en/foxy/Installation/Ubuntu-Development-Setup.html).
42+
* Live USB has ROS 2 Foxy Binary - Verify :
43+
`ll /opt/ros/foxy`.
44+
* Source ROS 2 to use commands, libraries, packages etc..:
45+
`source /opt/ros/foxy/setup.bash`
46+
* Source your local workspace as needed (which source ROS as well):
4747
`source /path/to/ws/install/local_setup.bash`
4848

4949
---
50-
50+
5151
## 1.2 Aliasing
52-
* Aliases are custom defined abbreviations for commands.
53-
* Simply type
54-
`source_foxy` (or any string you wish)
55-
instead of
52+
* Aliases are custom defined abbreviations for commands.
53+
* Simply type
54+
`source_foxy` (or any string you wish)
55+
instead of
5656
`source /opt/ros/foxy/setup.bash` (or any command you wish)
5757
* See cheat sheet for syntax.
5858

@@ -62,7 +62,7 @@
6262

6363
## 1.3 ROS_DOMAIN_ID
6464

65-
* Environment variable
65+
* Environment variable
6666
* Unique identifier number for each machine
6767
* Physically separates network
6868
* Stop ROS 2 node interference
@@ -84,24 +84,24 @@
8484
---
8585

8686
## 2.1 Basic command structure
87-
87+
8888

8989
We only explore default packages that come with the binary for simplicity.
9090

9191
* All ROS 2 commands follow this syntax :
92-
`ros2 <main_command> <sub_command> <<arguments>>`
92+
`ros2 <main_command> <sub_command> <<arguments>>`
9393

94-
* Examples :
95-
`ros2 pkg list`
94+
* Examples :
95+
`ros2 pkg list`
9696
`ros2 pkg executables`
9797

98-
Use tab completion to either complete a command, or to see a list of available options.
98+
Use tab completion to either complete a command, or to see a list of available options.
9999
* Example: `ros2 ` *tab* *tab* - List all ROS 2 commands.
100-
* `ros2 pkg ` *tab* *tab* - List of sub-commands for `pkg`.
101-
* `-h` at almost any point to get a brief help description.
102-
`ros2 -h`
103-
`ros2 pkg -h`
104-
`ros2 pkg executable -h`
100+
* `ros2 pkg ` *tab* *tab* - List of sub-commands for `pkg`.
101+
* `-h` at almost any point to get a brief help description.
102+
`ros2 -h`
103+
`ros2 pkg -h`
104+
`ros2 pkg executable -h`
105105

106106
---
107107
class: center, middle
@@ -111,84 +111,84 @@
111111
---
112112

113113
## 3.1 Publisher
114-
115114

116-
The most basic example of ROS - a *Publisher/Subscriber* pair
117115

118-
* Remember to source ROS 2
119-
* Command `run` to run an executable within a package (C++ compiled object/Python script):
116+
The most basic example of ROS - a *Publisher/Subscriber* pair
117+
118+
* Remember to source ROS 2
119+
* Command `run` to run an executable within a package (C++ compiled object/Python script):
120120

121-
`ros2 run <package_name> <executable_name> <<optional_command_line_arguments>>`
121+
`ros2 run <package_name> <executable_name> <<optional_command_line_arguments>>`
122122

123-
* Try the example publisher node packaged with ROS 2.
124-
* We first need to find out what the name of the package is.
125-
* Run the package listing command with a filter:
126-
`ros2 pkg list | grep demo`
127-
* Next find the available executables we could use by running :
128-
`ros2 pkg executables demo_nodes_cpp`
129-
* Run one of these executables - the publisher:
130-
`ros2 run demo_nodes_cpp talker`
123+
* Try the example publisher node packaged with ROS 2.
124+
* We first need to find out what the name of the package is.
125+
* Run the package listing command with a filter:
126+
`ros2 pkg list | grep demo`
127+
* Next find the available executables we could use by running :
128+
`ros2 pkg executables demo_nodes_cpp`
129+
* Run one of these executables - the publisher:
130+
`ros2 run demo_nodes_cpp talker`
131131

132-
Observe the state of the ROS 2 runtime system so far...
132+
Observe the state of the ROS 2 runtime system so far...
133133

134134
---
135135

136136
## 3.2 Introspection - Publisher
137137

138138
### Nodes
139-
* To look at what nodes are currently running:
140-
`ros2 node list`
141-
* To see more info about a node:
142-
`ros2 node info <node_name>`
139+
* To look at what nodes are currently running:
140+
`ros2 node list`
141+
* To see more info about a node:
142+
`ros2 node info <node_name>`
143143

144144
### Topics
145-
* To see currently running topics and their message types:
146-
`ros2 topic list -t`
147-
* To get more info about a topic (Foxy: Verbose output):
145+
* To see currently running topics and their message types:
146+
`ros2 topic list -t`
147+
* To get more info about a topic (Foxy: Verbose output):
148148
`ros2 topic info -v <topic_name>`<!-- Thanks AWS!!-->
149-
* To see what is being published on a topic:
149+
* To see what is being published on a topic:
150150
`ros2 topic echo <topic_name>`
151151

152152
---
153153

154154
## 3.3 Subscriber
155155

156-
* Start a subscriber that listens to this topic:
157-
`ros2 run demo_nodes_cpp listener`
156+
* Start a subscriber that listens to this topic:
157+
`ros2 run demo_nodes_cpp listener`
158158

159159
* The subscriber echoes on the terminal what it hears over the topic.
160160

161161
* Check the running nodes and topics again to see the update.
162162

163163
---
164-
164+
165165
## 3.4 Introspection - Terminal Publisher
166166

167-
* Publishers can also be created from the terminal.
168-
`ros2 topic pub <topic_nam> <msg_type> "{<field1_key>: <field1_value>, <field2_key>: <field2_value>, ...}"`
169-
* The message type must be properly understood first.
170-
`ros2 topic list -t`
171-
* The message type of `/topic` is `std_msgs/msg/String`
172-
* For more info: `ros2 interface show std_msgs/msg/String`
167+
* Publishers can also be created from the terminal.
168+
`ros2 topic pub <topic_nam> <msg_type> "{<field1_key>: <field1_value>, <field2_key>: <field2_value>, ...}"`
169+
* The message type must be properly understood first.
170+
`ros2 topic list -t`
171+
* The message type of `/topic` is `std_msgs/msg/String`
172+
* For more info: `ros2 interface show std_msgs/msg/String`
173173
* It has only one field - `data` - of the type `string`.
174-
* The message body is a dictionary type, with key-value pairs for the message fields.
175-
* Use `ros2 interface proto std_msgs/msg/String` to get an example of the dictionary to use.
176-
> NOTE THAT SPACING IS VERY IMPORTANT!!
174+
* The message body is a dictionary type, with key-value pairs for the message fields.
175+
* Use `ros2 interface proto std_msgs/msg/String` to get an example of the dictionary to use.
176+
> NOTE THAT SPACING IS VERY IMPORTANT!!
177177
* To spawn a publisher over `/topic` with a rate of 10 Hz:
178178
`ros2 topic pub -r10 /topic std_msgs/msg/String "data: "Hello""`
179179

180180
---
181181

182182
## 3.5 Launch files
183183

184-
* A way to start many nodes from a single starting point:
184+
* A way to start many nodes from a single starting point:
185185

186-
`ros2 launch <package_name> <launch_file_name.launch> <<optional_command_line_arguments>>`
186+
`ros2 launch <package_name> <launch_file_name.launch> <<optional_command_line_arguments>>`
187187

188-
* To run both the Subscriber and Publisher from one point:
189-
`ros2 launch demo_nodes_cpp talker_listener.launch.py`
188+
* To run both the Subscriber and Publisher from one point:
189+
`ros2 launch demo_nodes_cpp talker_listener.launch.py`
190190

191-
* Use introspection to verify results and compare.
191+
* Use introspection to verify results and compare.
192192

193193
---
194194
class: center, middle
@@ -200,34 +200,34 @@
200200

201201
## 4.1 Introduction - Services
202202

203-
* Useful for making short but guaranteed transfer of messages between nodes.
203+
* Useful for making short but guaranteed transfer of messages between nodes.
204204
* It involves two entities - a Server that provides the service and a Client that consumes this service.
205-
* Start these just just like a typical node:
206-
`ros2 run demo_nodes_cpp add_two_ints_server`
207-
`ros2 run demo_nodes_cpp add_two_ints_client`
205+
* Start these just just like a typical node:
206+
`ros2 run demo_nodes_cpp add_two_ints_server`
207+
`ros2 run demo_nodes_cpp add_two_ints_client`
208208

209209
* A Topic streams data whereas a Service makes one exchange per call.
210210

211211
---
212212

213213
## 4.2 Introspection - Services
214214

215-
* List the services offered by servers:
215+
* List the services offered by servers:
216216
`ros2 service list -t`
217-
* Service offered by the demo server - *add_two_ints*
217+
* Service offered by the demo server - *add_two_ints*
218218
* We invoked this service by running a client node
219-
* You can also do this via the CLI.
219+
* You can also do this via the CLI.
220220

221221
Syntax: `ros2 service call <service_name> <service_type_name> "{<field1_key>: <field1_value>, <field2_key>: <field2_value>, ...}"`
222222

223-
* To understand the service type:
224-
`ros2 interface list -s` (-s for services. Also, -m, -a)
223+
* To understand the service type:
224+
`ros2 interface list -s` (-s for services. Also, -m, -a)
225225
`ros2 interface show <service_type_name>`
226226

227227
Example: `ros2 service call /add_two_ints example_interfaces/srv/AddTwoInts "{a: 5, b: 6}"`
228228
> NOTE THAT SPACING IS VERY IMPORTANT!!
229229

230-
230+
231231
---
232232
class: center, middle
233233
name: main_title
@@ -242,7 +242,7 @@
242242
* Useful for longer tasks that need a feedback & involves an action server and an action client.
243243
* Interface has 3 parts - goal, feedback and result.
244244
* Typical sequence - Publish a goal, observe feedback & receive result when execution is completed/aborted
245-
* Use the `ros2 action [..]` commands to interact. (New in ROS 2)
245+
* Use the `ros2 action [..]` commands to interact. (New in ROS 2)
246246
* Similar to `ros2 topic [..]`
247247

248248

@@ -261,22 +261,22 @@
261261
class: center, middle
262262
name: main_title
263263

264-
# 6. Tools
264+
# 6. Tools
265265

266266
---
267267

268-
## 6.1 Tools - RQT
268+
## 6.1 Tools - RQT
269269

270270
* QT Based ROS GUI tool.
271-
* Offers plugins for many purposes:
272-
* Node graph monitor,
273-
* Service caller/type viewer,
274-
* Topic publisher/listener/type viewer,
275-
* Image view,
271+
* Offers plugins for many purposes:
272+
* Node graph monitor,
273+
* Service caller/type viewer,
274+
* Topic publisher/listener/type viewer,
275+
* Image view,
276276
* Plot etc....
277277
* Similar to ROS 1, but few plugins still missing
278278
* `rqt &` to launch default main window (`&` ->detached process)
279-
or
279+
or
280280
`ros2 run rqt_<plugin> rqt_<plugin>` to launch a specific plugin
281281
* Load a plugin : `Plugins -> <Library> -> <Plugin>`
282282
* Example to monitor node graph `Plugins -> Introspection -> Node Graph`

0 commit comments

Comments
 (0)