navigate-to
carla-simulator/carla/Skills/python-api/navigate-to/SKILL.md
Drives a vehicle to a destination autonomously using CARLA's navigation agents (BasicAgent/BehaviorAgent/ConstantVelocityAgent), or plans a route between two points with GlobalRoutePlanner. The agent handles routing, obstacle avoidance and traffic-light obedience. Use when the user asks to "drive the ego to (x,y,z)", "navigate to the junction", "go to that location", "plan a route from A to B", or "make the car drive itself somewhere specific". Manual control is control-vehicle; autopilot roaming is control-traffic.
What's in it
- Navigate a vehicle to a destination
- Instructions
- Step 1: Check prerequisites
- Step 3: Navigate
- Examples
- Troubleshooting
- Outputs
--- name: navigate-to description: Drives a vehicle to a destination autonomously using CARLA's navigation agents (BasicAgent/BehaviorAgent/ConstantVelocityAgent), or plans a route between two points with GlobalRoutePlanner. The agent handles routing, obstacle avoidance and traffic-light obedience. Use when the user asks to "drive the ego to (x,y,z)", "navigate to the junction", "go to that location", "plan a route from A to B", or "make the car drive itself somewhere specific". Manual control is control-vehicle; autopilot roaming is control-traffic. license: MIT compatibility: Any OS with the CARLA PythonAPI installed and the CARLA checkout's PythonAPI/carla/agents on PYTHONPATH (env.sh sets it from CARLA_ROOT), plus a reachable running server with a target vehicle. Does NOT need UE4_ROOT. Tested against CARLA 0.9.16. metadata: group: python-api prerequisites: scripts/check_env.sh reference: references/navigation.md --- # Navigate a vehicle to a destination > **Paths.** `scripts/…` and `references/…` below are relative to the > directory holding this SKILL.md. Your working directory is the user's > project, not that directory, so prefix them with its absolute path or the > command is not found. Point-to-point autonomous driving. `go` drives the ego to a destination with a navigation agent that plans a route and follows it while avoiding obstacles and obeying (or ignoring, on request) traffic lights. `route` just plans the path. This is distinct from the sibling driving skills: [`control-vehicle`](../control-vehicle/SKILL.md) is manual actuator input; [`control-traffic`](../control-traffic/SKILL.md) is the Traffic Manager making cars roam; this drives one car to a **specific place**. ## Instructions ``` Progress: - [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs (incl. agents import) - [ ] Step 2: Have an ego (spawn-vehicles ego) and a destination (world-data/map-waypoints) - [ ] Step 3: go (drive) — or route (plan only). Runs a tick loop until arrival/timeout ``` Commands need `CARLA_HOST`/`CARLA_PORT` + `CARLA_ROOT` from `scripts/env.sh`. **Negative coordinates:** use the `=` form (`--to=-24,-57,0.6`). ### Step 1: Check prerequisites ```bash bash scripts/check_env.sh ``` FAILs if the `agents` package isn't importable — set `CARLA_ROOT` to a carla checkout so `PythonAPI/carla/agents` is on `PYTHONPATH`. ### Step 3: Navigate ```bash source scripts/env.sh # plan a route and draw it (no driving) python3 scripts/navigate.py route --from=0,0,1 --to=-24,-57,1 --draw # drive the ego there (BasicAgent, obeys lights) python3 scripts/navigate.py go --to=-24,-57,1 --speed 25 # a cautious/aggressive style python3 scripts/navigate.py go --to=-24,-57,1 --agent behavior --behavior aggressive # ignore lights (e.g. an emergency run) and give it more time python3 scripts/navigate.py go --to=100,20,1 --ignore-lights --seconds 120 ``` `go` targets the ego (`role hero`) by default; `--id`/`--filter` for another vehicle. It blocks until the car arrives (`agent.done()`) or `--seconds` elapses. ## Examples **Example 1: drive to a spot** User says: "drive the ego to (−24, −57)" `go --to=-24,-57,1`. It plans, drives, and prints "arrived" on success. **Example 2: go to a resolved element** User says: "drive to the 4-way junction in the middle" `map-waypoints junctions --arms 4` → pick its centre → `go --to=<centre>`. **Example 3: just the route** User says: "what's the route from here to the depot?" `route --from=<here> --to=<depot> --draw` → maneuver list + drawn path. ## Troubleshooting **Problem: `cannot import agents`** Cause: the agents package (checkout-only) isn't on PYTHONPATH. Solution: set `CARLA_ROOT` to a carla checkout; env.sh adds `PythonAPI/carla`. **Problem: it never arrives / stops at timeout** Cause: unreachable destination, too little time, or stuck in traffic. Solution: verify the destination is on a road (map-waypoints `waypoint`), raise `--seconds`, or `--ignore-vehicles` to push through. **Problem: the car doesn't move in sync mode** Cause: `go` ticks the world itself in sync mode; if another process also ticks, they fight. Solution: run one ticker. In async it just drives. **Problem: it stops at every red light forever** Cause: dense traffic / lights. Solution: `--ignore-lights` (and/or the control-traffic-lights skill to free them). ## Outputs Server state — the vehicle drives to the destination (or a planned route + drawn overlay for `route`). No file. `go` reports arrival or timeout. Detail (agent types, route planner, run-step loop, sync interaction) in [references/navigation.md](references/navigation.md).
More agent context in carla-simulator/carla
60 other files this repository gives its agents.
AGENTS.md
Skill
- create-leaderboard-routeSkills/leaderboard/create-leaderboard-route/SKILL.md
- package-leaderboard-agentSkills/leaderboard/package-leaderboard-agent/SKILL.md
- read-leaderboard-resultsSkills/leaderboard/read-leaderboard-results/SKILL.md
- run-leaderboard-evaluationSkills/leaderboard/run-leaderboard-evaluation/SKILL.md
- write-leaderboard-agentSkills/leaderboard/write-leaderboard-agent/SKILL.md
- bounding-boxesSkills/python-api/bounding-boxes/SKILL.md
- control-lightsSkills/python-api/control-lights/SKILL.md
- control-spectatorSkills/python-api/control-spectator/SKILL.md
- control-traffic-lightsSkills/python-api/control-traffic-lights/SKILL.md
- control-trafficSkills/python-api/control-traffic/SKILL.md
- control-vehicleSkills/python-api/control-vehicle/SKILL.md
- create-sensorSkills/python-api/create-sensor/SKILL.md
- debug-drawSkills/python-api/debug-draw/SKILL.md
- debug-navmeshSkills/python-api/debug-navmesh/SKILL.md
- load-mapSkills/python-api/load-map/SKILL.md
- map-waypointsSkills/python-api/map-waypoints/SKILL.md
- query-recordingSkills/python-api/query-recording/SKILL.md
- read-sensorSkills/python-api/read-sensor/SKILL.md
- record-simulationSkills/python-api/record-simulation/SKILL.md
- replay-recordingSkills/python-api/replay-recording/SKILL.md
- set-weatherSkills/python-api/set-weather/SKILL.md
- set-world-settingsSkills/python-api/set-world-settings/SKILL.md
- spawn-vehiclesSkills/python-api/spawn-vehicles/SKILL.md
- spawn-walkersSkills/python-api/spawn-walkers/SKILL.md
- telemetrySkills/python-api/telemetry/SKILL.md
- toggle-env-objectsSkills/python-api/toggle-env-objects/SKILL.md
- world-dataSkills/python-api/world-data/SKILL.md
- add-ros-message-typeSkills/ros2/add-ros-message-type/SKILL.md
- add-ros-publisherSkills/ros2/add-ros-publisher/SKILL.md
- visualize-ros-rvizSkills/ros2/visualize-ros-rviz/SKILL.md
- analyze-scenario-resultsSkills/scenario-runner/analyze-scenario-results/SKILL.md
- create-scenarioSkills/scenario-runner/create-scenario/SKILL.md
- run-openscenarioSkills/scenario-runner/run-openscenario/SKILL.md
- run-route-scenarioSkills/scenario-runner/run-route-scenario/SKILL.md
- run-scenarioSkills/scenario-runner/run-scenario/SKILL.md
- create-scenic-scenarioSkills/scenic/create-scenic-scenario/SKILL.md
- run-scenic-scenarioSkills/scenic/run-scenic-scenario/SKILL.md
- check-feature-supportSkills/setup/check-feature-support/SKILL.md
- download-carlaSkills/setup/download-carla/SKILL.md
- install-leaderboardSkills/setup/install-leaderboard/SKILL.md
- install-python-apiSkills/setup/install-python-api/SKILL.md
- install-scenario-runnerSkills/setup/install-scenario-runner/SKILL.md
- install-scenicSkills/setup/install-scenic/SKILL.md
- build-carla-ue4Skills/ue4/build-carla-ue4/SKILL.md
- import-carla-mapSkills/ue4/import-carla-map/SKILL.md
- import-carla-propSkills/ue4/import-carla-prop/SKILL.md
- import-carla-vehicleSkills/ue4/import-carla-vehicle/SKILL.md
- import-carla-walkerSkills/ue4/import-carla-walker/SKILL.md
- package-carla-ue4Skills/ue4/package-carla-ue4/SKILL.md
- run-carla-serverSkills/ue4/run-carla-server/SKILL.md
- build-carla-ue58Skills/ue58/build-carla-ue58/SKILL.md
- carla-vehicle-authoringSkills/ue58/carla-vehicle-authoring/SKILL.md
- import-carla-ue58-mapSkills/ue58/import-carla-ue58-map/SKILL.md
- import-carla-ue58-propSkills/ue58/import-carla-ue58-prop/SKILL.md
- import-carla-ue58-walkerSkills/ue58/import-carla-ue58-walker/SKILL.md
- package-carla-ue58Skills/ue58/package-carla-ue58/SKILL.md
- run-autoware-ue58Skills/ue58/run-autoware-ue58/SKILL.md
- run-carla-ue58-serverSkills/ue58/run-carla-ue58-server/SKILL.md
- check-ue5-limitationsSkills/ue5/check-ue5-limitations/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

