Overview
The manual driver allows interactive control of the ego vehicle using keyboard input. This is useful for:- Debugging and exploring simulation scenarios interactively
- Testing specific driving behaviors manually
- Visualizing camera feeds in real-time
The manual driver runs as an external service (Python script) on your machine, not inside docker-compose.
Requirements
- Display server (X11 or Wayland) - The manual driver requires a GUI for keyboard input and camera visualization
- pygame - Automatically installed with driver dependencies
Controls
| Key | Action |
|---|---|
| W / UP | Accelerate (increase target speed) |
| S / DOWN | Brake/Decelerate (decrease target speed) |
| A / LEFT | Steer left |
| D / RIGHT | Steer right |
| SPACE | Emergency stop (zero speed) |
| ESC / Q | Quit |
Running the Manual Driver
Step 1: Start the Manual Driver
From the repository root, start the driver:- Start and display a pygame window showing the camera feed
- Bind to
0.0.0.0:6789by default (all network interfaces) - Print the external IP address in logs for remote connections
The pygame window must have focus to receive keyboard inputs. Click on the window before driving.
Step 2: Launch the Simulator
Run the wizard with thelocal_external_driver deploy config:
localhost:6789.
Remote Driver Setup
If your driver runs on a different machine or port, override the address:- The driver prints its external IP in the logs upon launch
- Use the IP:port from the driver’s startup message
Configuration
The manual driver configuration is insrc/driver/configs/manual.yaml.
Key Settings
| Setting | Default | Description |
|---|---|---|
host | 0.0.0.0 | Interface to bind to (all interfaces) |
port | 6789 | Port to listen on |
inference.use_cameras | ["camera_front_wide_120fov"] | Camera to display in pygame window |
log_level | INFO | Logging verbosity |
Custom Configuration
Override settings on the command line:Simulation Settings
Thelocal_external_driver deploy config includes settings optimized for interactive use:
10 Hz Control Rate
10 Hz Control Rate
Default: 2 Hz for batch evaluationManual driver: 10 Hz for smoother responseThis provides more responsive steering and acceleration.
1920x1080 Camera Resolution
1920x1080 Camera Resolution
Default: Lower resolutions for batch processingManual driver: Higher resolution for better visualizationProvides clearer camera feed in the pygame window.
Localhost Networking
Localhost Networking
Default: Container-only networkingManual driver:
use_localhost=True so containers can reach the external driverAllows runtime to connect to driver running outside docker.Customizing Simulation Parameters
Overrideruntime.default_scenario_parameters on the command line:
Troubleshooting
Pygame window not appearing
Pygame window not appearing
Cause: No display server or DISPLAY variable not setSolution:
- Verify you’re running on a machine with a GUI (not headless server)
- Check
echo $DISPLAYreturns a value (e.g.,:0) - For remote X11:
export DISPLAY=:0before running
Controls not responding
Controls not responding
Cause: Pygame window doesn’t have focusSolution:
- Click on the pygame window to give it focus
- Ensure no other application is capturing keyboard input
- Check driver logs for keyboard events being received
Simulator can't connect to driver
Simulator can't connect to driver
Cause: Network configuration or firewall blocking connectionSolution:
- Verify driver started successfully and printed “Listening on 0.0.0.0:6789”
- Check firewall allows connections on port 6789
- For remote driver, use
wizard.external_services.driverwith correct IP - Verify docker containers can reach host network (check
use_localhost=True)
Camera feed is black or frozen
Camera feed is black or frozen
Cause: Sensorsim not rendering or network issueSolution:
- Check
txt-logs/sensorsim-0.logfor rendering errors - Verify scene downloaded correctly to
data/nre-artifacts/all-usdzs/ - Check GPU memory availability
- Look for errors in docker-compose console
Advanced Usage
Recording Manual Drives
Manual drives are recorded like any other rollout:- ASL logs:
manual_run/rollouts/{scene_id}/{batch_uuid}/rollout.asl - Metrics:
manual_run/rollouts/{scene_id}/{batch_uuid}/metrics.parquet - Videos: Generated during evaluation if enabled
You can replay manual drives using ASL logs - see Data Pipeline for details.
Multi-Scene Manual Testing
Run multiple scenes sequentially:Custom Trajectory Generation
The manual driver generates trajectories based on:- Current speed: Set by W/S keys
- Steering angle: Set by A/D keys
- Arc trajectory: Constant-curvature path followed by MPC controller
src/driver/src/alpasim_driver/manual_control.py- Keyboard handlingsrc/driver/src/alpasim_driver/trajectory_planner.py- Trajectory math