Jetson

Overview

Bought in 2022.

The NVIDIA Jetson TX2i is a compact portable computer similar to a Raspberry Pi, with additional computational hardware suited for machine learning (e.g. CUDA). IO is provided by the attached Connect Tech Quasar Carrier board.

The Jetson is used to run the Autonomy airside system.

NVIDIA Jetson TX2i product webpage: https://developer.nvidia.com/embedded/jetson-tx2i

Connect Tech Quasar Carrier product webpage: Quasar Carrier for NVIDIA® Jetson™ TX2/TX2i - Connect Tech Inc.

Note: Orbitty Carrier for NVIDIA® Jetson™ TX2/TX2i - Connect Tech Inc. may be sufficient for the current use case (cheaper).

Decision matrix for purchase: Jetson purchase decision matrix

Software

The operating system running on the Jetson is Jetpack 4.6.3 (Linux For Tegra (L4T) 32.7.3), an Ubuntu-based Linux distribution provided by NVIDIA.

Usage

Manual

Connect IO devices:

  • Peripherals: Mouse, keyboard, monitor

  • External storage: MicroSD card, USB stick (optional)

  • Networking (optional): Ethernet, USB wireless

Do not connect the sensors: Camera.

Connect the carrier board to power, which can be supplied by the provided wall adapter, a 3S battery, or directly by a power supply.

  • See Electrical section for input voltage.

Log into the Jetson.

  • The login credentials can be found in the Discord server, in #auto-jetson .

Now connect the sensors.

Open the terminal and make sure the camera is connected:

v4l2-ctl --list-devices # Camera is KS2A543

Update the repository and activate the virtual environment:

cd ~/computer-vision-python # Navigate to the repository git checkout main # Correct branch git pull # Get latest update git submodule update --remote # Update submodules source venv/bin/activate # Activate the environment

If there are any issues with git pull :

  • git stash # Saves local changes git pull git stash pop # Restores local changes
  • If you don’t care about local changes, git reset --hard origin/main overwrites everything

    • This is not reversible! The Jetson is a production environment, so there shouldn’t be anything substantial on it to keep.

Download the ML model file:

Open main_2023.py with a text editor:

  1. Change the model path to the location the ML model file

  2. Change the logging prefix to the SD card:

    1. VIDEO_INPUT_SAVE_PREFIX = /media/warg/sd-jetson/log_image

    2. DETECT_TARGET_SAVE_PREFIX = /media/warg/sd-jetson/log_comp

The airside system is ready to run:

Ctrl+c to stop (may require multiple attempts).

Automatic

Setup:

Airside:

  1. Disconnect the sensors

    1. If sensors are not connected, the airside system fails to run automatically, but this is intended

  2. Follow the instructions in the Manual section above

    1. You can also check that the airside system is working

  3. Disconnect the carrier board from power

  4. Connect the sensors

  5. Connect the carrier board to power

    1. The airside system is automatically run on startup

Done!

Log Access

Logs are written to the microSD card with a Unix timestamp.

  • The microSD card uses the FAT32 file system.

Connect the microSD card to another computer.

Move or copy the files of interest.

Permanently delete all files from the microSD card so that there is space for the next run.

Setup

The host is an existing computer that already has an operating system running on it (e.g. WARG desktop, WARG laptop, your laptop).

The target is the computer that is to be flashed (i.e. programmed with the provided code, which can be an operating system) (e.g. Jetson, phone, board, Raspberry Pi).

Flash Target Operating System from Host

The host is the WARG desktop, and the target is the Jetson.

The host is required to be running Ubuntu 18.04.

Download and install the NVIDIA SDK manager: NVIDIA SDK Manager

  • Login with the NVIDIA developer credentials found in #auto-jetson

    • The Autonomy Leads are required to open a verification link sent to the WARG email

  • If the SDK manager and Jetpack components are already installed, do NOT uninstall them. Instead, delete the Jetpack directory. The SDK manager will recreate the directory.

    • If you do uninstall, you will encounter issues reinstalling. The only current solution is to wipe and reinstall the OS on the WARG desktop.

The Jetson has 32GB of internal memory, on which the operating system will be installed. Make sure there is no microSD card plugged in the carrier board.

