Overview
Once your car is assembled and calibrated, you’re ready to drive! Donkeycar provides a web interface and optional joystick control for driving your car manually and collecting training data for autonomous operation.Starting Your Car
Basic Drive Command
With a Trained Model
With Joystick
myconfig.py:
Web Interface
Accessing the Interface
Open your browser to:http://donkeypi.local:8887http://raspberrypi.local:8887- Or use IP address:
http://192.168.1.100:8887
Web Interface Features
Live camera feed- Shows real-time view from your car’s camera
- Updates as you drive
- Steering: Left/right control (-1.0 to 1.0)
- Throttle: Forward/reverse control (-1.0 to 1.0)
- Switch between User, Local Angle, and Local (autopilot) modes
- Shows when data is being saved
- Displays number of recorded frames
- Current steering/throttle values
- FPS (frames per second)
- Model information (when using autopilot)
Driving with Web Interface
Keyboard Controls
When focused on the web interface: Steering:A/Left Arrow: Steer leftD/Right Arrow: Steer right
W/Up Arrow: ForwardS/Down Arrow: Reverse/BrakeSpace: Quick stop
R: Toggle recording
1: User mode2: Local Angle mode3: Local mode (full autopilot)
Driving Modes
Donkeycar has three primary driving modes:User Mode
What it is: Full manual control Who’s in control:- Steering: Human
- Throttle: Human
- Collecting training data
- Testing car setup
- Learning the track
Local Angle Mode
What it is: AI steering, human throttle Who’s in control:- Steering: AI/Autopilot
- Throttle: Human
- Testing steering model safely
- Learning how the AI steers
- Maintaining speed control during testing
- You control the speed
- Easier to stop if AI makes mistakes
- Good for initial autopilot testing
Local Mode (Full Autopilot)
What it is: Full autonomous control Who’s in control:- Steering: AI/Autopilot
- Throttle: AI/Autopilot
- After successful Local Angle testing
- Racing
- Demonstrating autonomous driving
Mode Comparison
| Mode | Steering | Throttle | Use Case |
|---|---|---|---|
| User | Human | Human | Training data collection |
| Local Angle | AI | Human | Test steering safely |
| Local | AI | AI | Full autonomous driving |
Recording Training Data
Auto-Record on Throttle
Most common setup - automatically records when you’re moving:- Recording starts automatically when throttle > 0
- Recording stops when throttle returns to 0
- Prevents recording while stationary
Manual Recording
Control recording explicitly:- Web interface: Recording switch
- Keyboard:
Rkey - Joystick: Assigned button
Recording During AI
Record while autopilot is driving (use with caution):Tub Management
Auto-create new tubs:What Gets Recorded
Each frame captures:- Camera image (
cam/image_array) - Steering angle (
user/angle) - range: -1.0 to 1.0 - Throttle value (
user/throttle) - range: -1.0 to 1.0 - Drive mode (
user/mode) - “user”, “local_angle”, “local” - Timestamp
- Optional: IMU data, LIDAR data, speed, behaviors
Joystick Control
Supported Controllers
Donkeycar supports many game controllers:- PlayStation 3 (PS3)
- PlayStation 4 (PS4)
- Xbox One/360
- Nintendo Switch Pro
- Logitech F710
- Custom controllers (via
donkey createjs)
Enabling Joystick
Xbox Controller Mapping
Driving:- Left Stick: Steering
- Right Trigger: Forward throttle
- Left Trigger: Reverse throttle
- A button: User mode
- B button: Local Angle mode
- X button: Local (autopilot) mode
- Y button: Toggle recording
- RB (Right Bumper): Increase max throttle
- LB (Left Bumper): Decrease max throttle
PS4 Controller Mapping
Driving:- Left Stick: Steering
- R2: Forward throttle
- L2: Reverse throttle
- Cross (X): User mode
- Circle: Local Angle mode
- Square: Local mode
- Triangle: Toggle recording
- R1: Increase max throttle
- L1: Decrease max throttle
Joystick Configuration
Driving Tips for Good Training Data
Track/Environment
- Consistent lighting: Avoid shadows and changing light
- Clear boundaries: Well-defined edges (tape, walls, etc.)
- Simple at first: Start with straight paths, add complexity later
- Repeatable: Same track for all training laps
Driving Technique
Smooth inputs:- Avoid jerky steering corrections
- Gradual throttle changes
- Consistent speed throughout track
- Stay in middle of track/path
- Consistent positioning
- Recovery when needed
- 5-10 laps minimum
- Both directions if possible
- Variety of speeds (if training for different speeds)
Data Quality
Good training data:- Smooth, centered driving
- Consistent speed
- Clear, well-lit images
- 1000-3000 frames minimum
- Erratic steering
- Off-track excursions
- Stopped/stationary frames
- Blurry or dark images
Checking Your Data
View Recorded Images
0_cam_image_array_.jpg, 1_cam_image_array_.jpg, etc.
Tub Statistics
View tub information:Make a Movie
Create a video from your tub:Safety Guidelines
Before Driving
- Car is properly calibrated
- Emergency stop is accessible (switch to User mode)
- Clear area with no obstacles
- Battery charged
- Camera view is clear
During Driving
- Start at low throttle (30-50%)
- Keep hand near controller for quick stop
- Watch for unexpected behavior
- Stop if car acts erratically
- Avoid driving near people or pets
Autopilot Testing
- Test in large, clear area first
- Start with Local Angle mode
- Be ready to take over instantly
- Gradually increase trust in AI
- Never use untested models in competitions
Throttle Control
Limiting Speed
User mode (manual driving):Launch Control
Boost throttle at start of autonomous mode (useful for racing):Troubleshooting
Web interface won’t load
Check:- Pi is powered on and booted
- Connected to same network as Pi
- Correct hostname or IP address
- Port 8887 is not blocked by firewall
Camera feed not showing
Check:- Camera is connected properly (CSI or USB)
- Camera is enabled:
sudo raspi-config→ Interface Options → Camera - Correct
CAMERA_TYPEin myconfig.py
Car doesn’t respond to controls
Check:- Motors/servos are powered (check battery)
- Calibration values are set in myconfig.py
- Correct
DRIVE_TRAIN_TYPE - PCA9685 is connected (if using)
Recording not working
Check:- Recording toggle is enabled in web UI
- Throttle > 0 (if AUTO_RECORD_ON_THROTTLE=True)
- Sufficient disk space:
df -h - Write permissions in data/ directory
Steering/throttle reversed
Fix in myconfig.py:Joystick not detected
Check connection:Performance Tuning
Increase Frame Rate
- Higher CPU usage
- More frames for AI to process
- Better for fast-moving cars
Reduce Latency
Show Performance Info
Next Steps
Use your collected data to train an autopilot model.
