|
1 | 1 | <!-- |
2 | | -Copyright (C) 2025 Intel Corporation |
| 2 | +Copyright (C) 2026 Intel Corporation |
3 | 3 |
|
4 | 4 | SPDX-License-Identifier: Apache-2.0 |
5 | 5 | --> |
6 | 6 |
|
7 | | -# Intel's Robotics AI Suite : Follow-me with gesture-control |
| 7 | +# Intel's Robotics AI Suite: Follow-Me with Gesture and Audio Control |
8 | 8 |
|
9 | | -This release version contains `debian` package building rules. `dpkg-buildpackage` is automatically triggered in the CI/CD pipeline and the created debian packages are pushed to Intel's AMR repo. |
| 9 | +A Gazebo simulation of a TurtleBot3 Waffle autonomously following a guide robot using Intel's |
| 10 | +ADBSCAN (Adaptive DBSCAN) algorithm. Supports two sensor modes — 2D LiDAR and Intel RealSense |
| 11 | +depth camera — with optional hand-gesture control and voice audio control. |
| 12 | + |
| 13 | +## Demo Modes |
| 14 | + |
| 15 | +| Mode | Sensor | Gesture | Audio | Script | |
| 16 | +|------|--------|---------|-------|--------| |
| 17 | +| LiDAR + Gesture | 2D LiDAR | Yes | No | `demo_lidar.sh` | |
| 18 | +| LiDAR + Gesture + Audio | 2D LiDAR | Yes | Yes | `demo_lidar_audio.sh` | |
| 19 | +| RealSense + Gesture | Depth camera | Yes | No | `demo_RS.sh` | |
| 20 | +| RealSense + Gesture + Audio | Depth camera | Yes | Yes | `demo_RS_audio.sh` | |
| 21 | + |
| 22 | +--- |
10 | 23 |
|
11 | 24 | ## Prerequisites |
12 | 25 |
|
13 | | -Please make sure to include intel's AMR repo to `/etc/apt/sources.list.d/` |
| 26 | +### Supported ROS 2 Distributions |
14 | 27 |
|
15 | | -### Install debian packages |
| 28 | +| ROS 2 | Gazebo | Status | |
| 29 | +|-------|--------|--------| |
| 30 | +| Jazzy | Harmonic | Recommended | |
| 31 | +| Humble | Fortress | Supported | |
16 | 32 |
|
17 | | -Install `ros-humble-followme-turtlebot3-gazebo` debian package |
| 33 | +### System Packages |
18 | 34 |
|
19 | 35 | ```bash |
20 | | -sudo apt update |
21 | | -sudo apt install ros-humble-followme-turtlebot3-gazebo |
| 36 | +sudo apt install python3-colcon-common-extensions python3-pip |
| 37 | +# For ROS 2 Humble only: |
| 38 | +sudo apt install ros-humble-gazebo-* ros-humble-dynamixel-sdk \ |
| 39 | + ros-humble-turtlebot3-msgs ros-humble-turtlebot3 ros-humble-xacro |
22 | 40 | ``` |
23 | 41 |
|
24 | | -### Create Python Virtual Environment |
| 42 | +### Python Virtual Environment |
| 43 | + |
| 44 | +Create a virtual environment **outside** the colcon workspace to avoid build interference: |
25 | 45 |
|
26 | 46 | ```bash |
27 | 47 | sudo apt install pipx |
28 | 48 | pipx install virtualenv |
29 | 49 | pipx ensurepath |
30 | 50 | source ~/.bashrc |
31 | | -virtualenv venv_followme |
32 | | -source venv_followme/bin/activate |
| 51 | + |
| 52 | +# Create venv (example location): |
| 53 | +virtualenv ~/followme_env |
| 54 | +source ~/followme_env/bin/activate |
33 | 55 | ``` |
34 | 56 |
|
35 | | -### Install Python modules |
| 57 | +### Python Packages |
36 | 58 |
|
37 | | -This application uses [Mediapipe Hands Framework](https://mediapipe.readthedocs.io/en/latest/solutions/hands.html) for hand gesture recognition. Please install the following python packages as a pre-requisite |
| 59 | +This application uses the [MediaPipe Hands Framework](https://mediapipe.readthedocs.io/en/latest/solutions/hands.html) |
| 60 | +for hand gesture recognition. |
38 | 61 |
|
39 | | -For ROS Jazzy: |
| 62 | +For ROS 2 **Jazzy** (gesture only): |
40 | 63 | ```bash |
41 | | -pip3 install numpy==1.26.4 |
42 | | -pip3 install mediapipe==0.10.31 |
43 | | -pip3 install opencv-python==4.8.0.76 |
44 | | -pip3 install pyyaml |
| 64 | +pip3 install numpy==1.26.4 mediapipe==0.10.31 opencv-python==4.8.0.76 pyyaml |
45 | 65 | ``` |
46 | 66 |
|
47 | | -For ROS Humble: |
| 67 | +For ROS 2 **Jazzy** (gesture + audio): |
48 | 68 | ```bash |
49 | | -pip3 install numpy==1.24.3 |
50 | | -pip3 install mediapipe==0.10.9 |
51 | | -pip3 install opencv-python==4.8.0.76 |
52 | | -pip3 install pyyaml |
| 69 | +pip3 install numpy==1.26.4 mediapipe==0.10.31 opencv-python==4.8.0.76 pyyaml \ |
| 70 | + librosa openvino==2025.3.0 simpleaudio sounddevice tqdm inflect |
53 | 71 | ``` |
54 | 72 |
|
55 | | -## Run gazebo simulator with 2D lidar |
56 | | - |
| 73 | +For ROS 2 **Humble** (gesture only): |
57 | 74 | ```bash |
58 | | -sudo chmod +x /opt/ros/humble/share/followme_turtlebot3_gazebo/scripts/demo_lidar.sh |
59 | | -/opt/ros/humble/share/followme_turtlebot3_gazebo/scripts/demo_lidar.sh |
| 75 | +pip3 install numpy==1.24.3 mediapipe==0.10.9 opencv-python==4.8.0.76 pyyaml tensorflow |
60 | 76 | ``` |
61 | 77 |
|
62 | | -## Run gazebo simulator with RealSense |
63 | | - |
64 | | -Open three terminals and run the following commands |
65 | | -Terminal 1: This command will open gazebo simulator and rviz |
66 | | - |
| 78 | +For ROS 2 **Humble** (gesture + audio): |
67 | 79 | ```bash |
68 | | -sudo chmod +x /opt/ros/humble/share/followme_turtlebot3_gazebo/scripts/demo_RS.sh |
69 | | -/opt/ros/humble/share/followme_turtlebot3_gazebo/scripts/demo_RS.sh |
| 80 | +pip3 install numpy==1.24.3 mediapipe==0.10.9 opencv-python==4.8.0.76 pyyaml tensorflow \ |
| 81 | + librosa openvino==2025.3.0 simpleaudio sounddevice tqdm inflect |
70 | 82 | ``` |
71 | 83 |
|
72 | | -Terminal 2: This command will run the ADBSCAN package |
73 | | - |
74 | | -```bash |
75 | | -source /opt/ros/humble/setup.bash |
76 | | -ros2 run adbscan_ros2_follow_me adbscan_sub_w_gesture --ros-args --params-file /opt/ros/humble/share/adbscan_ros2_follow_me/config/adbscan_sub_RS.yaml -r cmd_vel:=tb3/cmd_vel |
77 | | - ``` |
| 84 | +--- |
78 | 85 |
|
79 | | -Terminal 3: This command will run the gesture recognition package |
| 86 | +## Build |
80 | 87 |
|
81 | 88 | ```bash |
82 | | -source /opt/ros/humble/setup.bash |
83 | | -ros2 run gesture_recognition_pkg traj_and_img_publisher_node.py --ros-args --params-file /opt/ros/humble/share/gesture_recognition_pkg/config/gesture_recognition.yaml |
84 | | - ``` |
85 | | - |
86 | | -## Robotic SDK 2023.1 Release: Follow-me |
87 | | - |
88 | | -## Hardware |
89 | | - |
90 | | -1. Turn off Pengo; |
91 | | -2. Unplug HDMI cable and replace with dungo; |
92 | | -3. Unplug power cable and replace it with battery; |
93 | | -4. Turn on the robot by pressing the switch button; |
94 | | - |
95 | | -To check if RealSense camera is working, type: |
96 | | -realsense-viewer |
| 89 | +cd Follow_me_RS_2D |
| 90 | +source /opt/ros/<distro>/setup.bash |
| 91 | +source ~/followme_env/bin/activate |
| 92 | +colcon build --symlink-install |
| 93 | +source install/setup.bash |
| 94 | +``` |
97 | 95 |
|
98 | | -## To Run Follow-me on Pengo with RealSense |
| 96 | +--- |
99 | 97 |
|
100 | | -note: the Kobuki chassis needs to be turned on for the motor to run. |
| 98 | +## Running the Demos |
101 | 99 |
|
102 | | -Step 1: Enable Kobuki (only needed when moving the actual Pengo robot chassis’s Kobuki chassis): |
103 | | -cd /home/awm/project/robotic/ati/iotg_workloads-robotic_platform_poc |
104 | | -source ./setup.sh |
105 | | -./run_kobuki.sh |
| 100 | +All demo scripts auto-detect the installed ROS 2 distribution, source the workspace, kill any |
| 101 | +stale Gazebo processes, and launch the full stack (Gazebo, ROS-Gazebo bridges, ADBSCAN, gesture, |
| 102 | +trajectory, and optionally audio nodes) with RViz. |
106 | 103 |
|
107 | | -Step 2: Start RealSense ROS2 publication: |
| 104 | +### 2D LiDAR — Gesture only |
108 | 105 |
|
109 | | -1. . /opt/ros/foxy/setup.sh |
110 | | -2. ros2 launch realsense2_camera rs_launch.py serial_no:="_109622074344" depth_module.profile:=640x480x6 pointcloud.enable:=true camera_namespace:=/ |
| 106 | +```bash |
| 107 | +source ~/followme_env/bin/activate |
| 108 | +./src/turtlebot3_simulations/followme_turtlebot3_gazebo/scripts/demo_lidar.sh |
| 109 | +``` |
111 | 110 |
|
112 | | -Step 3: To run RealSense version of Follow-me: |
113 | | -cd /home/awm/project/robotic/ati/Follow_me_demo/Follow_me_configurable_2/src |
114 | | -. ./install/setup.sh |
115 | | -./start_adbscan_sub_RS.sh |
| 111 | +### 2D LiDAR — Gesture + Audio |
116 | 112 |
|
117 | | -## To Run Follow-me on Pengo with 2D lidar |
| 113 | +```bash |
| 114 | +source ~/followme_env/bin/activate |
| 115 | +./src/turtlebot3_simulations/followme_turtlebot3_gazebo/scripts/demo_lidar_audio.sh |
| 116 | +``` |
118 | 117 |
|
119 | | -note: the Kobuki chassis needs to be turned on for the motor to run. |
| 118 | +### RealSense — Gesture only |
120 | 119 |
|
121 | | -Step 1: Enable Kobuki (only needed when moving the actual Pengo robot chassis’s Kobuki chassis): |
122 | | -cd /home/awm/project/robotic/ati/iotg_workloads-robotic_platform_poc |
123 | | -source ./setup.sh |
124 | | -./run_pengo_lslam.sh |
| 120 | +```bash |
| 121 | +source ~/followme_env/bin/activate |
| 122 | +./src/turtlebot3_simulations/followme_turtlebot3_gazebo/scripts/demo_RS.sh |
| 123 | +``` |
125 | 124 |
|
126 | | -Step 2: To run RealSense version of Follow-me: |
127 | | -cd /home/awm/project/robotic/ati/Follow_me_demo/Follow_me_configurable_2/src |
128 | | -. ./install/setup.sh |
129 | | -./start_adbscan_sub_2.sh |
| 125 | +### RealSense — Gesture + Audio |
130 | 126 |
|
131 | | -## To configure |
| 127 | +```bash |
| 128 | +source ~/followme_env/bin/activate |
| 129 | +./src/turtlebot3_simulations/followme_turtlebot3_gazebo/scripts/demo_RS_audio.sh |
| 130 | +``` |
132 | 131 |
|
133 | | -The configuration file for 2D lidar version is: adbscan_sub_2D.yaml |
134 | | -The configuration file for RealSense camera version is: adbscan_sub_RS.yaml |
| 132 | +> **Note:** Allow ~10 seconds after launch for Gazebo and all nodes to initialize before the |
| 133 | +> TurtleBot3 begins following. The guide robot trajectory runs for ~45 seconds. |
| 134 | +
|
| 135 | +--- |
| 136 | + |
| 137 | +## Architecture |
| 138 | + |
| 139 | +Each demo runs in a single terminal using a two-phase launch sequence: |
| 140 | + |
| 141 | +1. **Shared launch** (`*_shared.launch.py`) — Gazebo world, robot state publishers, |
| 142 | + Gazebo↔ROS bridges, and spawn of both the TurtleBot3 Waffle and guide robot. |
| 143 | +2. **Perception launch** (`*_gesture.launch.py` or `*_gesture_audio.launch.py`) — ADBSCAN |
| 144 | + node, gesture recognition, trajectory publisher, and (for audio modes) speech recognition |
| 145 | + and audio file publisher. |
| 146 | + |
| 147 | +### Launch Files |
| 148 | + |
| 149 | +| Launch File | Phase | Description | |
| 150 | +|-------------|-------|-------------| |
| 151 | +| `lidar_shared.launch.py` | 1 | Gazebo world + bridges for 2D LiDAR | |
| 152 | +| `rs_shared.launch.py` | 1 | Gazebo world + bridges for depth camera | |
| 153 | +| `lidar_gesture.launch.py` | 2 | ADBSCAN + gesture + trajectory (LiDAR) | |
| 154 | +| `lidar_gesture_audio.launch.py` | 2 | ADBSCAN + gesture + audio + trajectory (LiDAR) | |
| 155 | +| `rs_gesture.launch.py` | 2 | ADBSCAN + gesture + trajectory (RS) | |
| 156 | +| `rs_gesture_audio.launch.py` | 2 | ADBSCAN + gesture + audio + trajectory (RS) | |
| 157 | + |
| 158 | +```text |
| 159 | + ┌─────────────────────────────────────────────┐ |
| 160 | + │ Gazebo Harmonic / Fortress │ |
| 161 | + │ ┌─────────────┐ ┌──────────────────┐ │ |
| 162 | + │ │ Guide Robot │────▶│ TurtleBot3 Waffle │ │ |
| 163 | + │ │ (traj node) │ │ (ADBSCAN follower)│ │ |
| 164 | + │ └─────────────┘ └──────────────────┘ │ |
| 165 | + └───────────┬─────────────────────────────────┘ |
| 166 | + │ /camera/points OR /scan |
| 167 | + ▼ |
| 168 | + ┌─────────────────────┐ |
| 169 | + │ ADBSCAN Node │ ◀── gesture_recognition_node |
| 170 | + │ adbscan_sub_w_ │ ◀── speech_recognition_node (audio modes) |
| 171 | + │ gesture[_audio] │ |
| 172 | + └──────────┬──────────┘ |
| 173 | + │ /tb3/cmd_vel |
| 174 | + ▼ |
| 175 | + TurtleBot3 Waffle |
| 176 | +``` |
135 | 177 |
|
136 | | -Parameters such as subsample ratio, filter range, sensor type etc. can be configured in this file. |
| 178 | +### Key Nodes |
| 179 | + |
| 180 | +| Node | Package | Description | |
| 181 | +|------|---------|-------------| |
| 182 | +| `adbscan_sub_w_gesture` | `adbscan_ros2_follow_me` | ADBSCAN follower (gesture mode) | |
| 183 | +| `adbscan_sub_w_gesture_audio` | `adbscan_ros2_follow_me` | ADBSCAN follower (gesture + audio) | |
| 184 | +| `gesture_recognition_node.py` | `gesture_recognition_pkg` | MediaPipe hand gesture classifier | |
| 185 | +| `traj_and_img_publisher_node.py` | `gesture_recognition_pkg` | Guide robot trajectory publisher | |
| 186 | +| `speech_recognition_node.py` | `speech_recognition_pkg` | Voice command recognizer | |
| 187 | +| `audio_publisher_node.py` | `speech_recognition_pkg` | Audio file publisher | |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +## Key Configuration Parameters |
| 192 | + |
| 193 | +### Sensor Config Files |
| 194 | + |
| 195 | +| Sensor | Config File | |
| 196 | +|--------|-------------| |
| 197 | +| 2D LiDAR | `src/adbscan_ros2/config/adbscan_sub_2D.yaml` | |
| 198 | +| RealSense | `src/adbscan_ros2/config/adbscan_sub_RS.yaml` | |
| 199 | + |
| 200 | +### Important Parameters |
| 201 | + |
| 202 | +| Parameter | Description | Recommended Value | |
| 203 | +|-----------|-------------|-------------------| |
| 204 | +| `tracking_radius` | Search radius (m) around last known target each frame | `1.0` | |
| 205 | +| `init_tgt_loc` | Initial target distance (m) the follower aims to maintain | `0.8` (hardware) / `0.5` (Gazebo sim) | |
| 206 | +| `max_dist` | Maximum follow distance (m) — no command if guide is farther | `3.0` | |
| 207 | +| `min_dist` | Minimum follow distance (m) — slow/stop when guide is closer | `0.5` (hardware) / `0.3` (Gazebo sim) | |
| 208 | +| `max_linear` | Maximum linear velocity (m/s) | `0.8` | |
| 209 | +| `max_angular` | Maximum angular velocity (rad/s) | `0.6` | |
| 210 | +| `max_frame_blocked` | Frames without detection before target is considered lost | `5` | |
| 211 | +| `z_filter` | Minimum Z height (m) for RS point cloud — filters ground | `-0.15` | |
| 212 | +| `subsample_ratio` | Keep 1 in N points (RS point cloud subsampling) | `15.0` | |
| 213 | +| `gesture_enable` | Enable hand gesture start/stop control | `true` | |
| 214 | +| `audio_enable` | Enable voice command start/stop control | `true` | |
| 215 | + |
| 216 | +> **Important:** `tracking_radius` must be large enough to cover the guide's lateral movement |
| 217 | +> between frames. Values that are too small (e.g. `0.2`) cause the tracker to lose the target |
| 218 | +> during turns, making the follower go straight instead of turning. |
| 219 | +> |
| 220 | +> **Gazebo simulation note:** The RealSense launch files (`rs_gesture.launch.py`, |
| 221 | +> `rs_gesture_audio.launch.py`) override three parameters for the simulated depth camera: |
| 222 | +> `optical_frame: False` (Gazebo publishes in body frame, not optical frame), |
| 223 | +> `min_dist: 0.3` (guide robot front surface appears at ~0.44 m, below the YAML default 0.5), |
| 224 | +> and `init_tgt_loc: 0.5` (matching the actual cluster centroid distance). These overrides are |
| 225 | +> not needed on real hardware with an Intel RealSense camera. |
| 226 | +
|
| 227 | +--- |
| 228 | + |
| 229 | +## Guide Robot |
| 230 | + |
| 231 | +The guide robot (airport-style follow-me car) uses a black-and-yellow checkerboard visual |
| 232 | +pattern and follows a pre-programmed S-curve trajectory lasting ~50 seconds. It starts facing |
| 233 | +the `+X` direction (yaw = 0) so it is immediately visible in the TurtleBot3's sensor FOV. |
| 234 | + |
| 235 | +--- |
| 236 | + |
| 237 | +## Troubleshooting |
| 238 | + |
| 239 | +| Symptom | Likely Cause | Fix | |
| 240 | +|---------|-------------|-----| |
| 241 | +| TurtleBot3 goes straight, no turning | `tracking_radius` too small | Set `tracking_radius: 1.0` in YAML | |
| 242 | +| TurtleBot3 does not move at all | Guide robot facing away | Verify `spawn_gbot.launch.py` uses `-Y 0.0` | |
| 243 | +| Target lost immediately (RS) | `z_filter` too high | Set `z_filter: -0.15` in `adbscan_sub_RS.yaml` | |
| 244 | +| Gesture node not starting | Python venv not active | Run `source ~/followme_env/bin/activate` first | |
| 245 | +| Audio commands not reaching ADBSCAN | Speech node overloaded | Ensure `speech_recognition_pkg` is rebuilt; the node skips empty filenames and holds valid commands for 3 s | |
| 246 | +| TTS node fails to start | Missing audio packages | Install audio requirements: `pip3 install librosa openvino simpleaudio sounddevice tqdm inflect` | |
| 247 | +| Gazebo fails to start | Stale `gz` process | Run `sudo killall -9 gz ruby` before launching | |
0 commit comments