Posted

OS image

Raspi OS - Debian GNU/LINUX (Raspbian - bookworm)
Linux raspberry pi 6.12.25+rpi-v8 Debian aarch64

Setup Camera

config.txt
{
camera-auto-detect=0
dtoverlay=imx708
}
sudo apt update && sudo apt upgrade -y
sudo apt install [libcamera-dev libcamera-tools] wireplumber pipewire rpicam-apps libv4l-dev v4l-utils ffmpeg [raspi-config]
sudo raspi-config    
{
  Interface -> Legacy camera -> Enable #for Ubuntu only
  Interface -> SPI -> Enable
  Interface -> I2C -> Enable
}
sudo reboot now

Testing

cam -l
ls -lah /dev/video*
v4l2-ctl --list-devices
v4l2-ctl --list-formats
rpicam-vid -t 10s -o ./test.h264
ffmpeg -i test.h264 -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 test.ogv
while true; do rpicam-vid --nopreview -t 1s --width  640 --height 480 -o - | ffmpeg -y -i - -s 640x480 -c:v libtheora -q:v 5 ./_test.ogv;mv ./_test.ogv ./test.ogv; sleep 0.01; done

Setup Python & OpenCV

sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/_EXTERNALLY-MANAGED
python --version 
sudo apt update && sudo apt install libopencv-dev python3-opencv -y
sudo apt install -y python3-picamera2
pip install pytz imutils schedule screeninfo
python
{
  import cv2
  print(cv2.__version__)
}

Refs:

  1. https://www.waveshare.com/wiki/Raspberry_Pi_Camera_Module_3
  2. https://chuckmails.medium.com/enable-pi-camera-with-raspberry-pi4-ubuntu-20-10-327208312f6e
  3. https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/12MP-IMX708/#products-list
  4. https://qengineering.eu/install-opencv-on-raspberry-64-os.html

Author

Posted

HOST OS

Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Linux x86_64 GNU/Linux

Setup Nvidia SDK Manager

  1. https://developer.nvidia.com/sdk-manager#installation_get_started
sudo apt update
sudo apt install qemu-user-static sshpass abootimg nfs-kernel-server libxml2-utils binutils -y
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt list --upgradable
sudo apt upgrade
sudo apt -y install sdkmanager
sdkmanager

Upgrade JetPack 6.2

  1. https://wiki.seeedstudio.com/reComputer_J4012_Flash_Jetpack/
  2. https://collabnix.com/how-to-upgrade-jetpack-5-x-to-6-x-on-nvidia-jetson-orin-nano-super/
lsusb 
sudo vi /boot/extlinux/extlinux.conf
{
  ... apparmor=1 security=apparmorcv2.cuda.getCudaEnabledDeviceCount()
}
snap download snapd --revision=24724
sudo snap ack snapd_24724.assert
sudo snap install snapd_24724.snap
sudo snap refresh --hold snapd
sudo apt install firefox
sudo apt install chromium-browser

Setup python

  1. https://developer.nvidia.com/embedded/downloads
  2. https://github.com/azimjaan21/jetpack-6.1-pytorch-torchvision-
  3. https://pytorch.org/audio/2.1.0/build.jetson.html
  4. https://docs.nvidia.com/deeplearning/frameworks/install-pytorch-jetson-platform/index.html
  5. https://docs.nvidia.com/jetson/jetpack/install-setup/index.html
  6. https://pypi.jetson-ai-lab.dev/jp6/cu126
cat /etc/nv_tegra_release
sudo apt-cache show nvidia-jetpack
sudo apt install nvidia-jetpack nvidia-jetpack-dev
sudo apt install python3-pip 
sudo apt install wget curl openssl net-tools iputils-ping zip unzip
sudo apt install libopenblas-dev libopenmpi-dev libomp-dev libjpeg-dev libpng-dev libtiff-dev
sudo pip install jetson-stats
sudo su
jetson_clocks
jtop
free -h && sync && echo 3 > /proc/sys/vm/drop_caches && free -h
exit
pip install https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/6cc/6ecfe8a5994fd/torch-2.6.0-cp310-cp310-linux_aarch64.whl#sha256=6cc6ecfe8a5994fd6d58fb6d6eb73ff2437428bb4953f3ebaa409f83a5f4db99
pip install https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/7d5/6675ba5839c27/torchao-0.10.0+gitbc4f51d-cp39-abi3-linux_aarch64.whl#sha256=7d56675ba5839c275b95a0dbc4f14f3c574f68c5202d2943889c6fb99adf63d8
pip install https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/dda/ce98dc7d89263/torchaudio-2.6.0-cp310-cp310-linux_aarch64.whl#sha256=ddace98dc7d892634d2e5b08593436f3e3b1247a1cb11c0d5f4e5ccf64a9be8c
pip install https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/aa2/2da8dcf4c4c8d/torchvision-0.21.0-cp310-cp310-linux_aarch64.whl#sha256=aa22da8dcf4c4c8dc897e7922b1ef25cb0fe350e1a358168be87a854ad114531
pip install 'numpy<2'
python
{
import torch
import torchvision
import torchaudio
print(torch.__version__)
print(torchvision.__version__)
print(torchaudio.__version__)
torch.cuda.is_available()
torchaudio.utils.ffmpeg_utils.get_build_config()
exit()
}

