How It Works
When a simulation starts, the proxy:- Discovers the container’s available tools via the MCP protocol
- Registers them with the agent under a namespaced prefix:
sim0__for the first container,sim1__for the second, and so on - Injects a mission workflow prompt as a system block into the agent session
Tool Reference
9 tools are exposed by thepx4-gazebo-humble container image.
arm
arm
Arm the drone motors. The vehicle must be in
ReadyToArm state.
Call get_flight_state first to verify.No parameters.Returns: {"ok": true, "action": "arm"}Example prompt: “Arm the drone.”disarm
disarm
Disarm the drone motors. Only safe when the vehicle is landed.No parameters.Returns:
{"ok": true, "action": "disarm"}Example prompt: “Disarm after landing.”takeoff
takeoff
Take off to a target altitude.
Returns:
| Parameter | Type | Default | Description |
|---|---|---|---|
altitude_m | float | 5.0 | Target altitude in meters AGL (clamped to 1–120) |
{"ok": true, "action": "takeoff", "altitude_m": 5.0}Example prompt: “Take off to 10 meters.”land
land
Land at the current horizontal position.No parameters.Returns:
{"ok": true, "action": "land"}Example prompt: “Land the drone.”go_to
go_to
Navigate to a position relative to the home position.
Offsets are in meters: x = North, y = East, z = altitude above ground (positive up).
The vehicle must be airborne. The tool returns immediately after sending the
setpoint — use
| Parameter | Type | Default | Description |
|---|---|---|---|
x | float | — | North offset from home (meters) |
y | float | — | East offset from home (meters) |
z | float | — | Altitude AGL (meters, positive up) |
yaw_deg | float | 0.0 | Heading in degrees (0 = North, 90 = East) |
wait_for_any with a sim_exec_background altitude-check
script to detect arrival.Returns: {"ok": true, "action": "go_to", "x": 10, "y": 0, "z": 5, "yaw_deg": 0}Example prompt: “Fly 20 meters north at 10 meters altitude.”set_flight_mode
set_flight_mode
Set the vehicle flight mode.
For position setpoint control, use
| Parameter | Type | Default | Description |
|---|---|---|---|
mode | string | — | HOLD, RTL, LAND, or TAKEOFF (case-insensitive) |
go_to instead.Returns: {"ok": true, "action": "set_flight_mode", "mode": "HOLD"}Example prompt: “Switch to hold mode.”return_to_launch
return_to_launch
Return to the home position and land (RTL).No parameters.Returns:
{"ok": true, "action": "return_to_launch"}Example prompt: “Return to home.”run_script
run_script
Execute a Python script inside the container and return its output.
Use for multi-step maneuvers that go beyond single tool calls.
Returns:
| Parameter | Type | Default | Description |
|---|---|---|---|
path | string | — | Absolute path to the script inside the container |
timeout_s | float | 30.0 | Maximum execution time in seconds |
{"ok": true, "exit_code": 0, "stdout": "...", "stderr": ""}Example prompt: “Run the waypoint mission script at /tmp/mission.py.”get_flight_state
get_flight_state
Read-only snapshot of the current flight state: arm status, flight mode,
altitude, position, and battery. No side effects. Use before arming to
verify the vehicle is ready.No parameters.Returns:Example prompt: “What is the drone’s current altitude and battery level?”
Mission Workflow Prompt
The prompt encodes correct PX4 mission sequencing — readiness checks, waypoint arrival detection, and error handling — so your own prompts require no additional instructions. The proxy fetches this prompt from the container at connection time and injects it as a system block into the agent session.Coordinate Frames
Thesim0__go_to tool uses North and East offsets in meters relative to home,
with altitude above ground as a positive-up z value. The built-in
flight_goto tool uses ENU meters. Both tools control the same vehicle —
choose whichever coordinate convention is convenient for your mission. See
Coordinate Frames for a full
explanation of the NED/ENU distinction.