FEI DonkeyCar(FEIcar) Installation on Jetson Nano
This tutorial guides you through installing our customized version of DonkeyCar on the Jetson Nano for the FEI JetRacer project. This setup enables autonomous driving capabilities using machine learning and computer vision.
Quick Start - Pre-configured Image (Recommended)
If you want to skip the entire installation process, we provide a pre-configured SD card image with everything already set up:
Download Link: FEI JetRacer Complete Image
What's Included in the Image
The pre-configured image contains:
- Ubuntu 18.04 with JetPack 4.5
- FEI DonkeyCar with mycar application pre-created
- OpenCV with CUDA and cuDNN support
- YOLOv4-tiny for object detection
- All dependencies and libraries pre-installed
- Ready-to-use configuration for JetRacer hardware
Flashing the Image to SD Card
-
Download the image (approximately 8GB compressed)
-
Extract the image if it's compressed
-
Flash to SD card using one of these tools:
Option A: Raspberry Pi Imager (Recommended)
- Download Raspberry Pi Imager
- Select "Use custom image" and choose the downloaded file
- Select your SD card (32GB or larger)
- Click "Write"
Option B: Balena Etcher
- Download Balena Etcher
- Select the image file
- Select your SD card
- Click "Flash"
Option C: Command Line (Linux/macOS)
# Find your SD card device (be careful!)
lsblk
# Flash the image (replace /dev/sdX with your SD card device)
sudo dd if=fei-jetracer-image.img of=/dev/sdX bs=4M status=progress -
Insert the SD card into your Jetson Nano and boot
First Boot Setup
After flashing and booting:
- The system will automatically resize the filesystem
- Default credentials:
- Username:
jetson - Password:
jetson
- Username:
- The DonkeyCar environment is ready at
~/mycar - Activate the virtual environment:
source ~/env/bin/activate
If you use this pre-configured image, you can skip the rest of this tutorial and the Object Detection setup too.
Manual Installation
If you prefer to install everything manually or want to understand the process, continue with the steps below.
Overview
DonkeyCar is an open-source platform for building and racing autonomous RC cars. Our version includes:
- Preparation for object detection with YOLOv4-tiny
- Improved web interface
Note: Default DonkeyCar is already installed by default if you use the configured image, so we skip some steps in this tutorial.
Step 1: Setup Virtual Environment
Create and activate a Python virtual environment to isolate the DonkeyCar installation:
pip3 install virtualenv
python3 -m virtualenv -p python3 env --system-site-packages
source env/bin/activate
Important: All subsequent DonkeyCar operations must be performed within this virtual environment. Remember to run
source env/bin/activateevery time you open a new terminal session.
Step 2: Install FEIcar
Clone and install our customized version of DonkeyCar:
git clone -b 4_5_1_FEI https://github.com/peter115342/FEIcar
cd donkeycar
pip install -e .[nano]
Step 3: Create Your Car Application
Create a new DonkeyCar application instance:
donkey createcar --path ~/mycar
This command creates a new directory ~/mycar with all the necessary files to run your autonomous car. In our FEIcar fork the camera is already pre-configured to work with our JetRacer kit.
Verification
Test your installation by running the DonkeyCar web interface:
cd ~/mycar
python manage.py drive
Open a web browser and navigate to http://<jetson-ip>:8887 to access the control interface.
Note: Object detection functionality will only be available after completing the Object Detection setup tutorial. The basic DonkeyCar interface will work without object detection, but advanced features like YOLO object detection require additional setup.
Troubleshooting
Virtual Environment Issues
If you encounter import errors, ensure you're in the virtual environment:
source env/bin/activate
Camera Not Detected
If the camera isn't working:
- Check camera connection
- Verify camera is enabled in Jetson settings
- Test camera with:
nvgstcapture-1.0
Memory Issues
If you encounter out-of-memory errors during installation:
- Increase swap space
- Close other applications
- Install packages one at a time
Permission Errors
For permission-related issues:
sudo chown -R $USER:$USER ~/mycar