Skip to content

Setting up the Jetson

Ashwin Gupta edited this page Oct 27, 2022 · 24 revisions

Networking Setup

Please refer to the following: https://github.com/umrover/mrover-ros/wiki/Setting-up-static-IPs

**Deprecated: ** To set up networking on the Jetson, run source scripts/networking_setup_jetson on the Jetson.

To set up networking on the base station, run source scripts/networking_setup_basestation on the base station.

This will set up the environment variables needed for the ROS nodes to connect.

The IP of the Jetson should be set to 10.0.0.2 by default.

The IP of the base station should be manually set to include both 10.0.0.7/8 and 10.1.0.7/8. The base station needs 10.0.0.7/8 to be on the same network as the Jetson. The base station also needs 10.1.0.7/8 to be on the same network as the radios we use (which are 10.1.0.{3/4/5/6}).

To add an IP, one can run sudo ip address {add/del} {insert_ip} dev {insert_ethernet_interface}. One can find the ethernet interface by running ip addr. It is recommended to add 10.0.0.7/8 before adding 10.1.0.7/8.

For example, one might run sudo ip address add 10.0.0.7/8 dev enp44s0.

USB Dev Rules

Our system's custom usb dev rules are located in roles/jetson_service/files/99-usb-serial.rules. To add a new one plug in your usb device and type:

sudo lsusb -v | grep 'idVendor\|idProduct\|iProduct\|iSerial'

Find your device and it's idVendor, idProduct, iProduct and iSerial numbers/tags (it is ok if your device doesn't have all that information). Go into the /etc/udev/rules.d/99-usb-serial.rules file on the Jetson and add a new line in this format:

SUBSYSTEM=="< your subsystem, normally tty for sub >", ATTRS{idVendor}=="< idVendor >", ATTRS{idProduct}=="< idProduct >", ATTRS{iProduct}=="< iProduct >", ATTRS{serial}=="< serial >", SYMLINK+="< name >"

The name can be anything. Save the file and reboot, you now should be able to access your serial device as /dev/<name>.

This is useful since we use USB Dev Rules to set up /dev/gps and /dev/imu.

Here are some useful links:

Camera Setup

Do the following: Clone jetson-utils on the Jetson in home directory.

We use Python 3.8, so one should change the CMakeLists.txt insdie the jetson-utils/python/ folder and delete the if statement to force 3.8 to be used.

Then cd into the jetson-utils folder, then make a build folder, cd into that and run cmake .. then make.

git clone https://github.com/dusty-nv/jetson-utils
cd jetson-utils
mkdir build
cd build
cmake ..
make

Download NVIDIA SDKManager on Host Computer

Download the proper version for your system here: https://developer.nvidia.com/nvidia-sdk-manager

You may have to make a NVIDIA developer account prior to this

I used Ubuntu 20.04.5 LTS so I installed the .deb version, for that run sudo apt install ./sdkmanager_*.deb

Make sure tlp is not installed on your system!!! For some reason it breaks the flashing.

Boot the Jetson in recovery mode

First power off the Jetson completely. Use a jumper cable to connect pins 9 and 10 (see this video for help: https://youtu.be/s1QDsa6SzuQ). There should be two free pins on the right after hooking it up.

Plug in power to boot up.

Connect to the Micro USB port on the Jetson with the other side of the cable going into your host computer.

Run sdkmanager in terminal to open the flasher.

Install Jetpack

Install the latest version of Jetpack. As of writing this it was 5.0.2

Building OpenCV for the Jetson

The default OpenCV that ships with the Jetson does not have the libopencv-contrib-dev package installable for some reason. So I cloned https://salsa.debian.org/science-team/opencv and ran debuild -uc -us -b in the root directory to generate .deb pacakges. I then transfered them to the Jetson and installed them.

Clone this wiki locally