Skip to main content
The Donkeycar framework provides a command-line tool called donkey to help you manage your autonomous vehicle projects. This CLI tool offers commands for creating new car projects, calibrating hardware, training models, and analyzing data.

Installation

The donkey command is automatically available after installing Donkeycar:
pip install donkeycar[pc]

Usage

The general syntax for the donkey command is:
donkey <command> [options]

Available Commands

The Donkeycar CLI provides the following commands:
CommandDescription
createcarCreate a new car application with folder structure and templates
findcarFind your car’s IP address on the network
calibrateCalibrate steering servo and throttle ESC
trainTrain a neural network model from recorded data
makemovieCreate a video from recorded tub data
tubplotPlot model predictions against actual data
tubhistGenerate histograms of tub data
uiLaunch the graphical user interface
createjsCreate joystick/controller configuration
cnnactivationsVisualize CNN layer activations
modelsDisplay model database information
updateUpdate car templates to latest version

Getting Help

To see the list of available commands:
donkey
To get help for a specific command:
donkey <command> --help

Common Workflows

Setting Up a New Car

  1. Create a new car project:
    donkey createcar --path ~/mycar
    
  2. Calibrate the servos:
    cd ~/mycar
    donkey calibrate --channel 0
    
  3. Drive and collect data, then train a model:
    donkey train --tub ./data --model ./models/pilot.h5
    

Analyzing Data

  1. View data distribution:
    donkey tubhist --tub ./data/tub_1_20-01-01
    
  2. Plot model predictions:
    donkey tubplot --tub ./data/tub_1_20-01-01 --model ./models/pilot.h5
    
  3. Create a video:
    donkey makemovie --tub ./data/tub_1_20-01-01 --out drive_video.mp4
    

Configuration

Many commands accept a --config option to specify a custom configuration file:
donkey train --config ./custom_config.py --tub ./data
The default configuration file is config.py in the current directory.

Next Steps

Build docs developers (and LLMs) love