Jetson
- 1 Overview
- 2 Software
- 2.1 Usage
- 2.1.1 Manual
- 2.1.2 Automatic
- 2.1.3 Log Access
- 2.2 Setup
- 2.2.1 Flash Target Operating System from Host
- 2.2.2 Install Components
- 2.2.3 Python and Repository
- 2.2.4 Camera
- 2.2.5 Automatic Run
- 2.3 Edit rc.local if stuck at startup
- 2.1 Usage
- 3 Hardware
- 3.1 Jetson to Pixhawk Harness
- 3.2 Electrical
- 3.3 Mechanical
- 3.3.1 Weight
- 3.3.2 Physical Dimensions
- 3.3.3 Ports and Wires
- 3.3.4 Operating Constraints
- 3.3.5 Reference Images
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: Extend AI Computing with the Jetson TX2i
No product ID
NVIDIA Jetson TX2 Series Module Data Sheet (not NX): http://developer.nvidia.com/embedded/dlc/jetson-tx2-series-modules-data-sheet
Jetson Download Center: Jetson Download Center
Power modes: generic-no-api-public_r2
Connect Tech Quasar Carrier product webpage: Quasar Carrier for NVIDIA® Jetson™ TX2/TX2i - Connect Tech Inc.
ASG016
Datasheet: https://connecttech.com/ftp/pdf/ASG016_Quasar.pdf
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 everythingThis 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:
Use small or nano: https://uofwaterloo-my.sharepoint.com/:f:/r/personal/uwarg_uwaterloo_ca/Documents/Subteam%20Folders/Autonomy/2023%20Landing%20Pad%20Models
If small causes performance issues, use nano
Open main_2023.py with a text editor:
Change the model path to the location the ML model file
Change the logging prefix to the SD card:
VIDEO_INPUT_SAVE_PREFIX = /media/warg/sd-jetson/log_image
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:
Disconnect the sensors
If sensors are not connected, the airside system fails to run automatically, but this is intended
Follow the instructions in the Manual section above
You can also check that the airside system is working
Disconnect the carrier board from power
Connect the sensors
Connect the carrier board to power
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.
Login with the NVIDIA developer credentials provided by the Autonomy Leads
Target Hardware: Jetson TX2 modules
Target Operating System: JetPack 4.6.3 (do not use any other version)
Continue
Checkboxes:
Jetson OS: Checked
Jetson SDK Components: Unchecked
Terms and Conditions: Checked
Download now. Install later: Unchecked
This will show up sometime in the 20-30 minutes it takes to install everything
Finish and exit
cd nvidia/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_TX2_TARGETS/Linux_for_Tegra/
Board support package: NVIDIA Jetson TX2i→Jetpack 4.6.3 - L4T r32.7.3
Do not forget the i
Alternative: Download it manually and copy it to the path in step 8
Apply board support package to Jetpack:
Recovery mode can be found on page 28 the Quasar carrier board manual: Quasar Carrier for NVIDIA® Jetson™ TX2/TX2i - Connect Tech Inc.
Make sure to plug in the microUSB cable to the carrier board BEFORE powering the Jetson
CTI flash:
sudo ./cti-flash.sh
Quasar→Base→TX2i
Install Components
Connect peripherals (e.g. mouse, keyboard, monitor)
Press the reset button or power cycle the Jetson
Profile:
Name and username: warg
Computer name: warg-jetson
Do not use warg-desktop as that name is reserved for the WARG desktop
Password: Make sure to record this somewhere (e.g. Discord server, WARG password manager)
Automatic login: Checked
Set the power mode to MAXN (mode 0)
You will be logged in, DO NOT APPLY ANY SOFTWARE UPDATES
Restart the Jetson
Follow the steps here: https://connecttech.com/resource-center/kdb374/
Step 4:
Ethernet (recommended): On the Jetson, enter
ip a
. The IP address is eth0→inetUSB: 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:
PyTorch:
Download the build by WARG
Pytorch v1.13.1 (the file name tagging screwed up so you will see 1.13.0+git): https://uofwaterloo-my.sharepoint.com/:f:/r/personal/uwarg_uwaterloo_ca/Documents/Subteam%20Folders/Autonomy/Jetson%20Pytorch
Torchvision:
Do not follow the instructions. Instead, scroll down to Torchvision 0.14.0 and open the Google Drive link to download
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:
System Settings
Users
Click Unlock in the top right and enter the password (found in #auto-jetson )
Toggle Automatic Login to On
Grant execution privileges in the terminal:
Add the script to automatic startup:
Open the start menu, search for Startup Applications, and open it
Click Add
Name: Airside System
Command: Browse to the run.sh file
Should be:
/home/warg/computer-vision-python/run.sh
Comment: [Leave empty]
Click Add
Make sure the checkmark is selected
Close
Done!
Edit rc.local if stuck at startup
rc.local is not currently used.
Edit rc.local:
Connect the Jetson to the WARG desktop via ethernet cable
ssh warg@fe80::1%usb0
orssh warg@192.168.55.1
192.168.55.1 is the default private IP address of all Jetsons
Edit rc.local and revert changes:
sudo nano /etc/rc.local
Optional: Mounting the Jetson to Linux host to access documentation:
Connect the Jetson to the WARG desktop via microUSB cable
List all connected device blocks:
lsblk
Note the device name (e.g.
/media/warg/L4T-README
)Create a new mount directory:
sudo mkdir /mnt/usb
Mount the old address to the new address:
sudo mount /media/warg/L4T-README /mnt/usb
The readme contains serial debugging and ssh instructions
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.