Jetson - Compile RealSense cameras
Published:
First of all, check the intel realsense documentation: https://dev.intelrealsense.com/docs/compiling-librealsense-for-linux-ubuntu-guide
I followed most of the steps but I had to change some to make my cameras D435 and T265 work properly
¡WARNING!: Switch the cameras off before compiling the realsense libraries.
Dependencies
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
Clone the following repository to get all the libraries needed
git clone https://github.com/ageve/librealsense
cd librealsense
Checkout version 2.35.2 (last version at June 22, 2020) :
There is a bug that make the compilation fail, follow this ticket to solve it:
https://github.com/IntelRealSense/librealsense/issues/6573#issuecomment-643725732
Checkout version 2.35.2:
git checkout v2.35.2
Rules
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger
Create
build
folder and open itmkdir build && cd build
Compile using CMAKE
Be sure to write the following inside
~/.bashrc
:#============= # CUDA #============= export CUDACXX=/usr/local/cuda-10.0/bin/nvcc export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64 export PATH=${PATH}:/usr/local/cuda/bin
In my case I am using cuda-10.0, change this with your installed version.
Compile:
cmake ../ -DFORCE_LIBUVC:bool=true -DFORCE_RSUSB_BACKEND:bool=true -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_CUDA:bool=true -DBUILD_PYTHON_BINDINGS=bool:true
Install
If this is not the first time you install it:
sudo make uninstall && make clean && make -j4 && sudo make install
If it is the first time:
sudo make clean && make -j4 && sudo make install
To use this libraries with ROS2:
sudo ln -s /usr/local/lib/librealsense2.so.2.35 /usr/lib/aarch64-linux-gnu/librealsense2.so
Test
realsense-viewer