Follow the instructions at https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write to install the operating system to the Jetson Nano. Make sure to finish the installation process, e.g. setting the timezone and creating a user account.
Upgrade the system and automatically remove unnecessary packages
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -yBefore starting the installation process, please ensure that git and python3-pip are installed.
sudo apt install nano git python3-pipBecause the standard Jetson Nano operating system comes with a lot of tools which won't be used, we can save valuable space and resources by removing them.
sudo apt purge snapd lx* nautilus* openbox* printer* rhythmbox* gnome* lightdm* xubuntu* xscreensaver* xfce* lxde* x2go* word* thunderbird libreoffice* chromium-* vim* docker* libvisionworks* ubuntu-wallpapers-bionic light-themes adwaita-icon-theme -y && sudo apt autoremove -yThis command will strip the operating system of most unnecessary packages. Please read the command before executing to avoid removing necessary packages.
Clone the project from the GitHub repository.
git clone https://github.com/sieuwe1/Autonomous-Ai-drone-scripts.gitStart by installing the required packages for the installation process.
sudo apt install cmake libpython3-dev python3-numpyExecute the following commands in sequence to install Jetson Inference.
During the installation, make sure to deselect all models and finally select the
SSD MobileNet V2model. After the download has completed, please also install PyTorch.
git clone --recursive https://github.com/dusty-nv/jetson-inference
cd jetson-inference
mkdir build
cd build
cmake ../
make -j$(nproc)
sudo make install
sudo ldconfigSource: https://github.com/dusty-nv/jetson-inference/blob/master/docs/building-repo-2.md
python3 -m pip install --upgrade pip
python3 -m pip install scikit-build cmake opencv-python numpy dronekit pyserial keyboard simple-pidFor viewing sensors, media and other things with a graphical user interface, we can use X11 forwarding to forward the interfaces over SSH.
Enable X11 forwarding in the sshd configuration file.
sudo nano /etc/ssh/sshd_configLook for a parameter called X11Forwarding, ensure that the value is set to yes. It should look like this.
X11Forwarding yes
To connect to the Jetson Nano with X11 support, use the following command:
ssh -X -Y USERNAME@IPA common use case for X11 within the drone project is to watch back debugging videos. To review debugging videos from the drone via X11, you can use the mplayer package, which is a lightweight media player.
Install mplayer
sudo apt install mplayerExample of mplayer usage
mplayer video.mp4Clone the simulator from ArduPilot from the GitHub repository.
git clone https://github.com/ArduPilot/ardupilot --recursive
cd ardupilotSource: https://ardupilot.org/dev/docs/building-setup-linux.html#building-setup-linux
Before executing the prerequisite installation script from ArduPilot, please install some additional packages.
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev python3-setuptools python3-dev python3 libportmidi-devAfter that, install all prerequisites using the tool from ArduPilot by executing the following command:
Tools/environment_install/install-prereqs-ubuntu.sh -yReload the path (log-out and log-in to make permanent).
. ~/.profileBefore building, ensure that the project is configured.
./waf configureAfter the project is configured, build the project.
./waf clean
./waf buildEnsure that the current directory is the scripts directory.
cd Tools/scriptsStart the simulator for a ArduCopter
sim_vehicle.py -v ArduCopter --map --consoleFinish by removing all unused packages.
sudo apt autoremove -y