Quick (actually very long) remainder how to setup a jetson nano
What you actually need as material
-
5V 4A (4000mA) switching power supply (Any powersuply will do as is 5V, 4A, 5.5mm OD and 2.1mm ID)
-
Micro SD (At least 32G)
-
Standard Computer Jumper Caps
-
A micro USB cable
You only need to put the kit together if you want you can follow the tutorials
-
Download the image in the nvida site not use the sdk manager, that is currently not working right know
-
Insert a 32GB+ SD card into the desktop machine
-
Using Etcher unzip and select the image downloaded before
-
Insert the configured SD card into the Jetson Nano module
-
Power on by plugging the powersuply to the jetson
-
Without a display plugged the jetson start in headless mode, you can connect to the jetson with the follow command this will guide you to install ubuntu and create the user and the wifi connection
screen /dev/ttyACM0 115200
-
Connect to the jetson through ssh
-
Open a terminal
-
In the terminal, type the following command to list available WiFi networks, and find the
ssid_name
of your network.sudo nmcli device wifi list
-
Connect to the selected WiFi network
It should be on the same network that you will be connect to jetson
sudo nmcli device wifi connect <ssid_name> password <password>
-
Note down the WiFi IP returned by the following command. We'll call this
jetson_ip_address
ip route get 1.2.3.4 | awk '{print $7}'
-
Turn off the power safe mode to avoid losing the wifi connection
sudo iw dev wlan0 set power_save off
-
Follow the 2 first steps
-
Create WPA2 Entreprise connexion
nmcli con add type wifi ifname wlan0 con-name <connexion-name> ssid <ssid_name> nmcli con edit id <connexion-name> set ipv4.method auto set 802-1x.eap peap set 802-1x.phase2-auth mschapv2 set 802-1x.identity <user_name> set 802-1x.password <password> set wifi-sec.key-mgmt wpa-eap save activate
-
Continue as step 3
-
Unplug the the Jetson Nano HDMI if you use a display or the micro usb if you use the headless mode
-
Open a new terminal in your main machine and connect to the jetson in ssh with the following command
ssh <user_name>@<jetson_ip_address>
-
Sign in with the password <user_password>
Right now we are using the version 2.31
-
Add a swapfile to jetson
git clone https://github.com/jetsonhacksnano/installSwapfile cd installSwapfile ./installSwapfile.sh cd ..
-
Add the ubuntu keyserver
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F42ED6FBAB17C654
-
Update the repo
sudo apt update
-
Install dependencies
sudo apt install -y wget git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev python3-dev cmake
-
Download librealsense
sudo wget https://github.com/IntelRealSense/librealsense/archive/v2.31.0.tar.gz -O librealsense.tar.gz
-
Untar librealsense
tar xvzf librealsense.tar.gz
-
Go to librealsense folder and create the build folder
cd librealsense-2.31.0 && mkdir build && cd build
-
Run cmake build
cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_BINDINGS:bool=true -DBUILD_WITH_CUDA:bool=true -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.0/bin/nvcc
-
Run Make with 4 cores
make -j4
-
Install all the tools and libs
sudo make install
-
Before using you need copy the udev rules for the realsense and restart udevadm
cd .. sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules && udevadm trigger
We install ros melodic and the dependencies direclty from the repo
-
Add ros source to the deb list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
-
Add the key to the key server
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
-
Update apt list
sudo apt-get update
-
Install ros desktop and rgbd launch
sudo apt-get install -y ros-melodic-desktop ros-melodic-rgbd-launch
-
Install and run rosdep
sudo apt-get install -y python-rosdep sudo rosdep init rosdep update
-
Add setup bash to bashrc and source bash rc
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc
-
Install dependencies for ros
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential python-catkin-tools -y
-
Install dependecies for python3
sudo apt-get -y install python3-pip python3-yaml sudo pip3 install rospkg catkin_pkg
The current master support the version 2.31 of realsence
-
Create the workspace for realsense ROS
mkdir -p ~/catkin_ws_rs/src cd ~/catkin_ws_rs catkin init cd src
-
Clone realsense ros and ddynamic reconfigure
git clone https://github.com/pal-robotics/ddynamic_reconfigure git clone https://github.com/IntelRealSense/realsense-ros.git
-
Checkout the branch 2.2.12 to go with our version and change CMakelist to works also with the 2.2.12 version
cd realsense-ros/ git checkout 2.2.12 sed -i 's/find_package(realsense2 2.25.0)/find_package(realsense2 2.28.0)/' realsense2_camera/CMakeLists.txt cd ../..
-
Use catkin to make the package
catkin config -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release catkin build
-
Add the workspace to the PATH and the .bashrc file
echo "source /home/jetson/catkin_ws_rs/devel/setup.bash --extend" >> ~/.bashrc source ~/.bashrc
-
Create the workspace: unneeded if you already have workspace
mkdir -p ~/catkin_ws_mavros/src cd ~/catkin_ws_mavros catkin init wstool init src
-
Install MAVLink
We can use the melodic reference for all ROS distros as it's not distro-specific and is up to date
--rosdistro melodic
this example use the masterrosinstall_generator --upstream-development mavlink | tee /tmp/mavros.rosinstall
-
Install MAVROS: get source (upstream - released)
Install latest source
rosinstall_generator --upstream-development mavros | tee -a /tmp/mavros.rosinstall
-
Create workspace & deps
wstool merge -t src /tmp/mavros.rosinstall wstool update -t src -j4 rosdep install --from-paths src --ignore-src -y
-
Install GeographicLib datasets:
sudo ./src/mavros/mavros/scripts/install_geographiclib_datasets.sh
-
Build source
catkin build
-
Add the workspace to the PATH and the .bashrc file
echo "source /home/jetson/catkin_ws_mavros/devel/setup.bash --extend" >> ~/.bashrc source ~/.bashrc
-
Set the rights to the ttyTHS in the udev rules
sudo sh -c 'echo "KERNEL==\"ttyTHS*\", MODE=\"0666\"" > /etc/udev/rules.d/55-jetsonserial.rules' systemctl stop nvgetty systemctl disable nvgetty udevadm trigger (or reboot)
Right now we are using the version 1.14
-
Installing dependencies
sudo apt-get install -y libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
-
Installing pip and python dependencies
sudo apt-get install -y python3-pip sudo pip3 install -U pip testresources setuptools sudo pip3 install -U numpy==1.16.1 future==0.17.1 mock==3.0.5 h5py==2.9.0 keras_preprocessing==1.0.5 keras_applications==1.0.8 gast==0.2.2 enum34 futures protobuf
-
Installing official tensorflow for nano, build by Nvidia
$ sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v43 tensorflow-gpu