How to drive a simulated robot from chat
Quando usar: You want to test high-level robot behaviors quickly.
Pré-requisitos
- 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
Fluxo
-
Connect to rosbridgeConfigure the MCP with ROSBRIDGE_URL=ws://localhost:9090 and verify connection.✓ Copiado→ 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.✓ Copiado→ Robot moves in sim
-
Read a sensorSubscribe to /scan for 2 seconds and report obstacles within 1m.✓ Copiado→ Range data summary
Resultado: A live robot responding to natural-language commands.
Armadilhas
- 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