Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4b713f9
fix: Add cross-platform X11 forwarding support for Docker turtlesim
itsbharatj Oct 7, 2025
8b41691
Fixed the error in building uv venv
itsbharatj Oct 8, 2025
071738c
Merge branch 'develop' into develop
itsbharatj Oct 9, 2025
8038651
Merge branch 'robotmcp:develop' into develop
itsbharatj Nov 1, 2025
35b4d05
feat: Enhance turtlesim launch scripts for cross-platform compatibili…
itsbharatj Nov 2, 2025
679e2e0
Added CI test
itsbharatj Nov 2, 2025
d315bb5
Added CI test
itsbharatj Nov 2, 2025
237b360
launch scripts
itsbharatj Nov 4, 2025
d9d474a
Removed ci
itsbharatj Nov 4, 2025
1c2229f
Delete mcp_json.txt
itsbharatj Nov 4, 2025
c147d59
updated README
itsbharatj Nov 4, 2025
5109cf1
*launch.py for turtlesim docker
itsbharatj Nov 5, 2025
f051e3e
Merge branch 'develop' into develop
itsbharatj Nov 6, 2025
f2f88d6
Merge branch 'develop' into develop
itsbharatj Nov 8, 2025
b80a351
Merge branch 'develop' into develop
stex2005 Nov 9, 2025
d9db7b3
Reorganize docker turtlesim example scripts
stex2005 Nov 10, 2025
d6f65ff
Merge branch 'robotmcp:develop' into develop
itsbharatj Nov 10, 2025
a98e651
Fixed the scripts path
itsbharatj Nov 11, 2025
411ba9f
Merge branch 'robotmcp:develop' into develop
itsbharatj Nov 11, 2025
a938734
Add behavior tree manager and validation tools; update dependencies
itsbharatj Nov 11, 2025
3b4a174
Added example: tugbot simulation
itsbharatj Nov 22, 2025
8775c2c
images
itsbharatj Nov 22, 2025
ec8b463
Updated README
itsbharatj Nov 22, 2025
b2d6072
ruff-check
itsbharatj Nov 22, 2025
4a0707e
added demo.gif
itsbharatj Nov 22, 2025
b8ea01f
Revise README for Tugbot example with demo images
itsbharatj Nov 22, 2025
f362e70
refactor
itsbharatj Nov 22, 2025
1315ae9
Update uv.lock
itsbharatj Nov 22, 2025
6bfd083
refactor
itsbharatj Nov 22, 2025
95e3ca1
Merge branch 'develop' into example_11
itsbharatj Nov 22, 2025
e1c7666
ruff check
itsbharatj Nov 22, 2025
0a45a4f
refactor
itsbharatj Nov 22, 2025
43d85a9
refactor
itsbharatj Nov 22, 2025
636438b
renamed
itsbharatj Nov 22, 2025
6a2003a
updated readme
itsbharatj Nov 22, 2025
518236e
Merge branch 'develop' into example_11
itsbharatj Nov 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions examples/10_tugbot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Example 10: Tugbot Warehouse Simulation (Ignition Gazebo)

This example demonstrates how to control a **Tugbot mobile robot** inside a warehouse environment using **Ignition Gazebo (Fortress)** and the **ROS-MCP Server**.

<img src="images/sim.png" width="480">

Using natural language and the `ROS-MCP server`, you can control and navigate the robot in the simulation, inspect its sensors (Lidar), and check its position.

## Working Demo
![Demo](images/output.gif)


## 📋 Tested On

This example has been tested and verified on:

* **OS:** Ubuntu 22.04 LTS
* **ROS Distro:** ROS 2 Humble
* **Simulator:** Ignition Gazebo Fortress
* **Python Manager:** `uv`

> **Note:** We recommend using a Linux-based OS or a VM, as Gazebo compatibility may vary on other operating systems.

## 🛠️ Prerequisites

Before running this example, ensure you have the necessary ROS 2 and Gazebo packages installed on your system:

```bash
sudo apt update
sudo apt install ros-humble-ros-gz # Bridge between ROS 2 and Ignition
sudo apt install ros-humble-rosapi # Required for introspection (listing topics)
sudo apt install ros-humble-rosbridge-server # WebSocket connection for MCP
```

## 📦 Installation & Setup

This project uses `uv` for environment management. Because ROS nodes (like `rosbridge` and `rosapi`) run inside this virtual environment, we must install specific system bindings into the virtual environment.

1. **Create and Activate Virtual Environment:**
Navigate to the root of the repository and run:

```bash
uv venv
source .venv/bin/activate
```

2. **Install Dependencies:**
We have defined a special `bridge` dependency group that handles the ROS-Python bindings (fixing common `ModuleNotFoundError: bson/tornado` errors).

```bash
# Install the package plus the bridge requirements
uv pip install -e .[bridge]
```

## 🚀 How to Run

### 1\. Launch the Simulation & Bridges

We have provided a custom launch file (`tugbot_sim.launch.py`) that starts Ignition Gazebo, the ROS-GZ Bridge, the Rosbridge Websocket, and the ROS API node simultaneously.

```bash
source /opt/ros/humble/setup.bash
source .venv/bin/activate

# Launch the simulation
ros2 launch examples/11_tugbot/tugbot_sim.launch.py
```

*Wait until you see the warehouse environment and the robot appear in the simulation window.*

### 2\. Start the MCP Server

Use the [robot-mcp-client](https://github.com/robotmcp/robot-mcp-client) or any of the MCP Desktop clients (Claude Desktop/Goose/etc).

## 🤖 Sample Prompts & Use Cases

Once connected, the AI has full access to the robot's navigation and sensor data. Here are prompts that are tested and working:

### 1\. Navigation (Movement)

The robot uses a differential drive controller listening on `/cmd_vel`.

> "Make the robot go in a circle"

> "Move the robot forward at 0.5 m/s."

> "Turn the robot 90 degrees to the left."

> "Stop the robot immediately."

> "Drive forward for 3 seconds, then stop."

### 2\. Discovery

The AI can query the system to understand what tools are available.

> "List all available topics."

> "Check the active nodes and tell me if the simulation bridge is running."

> "What kind of message type does the /cmd\_vel topic expect?"

### 3\. Perception & State (Sensors)

The Tugbot is equipped with a Lidar and Odometry sensors.

> "What is the robot's current position (check odometry)?"

> "Read the /scan topic and tell me if there are obstacles nearby."

> "Monitor the robot's velocity."

## ⚠️ Troubleshooting

**Issue: "Service /rosapi/topics does not exist"**

* **Cause:** The `rosapi` node is not running or crashed.
* **Fix:** Ensure you installed the dependencies using `uv pip install -e .[bridge]`. The `bridge` extras install `netifaces`, which `rosapi` requires to start.

**Issue: Robot doesn't move when commanded**

* **Cause:** Topic mismatch between Ignition and ROS.
* **Fix:** Verify the bridge mapping in the launch file. It should map `/model/tugbot/cmd_vel` (Ignition) to `/cmd_vel` (ROS).

**Issue: "ModuleNotFoundError: No module named 'bson' or 'tornado'"**

* **Cause:** Missing Python bindings in the `uv` environment.
* **Fix:** Run `uv pip install pymongo tornado` (or reinstall with the `.[bridge]` flag).

## 📂 File Structure

* `tugbot_sim.launch.py`: The main entry point. Orchestrates Gazebo, ROS Bridge, and MCP connection.
* `tugbot_depot.sdf`: The 3D environment file (downloaded from Gazebo Fuel).
Binary file added examples/10_tugbot/images/output.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/10_tugbot/images/sim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading