Skip to content

Commit e2ee0e9

Browse files
committed
Add turtlebot camera tutorial and examples
1 parent 2aa74a4 commit e2ee0e9

File tree

1 file changed

+47
-2
lines changed

1 file changed

+47
-2
lines changed

exercises/5_turtlebots.md

+47-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,26 @@ Set the robot server in the discovery server variable:
1717
```
1818
export ROS_DISCOVERY_SERVER=”;192.168.0.<IP>:11811”
1919
```
20-
Note, you need to add N number of `;` to set the correct the ID.
20+
21+
> [!NOTE]
22+
> You need to add N number of `;` to set the correct the ID.
23+
24+
Examples:
25+
```
26+
export ROS_DISCOVERY_SERVER="192.168.0.20" # Robot 00
27+
export ROS_DISCOVERY_SERVER=";192.168.0.21" # Robot 01
28+
export ROS_DISCOVERY_SERVER=";;192.168.0.22" # Robot 02
29+
export ROS_DISCOVERY_SERVER=";;;192.168.0.23" # Robot 03
30+
export ROS_DISCOVERY_SERVER=";;;;192.168.0.24" # Robot 04
31+
export ROS_DISCOVERY_SERVER=";;;;;192.168.0.25" # Robot 05
32+
export ROS_DISCOVERY_SERVER=";;;;;;192.168.0.26" # Robot 06
33+
export ROS_DISCOVERY_SERVER=";;;;;;;192.168.0.27" # Robot 07
34+
export ROS_DISCOVERY_SERVER=";;;;;;;;192.168.0.28" # Robot 08
35+
export ROS_DISCOVERY_SERVER=";;;;;;;;;192.168.0.29" # Robot 09
36+
export ROS_DISCOVERY_SERVER=";;;;;;;;;;192.168.0.30" # Robot 10
37+
export ROS_DISCOVERY_SERVER=";;;;;;;;;;;192.168.0.31" # Robot 11
38+
```
39+
2140

2241
Then, set the terminal as super client:
2342
```
@@ -39,17 +58,43 @@ ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r __ns:=/<tb_ns
3958
</td></tr>
4059
</table>
4160

42-
## Bandwidth
61+
## Bandwidth (Optional)
4362
<table>
4463
<tr><td><b>Terminal 1: Camera Test</b></td></tr>
4564
<tr><td>
4665

66+
Install the FFMPEG image transport plugin:
67+
```
68+
sudo apt install ros-humble-ffmpeg-image-transport
69+
```
70+
4771
Try to retrieve the camera topic:
4872
```
4973
ros2 topic hz /<tb_ns>/oakd/rgb/preview/image_raw
5074
```
5175

5276
If you're lucky you might get some packets through. It is likely that no data will reach your device.
5377

78+
Instead, try the FFMPEG topic which has encoded image data.
79+
```
80+
ros2 topic hz /<tb_ns>/oakd/rgb/preview/image_raw/ffmpeg
81+
```
82+
83+
You won't be able to view the image data in RViz while it is encoded. Instead, decode it using the republisher node:
84+
```
85+
ros2 run image_transport republish ffmpeg in/ffmpeg:=/<tb_ns>/oakd/rgb/preview/image_raw/ffmpeg raw out:=/<unique_namespace>/oakd/decoded/image
86+
```
87+
88+
Now, you should be able to get the image data as a standard image topic:
89+
```
90+
ros2 topic hz /<unique_namespace>/oakd/decoded/image
91+
ros2 topic bw /<unique_namespace>/oakd/decoded/image
92+
```
93+
94+
Then, open RViz and view the image:
95+
```
96+
rviz2
97+
```
98+
5499
</td></tr>
55100
</table>

0 commit comments

Comments
 (0)