How to drive a simulated robot from chat
Quand l'utiliser : You want to test high-level robot behaviors quickly.
Prérequis
- ROS 2 (Humble/Jazzy) or ROS 1 running — Docker containers for Humble work great for quick starts
- rosbridge_suite installed + running — ros2 launch rosbridge_server rosbridge_websocket_launch.xml
- Python 3.10+ + uvx — brew install [email protected] uv
Déroulement
-
Connect to rosbridgeConfigure the MCP with ROSBRIDGE_URL=ws://localhost:9090 and verify connection.✓ Copié→ List of active topics returned
-
Move the robotPublish to /cmd_vel a Twist message moving forward at 0.2 m/s for 3 seconds, then stop.✓ Copié→ Robot moves in sim
-
Read a sensorSubscribe to /scan for 2 seconds and report obstacles within 1m.✓ Copié→ Range data summary
Résultat : A live robot responding to natural-language commands.
Pièges
- Sending too-fast velocity commands crashes/tips the robot — Rate-limit commands in your prompt; start with small velocities
- Unsafe autonomy — no geofence — Always run first in simulation (Gazebo); never wire this to a physical robot without e-stop