Setup OpenCV (CUDA)

python
{
  import cv2
  cv2.cuda.getCudaEnabledDeviceCount()
}
sudo apt install libopencv
sudo apt install libopencv-dev
sudo apt install libopencv-python
pip install ultralytics
pip install opencv-contrib-python
pip install imutils schedule screeninfo pyserial pytz onnx
wget https://nvidia.box.com/shared/static/6l0u97rj80ifwkk8rqbzj1try89fk26z.whl -O onnxruntime_gpu-1.19.0-cp310-cp310-linux_aarch64.whl
pip install onnxruntime_gpu-1.19.0-cp310-cp310-linux_aarch64.whl
pip install onnxslim

Author

Posted

OS Image:

Linux ubuntu 6.8.0-1018-raspi aarch64 GNU/Linux
Ubuntu 24.04.2 LTS (Noble Numbat)

Ref:

  1. https://ros.org/reps/rep-2000.html

Setup Ubuntu:

ubuntu login: ubuntu
Password: ubuntu
#change passwd 
ls /sys/class/net
ls /etc/netplan/
sudo vi /etc/netplan/50-cloud-init.yaml
{
network:
    wifis:
        wlan0:
            optional: true
            access-points:
                "SSID-NAME-HERE":
                    password: "PASSWORD-HERE"
            dhcp4: true
}
sudo reboot
sudo netplan --debug apply
ip a
sudo apt update
sudo apt install net-tools
sudo apt install htpdate
sudo timedatectl set-timezone Asia/Bangkok
sudo apt install zram-config
sudo apt install ubuntu-desktop
sudo reboot
sudo vi /boot/firmware/config.txt
{
dtoverlay=vc4-fkms-v3d
}
sudo swapon --show
sudo swapoff -a
sudo rm /swapfile
sudo fallocate -l 5G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo reboot
sudo vcgencmd get_mem gpu
sudo free -h
sudo add-apt-repository universe
sudo apt update
sudo apt install build-essential software-properties-common -y
sudo apt install libopenblas-dev libblas-dev m4 cmake python3-dev python3-yaml python3-setuptools git
sudo apt update 
sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

Install ROS core:

sudo apt update
sudo apt upgrade
#sudo apt install ros-jazzy-ros-base
sudo apt install ros-jazzy-desktop
sudo apt install python3-colcon-common-extensions
sudo apt install ros-jazzy-example-interfaces

Setup ROS2 environment:

source /opt/ros/jazzy/setup.bash
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc

Setup Unitree LidarL1 sdk:

sudo apt install ros-jazzy-pcl-ros
sudo apt install ros-jazzy-pcl-conversions
sudo apt install ros-jazzy-visualization-msgs
sudo apt install libeigen3-dev
git clone https://github.com/unitreerobotics/unilidar_sdk.git
cd unilidar_sdk/unitree_lidar_ros2
colcon build
cd unilidar_sdk/unitree_lidar_ros2
source install/setup.bash
ros2 launch unitree_lidar_ros2 launch.py
sudo su
free -h && sync && echo 3 > /proc/sys/vm/drop_caches && free -h
exit

Setup Livox ROS Driver 2:

cd ~
git clone https://github.com/Livox-SDK/Livox-SDK2.git
cd ./Livox-SDK2/
mkdir build
cd build
cmake .. && make -j
sudo make install
cd ~
git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver2
cd ./ws_livox/src/livox_ros_driver2
source /opt/ros/humble/setup.sh
./build.sh humble
source ~/ws_livox/install/setup.bash
ros2 launch livox_ros_driver2 rviz_HAP_launch.py

Setup Point-LIO-ROS2:

RUN:

Author

Posted

OS image:

Linux 4.9.337-tegra #1 SMP PREEMPT Thu Jun 8 21.19:14 PDT 2023 aarch64 aarch64 aarch64 GNU/Linux
Ubuntu 18.04.6 LTS (Bionic Beaver)
NVIDIA Jetson Nano Developer Kit - Jetpack 4.6.4 [L4T 32.7.4]

Ref:

  1. https://www.stereolabs.com/en-th/blog/ros-and-nvidia-jetson-nano

Setup:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install ros-melodic-desktop
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc $ source ~/.bashrc
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo rosdep init 
rosdep update
sudo apt-get install cmake python-catkin-pkg python-empy python-nose python-setuptools libgtest-dev python-rosinstall python-rosinstall-generator python-wstool build-essential git
mkdir -p ~/catkin_ws/src 
cd ~/catkin_ws/
catkin_make
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc 
source ~/.bashrc

Author