Follow the steps here: kdb373: CTI-L4T Board Support Package Installation for NVIDIA JetPack with Connect Tech Jetson™ Carriers - Connect Tech Inc.

  1. Login with the NVIDIA developer credentials provided by the Autonomy Leads

  2. Target Hardware: Jetson TX2 modules

  3. Target Operating System: JetPack 4.6.3 (do not use any other version)

  4. Continue

  5. Checkboxes:

    1. Jetson OS: Checked

    2. Jetson SDK Components: Unchecked

    3. Terms and Conditions: Checked

    4. Download now. Install later: Unchecked

  6. This will show up sometime in the 20-30 minutes it takes to install everything

  7. Finish and exit

  8. cd nvidia/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_TX2_TARGETS/Linux_for_Tegra/

  9. Board support package: NVIDIA Jetson TX2i→Jetpack 4.6.3 - L4T r32.7.3

    1. Do not forget the i

    2. Alternative: Download it manually and copy it to the path in step 8

  10. Apply board support package to Jetpack:

  11. Recovery mode can be found on page 28 the Quasar carrier board manual: Quasar Carrier for NVIDIA® Jetson™ TX2/TX2i - Connect Tech Inc.

    1. Make sure to plug in the microUSB cable to the carrier board BEFORE powering the Jetson

  12. CTI flash:

    1. sudo ./cti-flash.sh

    2. Quasar→Base→TX2i

Install Components

  1. Connect peripherals (e.g. mouse, keyboard, monitor)

  2. Press the reset button or power cycle the Jetson

  3. Profile:

    1. Name and username: warg

    2. Computer name: warg-jetson

      1. Do not use warg-desktop as that name is reserved for the WARG desktop

    3. Password: Make sure to record this somewhere (e.g. Discord server, WARG password manager)

    4. Automatic login: Checked

  4. Set the power mode to MAXN (mode 0)

  5. You will be logged in, DO NOT APPLY ANY SOFTWARE UPDATES

  6. Restart the Jetson

Follow the steps here: Installing Jetpack SDK Components alongside the CTI-L4T BSP

  • Step 4:

    • Ethernet (recommended): On the Jetson, enter ip a . The IP address is eth0→inet

    • USB: Connect microUSB cable. The IP address field populates itself

  • Use the Jetson username and password you set before

Python and Repository

Install Python 3.8:

Clone and create virtual environment:

Download required modules:

Install required modules:

  • Where [local path to] is the path to the files (e.g. ~/Downloads )

Install required packages to run PyTorch:

Run the following commands to confirm PyTorch is working:

The expected output is:

Camera

Plug in the camera, then install and run the Video4Linux tools to confirm it’s working:

Automatic Run

If automatic login is not enabled, enable it:

  1. System Settings

  2. Users

  3. Click Unlock in the top right and enter the password (found in #auto-jetson )

  4. Toggle Automatic Login to On

Grant execution privileges in the terminal:

Add the script to automatic startup:

  1. Open the start menu, search for Startup Applications, and open it

  2. Click Add

    1. Name: Airside System

    2. Command: Browse to the run.sh file

      1. Should be: /home/warg/computer-vision-python/run.sh

    3. Comment: [Leave empty]

  3. Click Add

  4. Make sure the checkmark is selected

  5. Close

Done!

Edit rc.local if stuck at startup

rc.local is not currently used.

Edit rc.local:

  1. Connect the Jetson to the WARG desktop via ethernet cable

  2. ssh warg@fe80::1%usb0 or ssh warg@192.168.55.1

    1. 192.168.55.1 is the default private IP address of all Jetsons

  3. Edit rc.local and revert changes: sudo nano /etc/rc.local

Optional: Mounting the Jetson to Linux host to access documentation:

  1. Connect the Jetson to the WARG desktop via microUSB cable

  2. List all connected device blocks: lsblk

  3. Note the device name (e.g. /media/warg/L4T-README )

  4. Create a new mount directory: sudo mkdir /mnt/usb

  5. Mount the old address to the new address: sudo mount /media/warg/L4T-README /mnt/usb

  6. The readme contains serial debugging and ssh instructions

  7. Unmount: sudo umount /media/warg/L4T-README

Hardware

Jetson to Pixhawk Harness

Electrical

Input voltage: 9-14VDC

The Jetson has several power modes:

  • MAX-N (mode 0): Performance, up to 40W

  • MAX-Q (mode 1): Power saver, up to 10W

  • MAX-P (mode 2-4): Balanced, up to 20W

TODO: Test this

Carrier board’s estimated power: 0.42-0.71A at 12V (5.04-8.52W )

Mechanical

Weight

Jetson with cable: 168 grams

Physical Dimensions

Red is corrected values as measured by hand. Green is the power cables.

A 3D STEP Model is also available on the product page.

Page 31 of the carrier board manual contains screw specifics (note TX2i, not TX1):

  • Carrier board side: M3.0X0.5, 5.0mm long, has washer between screw head and board surface

    • Standoff: Hex, 5mm long

    • Jetson side: M3.0X0.5, 14.0mm long (12.0mm measured TODO remeasure please)

      • Screw head protrudes ~2.4mm , but may be replaced for mounting

Ports and Wires

There are 2 USB ports and 1 HDMI port that are used. Additionally, 2 power cables perpendicular to the computer ports.

Operating Constraints

At minimum, enough airflow for passive cooling.

Reference Images