|
| 1 | +# Example - Turtlebot3 (Real) |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +This example demonstrates the use of a real TurtleBot3 Burger robot with ROS2. |
| 6 | +The TurtleBot3 is a compact, customizable mobile robot designed for education and research. It supports applications such as SLAM, navigation, and autonomous control, and comes in various hardware configurations. |
| 7 | + |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +For this example, the TurtleBot3 Burger version with Ubuntu 22.04 and ROS2 Humble is used. Depending on your TurtleBot3 model and installed hardware (e.g., LDS-01 LiDAR), make sure to install the corresponding packages required for your specific configuration. |
| 12 | + |
| 13 | +### Turtlebot3 |
| 14 | + |
| 15 | +For more details, please refer to the [TurtleBot3 Documentation](https://emanual.robotis.com/docs/en/platform/turtlebot3/overview/). |
| 16 | + |
| 17 | +<img src="images/turtlebot3_image.png" width="300"> |
| 18 | + |
| 19 | +- **Specification** |
| 20 | + - **OS** : Ubuntu 22.04 |
| 21 | + - **ROS** : ROS2 Humble |
| 22 | + - **TurtleBot3 Model** : Burger |
| 23 | + - **LiDAR** : LDS-01 |
| 24 | + - **Computer** : Raspberry Pi 3 Model B+ (1GB RAM) |
| 25 | + - **Motor Controller** : OpenCR 1.0 (Firmware v0.2.1) |
| 26 | + |
| 27 | +## Quick Start |
| 28 | + |
| 29 | +### 1. Network Setup |
| 30 | + |
| 31 | +Since the TurtleBot3 is controlled via ROS-MCP from the user PC, it is important to connect both the user PC and the TurtleBot3 to the same network. |
| 32 | +> **Note:** You can check your network IP address with the `ifconfig` command. |
| 33 | +
|
| 34 | +**Ping Test** |
| 35 | + |
| 36 | +After connecting them to the same network, perform a ping test from the user PC to TurtleBot3 to verify that the connection is established correctly: |
| 37 | +**[User's PC]** |
| 38 | +```bash |
| 39 | +ping <TURTLEBOT3_IP> # e.g., ping 192.168.101.166 |
| 40 | +``` |
| 41 | + |
| 42 | +**ROS2 Network Setup** |
| 43 | + |
| 44 | +In ROS2, environment variables are used to configure Domain ID and ROS middleware behavior. |
| 45 | +On both the user PC and TurtleBot3, export: |
| 46 | +**[User's PC]** **[Turtlebot3 SBC]** |
| 47 | +```bash |
| 48 | +echo "export ROS_DOMAIN_ID=30" >> ~/.bashrc |
| 49 | +echo "export RMW_IMPLEMENTATION=rmw_fastrtps_cpp" >> ~/.bashrc |
| 50 | +source ~/.bashrc |
| 51 | +``` |
| 52 | + |
| 53 | +### 2. Bringup Turtlebot3 |
| 54 | + |
| 55 | +Open a new terminal on the user PC and connect to the Raspberry Pi via SSH using its IP address. Enter your Ubuntu OS password for the Raspberry Pi. |
| 56 | + |
| 57 | +**[User's PC]** |
| 58 | +```bash |
| 59 | +ssh ubuntu@{IP_ADDRESS_OF_RASPBERRY_PI} |
| 60 | +``` |
| 61 | + |
| 62 | +Bring up basic packages to start essential TurtleBot3 applications. You will need to specify your TurtleBot3 model. |
| 63 | + |
| 64 | +**[Turtlebot3 SBC]** |
| 65 | +```bash |
| 66 | +export TURTLEBOT3_MODEL=burger |
| 67 | +ros2 launch turtlebot3_bringup robot.launch.py |
| 68 | +``` |
| 69 | + |
| 70 | +### 3. Launch Node on Your Turtlebot3 SBC and Open claude-desktop on Your PC |
| 71 | + |
| 72 | +**[Turtlebot3 SBC]** |
| 73 | +```bash |
| 74 | +ros2 launch rosbridge_server rosbridge_websocket_launch.xml |
| 75 | +``` |
| 76 | + |
| 77 | +**[User's PC]** |
| 78 | +```bash |
| 79 | +claude-desktop |
| 80 | +``` |
| 81 | + |
| 82 | +## **Example Walkthrough** |
| 83 | +You're now ready to interact with the TurtleBot3 via the ROS MCP server. Follow these examples step-by-step: |
| 84 | + |
| 85 | +### **Example 1**: Connect to Robot |
| 86 | + |
| 87 | +<img src="images/turtlebot3_connect.png" width="500"> |
| 88 | + |
| 89 | +### **Example 2**: Check Available Topics |
| 90 | + |
| 91 | +<img src="images/turtlebot3_gettopics_1.png" width="500"> |
| 92 | +<img src="images/turtlebot3_gettopics_2.png" width="500"> |
| 93 | + |
| 94 | +### **Example 3**: Move the Robot Back and Forth |
| 95 | +<img src="images/turtlebot3_example3.gif" width="500"> |
| 96 | + |
| 97 | + |
| 98 | +## **Next Steps** |
| 99 | +If your TurtleBot3 is equipped with a Raspberry Pi camera, you can now start streaming visual data. Try integrating camera feeds into your pipeline for more advanced robot control demos. |
0 commit comments