-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path7.ros.html
More file actions
605 lines (355 loc) · 14.5 KB
/
Copy path7.ros.html
File metadata and controls
605 lines (355 loc) · 14.5 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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="icon" href="assets/sibin.integral.favicon.ico">
<link rel="stylesheet" href="assets/reveal-js/dist/reveal.css" />
<link rel="stylesheet" href="assets/custom.sibin.css" />
<link rel="stylesheet" href="assets/monokai.css" />
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-markdown
data-separator="^\s*---\s*$"
data-separator-vertical="^\s*-v-\s*$"
data-separator-notes="^Notes?:"
data-charset="utf-8"
data-auto-animate="True"
>
<textarea data-template>
# robot operating system (ROS)
## **Design of Autonomous Systems**
### csci 6907/4907-Section 86
### Prof. **Sibin Mohan**
---
**open source middleware** framework
---
**open source middleware** framework → robotics applications
---
<img src="img/rtos/ros/ros.complexity.webp" width="900">
---
## ros
- develop and **scale** applications
- **manages communications**
---
## ros is **middleware**
Note:
> Middleware is a software layer that connects the operating system to applications, data, and users. It provides common services and capabilities, like single-sign on (SSO), easy communication/coordination (like ROS) or application programming interface (API) management. Developers can rely on middleware to provide consistent, simplified integrations between application components. This frees up developers to build core features of applications, rather than spend time connecting those features to different endpoints and environments, including legacy systems.
---
at a high level, ROS provides,
- **separation** of code blocks → into reusable blocks
---
at a high level, ROS provides,
- **separation** of code blocks → into reusable blocks
- **tools** → easy communication between sub-programs
---
at a high level, ROS provides,
- **separation** of code blocks → into reusable blocks
- **tools** → easy communication between sub-programs
- **language agnostic** coding → C++/Python or mixed
---
at a high level, ROS provides,
- **separation** of code blocks → into reusable blocks
- **tools** → easy communication between sub-programs
- **language agnostic** coding → C++/Python or mixed
- can still communicate with each other
---
## simple example
control of a robotic arm+camera
<img src="img/rtos/ros/ros.robot_camera_example.webp" width="900">
---
## simple example
to make this a **ROS program**
|||
|-----|-----|
|<img src="img/rtos/ros/ros.robot_camera_example.webp" width="900">|create a few subprograms: |
---
## simple example
to make this a **ROS program**
|||
|-----|-----|
|<img src="img/rtos/ros/ros.robot_camera_example.webp" width="900">|create a few subprograms: <ol> <li>camera <scb>node</scb></li> |
---
## simple example
to make this a **ROS program**
|||
|-----|-----|
|<img src="img/rtos/ros/ros.robot_camera_example.webp" width="900">|create a few subprograms: <ol> <li>camera <scb>node</scb></li> <li><scb>motion planning</scb></li> |
---
## simple example
to make this a **ROS program**
|||
|-----|-----|
|<img src="img/rtos/ros/ros.robot_camera_example.webp" width="900">|create a few subprograms: <ol> <li>camera <scb>node</scb></li> <li><scb>motion planning</scb></li> <li><scb>hardware drivers</scb></li> |
---
## simple example
to make this a **ROS program**
|||
|-----|-----|
|<img src="img/rtos/ros/ros.robot_camera_example.webp" width="900">|create a few subprograms: <ol> <li>camera <scb>node</scb></li> <li><scb>motion planning</scb></li> <li><scb>hardware drivers</scb></li> <li><scb>joystick</scb></li> </ol>|
---
## simple example
to make this a **ROS program**
|||
|-----|-----|
|<img src="img/rtos/ros/ros.robot_camera_example.webp" width="900">|create a few subprograms: <ol> <li>camera <scb>node</scb></li> <li><scb>motion planning</scb></li> <li><scb>hardware drivers</scb></li> <li><scb>joystick</scb></li> </ol>|
|| **communication** → using ROS constructs|
||
---
### ros components
<img src="img/mermaid_figs/ros_architecture_legends.png">
<br>
<img src="img/mermaid_figs/ros_architecture.png" width="800">
---
### ros components | node
- process/program → **computation**
- combined together into a graph
- communicate via "topics"
- operate at a fine-grained scale
---
### ros components | topics
- **named buses** → nodes exchange "messages"
---
### ros components | topics
- **named buses** → nodes exchange "messages"
- **anonymous publish/subscribe semantics**
- nodes not aware of **who** they are communicating with
---
### ros components | topics
- **named buses** → nodes exchange "messages"
- **anonymous publish/subscribe semantics**
- nodes not aware of **who** they are communicating with
- nodes interested in data **subscribe** to _relevant topic_
- nodes that _generate_ data **publish** to relevant topic
---
### ros components | topics
- **named buses** → nodes exchange "messages"
- **anonymous publish/subscribe semantics**
- nodes not aware of **who** they are communicating with
- nodes interested in data **subscribe** to _relevant topic_
- nodes that _generate_ data **publish** to relevant topic
- **multiple** publishers and subscribers for topic
---
### ros components | topics
- **named buses** → nodes exchange "messages"
- **anonymous publish/subscribe semantics**
- nodes not aware of **who** they are communicating with
- nodes interested in data **subscribe** to _relevant topic_
- nodes that _generate_ data **publish** to relevant topic
- **multiple** publishers and subscribers for topic
- topic is **strongly typed** by publisher
- nodes can only receive messages with a matching type
---
### ros components | topics
---
### ros components | topics
- nodes communicate → publish messages to topics
- simple **text** files
- simple data structure → **typed fields**
---
### ros components | topics
- nodes communicate → publish messages to topics
- simple **text** files
- simple data structure → **typed fields**
- support standard primitives (<sc>int</sc>, <sc>float</sc>, <sc>boolean</sc>)
- can include arbitrarily nested <sc>structs</sc> and <sc>arrays</sc>
---
### ros components | topics
- nodes communicate → publish messages to topics
- simple **text** files
- simple data structure → **typed fields**
- support standard primitives (<sc>int</sc>, <sc>float</sc>, <sc>boolean</sc>)
- can include arbitrarily nested <sc>structs</sc> and <sc>arrays</sc>
- nodes can exchange → <sc>request</sc> an <sc>response</sc> messages
---
simple ROS message:
```ros
std_msgs/Header header
uint32 seq
time stamp
string frame_id
geometry_msgs/Point point
float64 x
float64 y
float64 z
```
---
### ros components | master
- naming and registration services
---
### ros components | master
- naming and registration services
- runs parameter server → **store/retrieve parameters**
Note: (http://wiki.ros.org/Parameter%20Server) → a shared, multi-variate dictionary that is accessible via network APIs, used by nodes to
---
### ros components | master
- naming and registration services
- runs parameter server → **store/retrieve parameters**
- tracks publishers/subscribers to topics
---
### ros components | master
- naming and registration services
- runs parameter server → **store/retrieve parameters**
- tracks publishers/subscribers to topics
- individual ROS nodes → locate one another
- once located → communicate **peer-to-peer**
---
### ros components | peer-to-peer example
1. two nodes → <sc>camera</sc> node and <sc>image_viewer</sc> node
2. <sc>camera</sc> notifies <sc>master</sc> → wants to publish topic, <sc>images</sc>
<br>
<br>
<img src="img/rtos/ros/ROS_master_example_english_1.png" width="500">
---
### ros components | peer-to-peer example
3. no one isubscribing to topic, yet → **no images sent**
4. <sc>image viewer</sc> → subscribe to <sc>images</sc> topic
<br>
<br>
<img src="img/rtos/ros/ROS_master_example_english_2.png" width="500">
---
### ros components | peer-to-peer example
5. topic, <sc>images</sc> has both → publisher and subscriber
6. <sc>master</sc> notifies both → of each others' existence
<br>
<br>
<img src="img/rtos/ros/ROS_master_example_english_3.png" width="500">
---
### ros components | peer-to-peer example
5. topic, <sc>images</sc> has both → publisher and subscriber
6. <sc>master</sc> notifies both → of each others' existence
<br>
<br>
<img src="img/rtos/ros/ROS_master_example_english_3.png" width="500">
<br>
<br>
7. both start **communicating with each other**, directly
---
### ros components | more intricate example
<img src="img/mermaid_figs/ros_publish_subscribe.png" width="1100">
---
### ros components | ROS transform
---
### ros components | ROS transform
- robotic system → many 3D coordinate frames
- change over time
- _e.g.,_ world frame, base frame, gripper frame, head frame, _etc._
---
### ros components | ROS transform
- robotic system → many 3D coordinate frames
- change over time
- _e.g.,_ world frame, base frame, gripper frame, head frame, _etc._
- allows user keep track of **multiple** coordinate frames over time
---
### ros components | ROS transform
- robotic system → many 3D coordinate frames
- change over time
- _e.g.,_ world frame, base frame, gripper frame, head frame, _etc._
- allows user keep track of **multiple** coordinate frames over time
- maintains relationship between coordinate frames
- manages **spatial relationships**
---
### ros components | ROS transform [contd.]
- **tree** structure buffered in time
---
### ros components | ROS transform [contd.]
- **tree** structure buffered in time
- user transform <sc>points</sc>, <sc>vectors</sc>, _etc._
- at **any** desired point in time
---
### ros components | ROS transform [contd.]
- **tree** structure buffered in time
- user transform <sc>points</sc>, <sc>vectors</sc>, _etc._
- at **any** desired point in time
- **distributed**
Note:
distributed: coordinate frames of robot available to **all** ROS components on any computer in the system
---
### ros components | ROS transform [contd.]
- **tree** structure buffered in time
- user transform <sc>points</sc>, <sc>vectors</sc>, _etc._
- at **any** desired point in time
- **distributed**
- sensor fusion, motion planning, navigation
---
### ros components | ROS transform [contd.]
- **tree** structure buffered in time
- user transform <sc>points</sc>, <sc>vectors</sc>, _etc._
- at **any** desired point in time
- **distributed**
- sensor fusion, motion planning, navigation
- all coordinate frames/relationships → **transform tree**
---
### ros components | transform example
<img src="img/mermaid_figs/ros_transform.png" width="1000">
---
## ros+real-time?
---
## ros+real-time?
basic ROS is **not** real-time
---
## ros+real-time?
- can be integrated with _some_ latency guarantees
- can run on linux+<sc>PREEMPT_RT</sc>
---
for better real-time → [**ROS 2**](https://roscon.ros.org/2015/presentations/RealtimeROS2.pdf)
---
for better real-time → [**ROS 2**](https://roscon.ros.org/2015/presentations/RealtimeROS2.pdf)
look at [online textbook](https://autonomy-course.github.io/textbook/autonomy-textbook.html#ros-and-real-time) for more resources
---
so why waste all this time learning about ROS?
---
## Ros+Navio2
- Raspberry Pi_Navio2 → ROS
- **fast enough** for our purposes
- basic Raspbian image → installed with ROS
---
## Ros+Navio2
- communicate between Navio2 and controller Pi
- _e.g.,_ collect/publish **sensor** data
---
## Ros+Navio2
- communicate between Navio2 and controller Pi
- _e.g.,_ collect/publish **sensor** data
<img src="img/rtos/ros/ros.ardupilot_navio.png" width="900">
---
## Ros+Navio2
- communicate between Navio2 and controller Pi
- _e.g.,_ collect/publish **sensor** data
<img src="img/rtos/ros/ros.ardupilot_navio.png" width="900">
read → [step-by-step instructions](https://docs.emlid.com/navio2/ros/)
</textarea>
</section>
</div>
</div>
<script src="assets/reveal-js/dist/reveal.js"></script>
<script src="assets/reveal-js/plugin/markdown/markdown.js"></script>
<script src="assets/reveal-js/plugin/highlight/highlight.js"></script>
<script src="assets/reveal-js/plugin/zoom/zoom.js"></script>
<script src="assets/reveal-js/plugin/notes/notes.js"></script>
<script src="assets/reveal-js/plugin/math/math.js"></script>
<script src="https://cdn.jsdelivr.net/npm/reveal.js-mermaid-plugin/plugin/mermaid/mermaid.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/reveal-plantuml/dist/reveal-plantuml.min.js"></script>
<script>
Reveal.initialize({
history: true,
slideNumber: "c/t",
height: 1080,
width: 1920,
transition: "fade",
backgroundTransition: "slide",
RevealMermaid: {"htmlLabels": true, "useMaxWidth": true},
plugins: [
RevealMarkdown,
RevealHighlight,
RevealZoom,
RevealNotes,
RevealMath,
RevealMermaid,
],
});
</script>
</body>
</html>