Skip to content

NVIDIA Jetson TX2 Setup

Batuhan Yumurtaci edited this page Oct 10, 2022 · 1 revision

First time setup of NVIDIA Jetson TX2.

Git

If git is installed on the system run the following commands to configure your git account.

git config --global user.name "John Doe"

git config --global user.email johndoe@example.com

ssh-keygen Press enter till the ssh-key is generated.

cat /home/$USERNAME/.ssh/id_rsa.pub copy the output.

In your gitlab.lrz account > Preferences > SSH Keys > Paste > Add key

ROS

Installing ROS

JetsonHacks provides scripts to install desired ros version for arm architectures.

Jetpack 4.6 comes with ubuntu 18.04 LTS thus supporting ros-melodic.

git clone https://github.com/jetsonhacks/installROS.git

cd installROS/

./installROS.sh -p ros-melodic-desktop-full

source /opt/ros/kinetic/setup.bash

Installing catkin tools

sudo apt-get install python3-catkin-tools

mkdir -p catkin_ws/src/

cd catkin_ws/

catkin init

cd src/

catkin_create_pkg test_pkg std_msgs rospy roscpp

cd ..

catkin build

Intel Realsense

Intel Realsense-Viewer SDK

JetsonHacks provides scripts to install the official realsense-viewer SDK.

Visit the website to build the SDK from source and for more details.

git clone https://github.com/JetsonHacksNano/installLibrealsense

cd installLibrealsense

./installLibrealsense.sh

Start the application:

realsense-viewer

Connect the camera and turn on the required streaming methods.

#############################################################

Installation jetson devices link

git clone https://github.com/IntelRealSense/librealsense.git

./libuvc_installation.sh -DBUILD_WITH_CUDA=true

ROS

https://github.com/IntelRealSense/realsense-ros#installation-instructions

sudo apt-get install ros-melodic-realsense2-camera

sudo apt-get install ros-melodic-rgbd-launch

cd ~/catkin_ws/src/

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

source ~/.bashrc

Launch the camera node:

roslaunch realsense2_camera rs_camera.launch

Docker

https://forums.developer.nvidia.com/t/docker-isnt-working-after-apt-upgrade/195213/7

https://github.com/dusty-nv/jetson-containers

check python version of ros: apt list --installed | grep rospkg

Serial Communication

Change the settings of the UART GPIO to communicate with the flight controller via MAVLink

https://connecttech.com/resource-center/kdb347-reassigning-disable-serial-debug-connect-tech-tx1-carriers/

Hacking the board

Installing Ubuntu 20.04 LTS with Release Update

The legend link

Click to expand the system information ![Screenshot_from_2022-03-11_20-28-36](uploads/8458c9d5f72d0ffafebb59bf2451487c/Screenshot_from_2022-03-11_20-28-36.png)

Building Python 3.6.9 from Source on Jetson

Building python from source on Ubuntu 20.04 LTS Focal Fossa tutorial link

Get the essential packages:

sudo apt-get update

sudo apt-get install -y build-essential checkinstall

sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Get the Python source code:

cd /usr/src

sudo wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz

sudo tar xzf Python-3.6.9.tgz

Installation:

cd Python-3.6.9

sudo ./configure --enable-optimizations

sudo make altinstall

Verify installation:

python3.6 --version

Get the location of Python 3.6 binaries:

which python3.6

/usr/local/bin/python3.6

Add Python 3.6.9 alongside Python 3.8.10:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.6 1

List the possible python3 versions:

sudo update-alternatives --list python3

Configure the python3 version:

sudo update-alternatives --config python3

Verify Replacement:

python3

Python 3.6.9 (default, Mar 14 2022, 09:15:30) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Install pip3:

cd ~/

wget https://bootstrap.pypa.io/pip/3.6/get-pip.py

sudo python3.6 get-pip.py

pip 21.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

Build memory issue

c++: internal compiler error: Segmentation fault (program cc1plus)

Increase the limits from 1024 to 10240:

sudo nano /etc/security/limits.conf

nvidia hard stack 10240
nvidia soft stack 10240
ubuntu hard stack 10240
ubuntu soft stack 10240
root hard stack 10240
root soft stack 10240

Add the limits for every session:

sudo nano /etc/pam.d/common-session

Add session required pam_limits.so

Sign out and sign back in

Build the workspace using the following command:

catkin b -j 4 -DCMAKE_CXX_FLAGS="--param ggc-min-expand=20"