Building Realsense that works with the T261/5 module in the big 2025 is painful to say the least Since T261's software support is crap in the recent versions of librealsense, I had to build an older version of librealsense that still supports T261 and use an older version of Ubuntu to get it working.
samad@imu:~/rover$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
samad@imu:~/rover$ uname -r
5.15.0-1087-raspiIf your system info is different, you might need to adjust some steps accordingly.
Note
- If you're a student in the autonomous class, you have right system so dont worry
- This (T265 Modules) does not work on new 6.x kernels (both on x86 and ARM) in my experience so make sure you are around 5.x kernel
We need this specific version of librealsense. Download and extract it.
wget https://github.com/IntelRealSense/librealsense/archive/refs/tags/v2.51.1.zip
unzip v2.51.1.zip
cd librealsense-2.51.1Make sure you have the required dependencies installed, you'll need a ton of things to build a library from scratch
sudo apt update
sudo apt -y install libssl-dev libusb-1.0-0-dev pkg-config cmake git g++ libgtk-3-dev libglfw3-dev libglfw3 libx11-dev libxinerama-dev libasound2-dev libpulse-dev libudev-dev libxrandr-dev libxcursor-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev
You system may or may not need more tools installed, if your build fails, see if you have a tool missing and still it (lmk through comments so i can update this document as well).
Before building the library, you'll need to make a minor change in the code otherwise you'll run into some problems with gcc 10+ since this library was build ages ago and uses weird characters?
While building with a recent compiler you'll see an error like
librealsense-2.51.1/src/libusb/libusb.h:10:82: error: extended character ‘ is not valid in an identifier
10 | /usr/include/libusb-1.0/libusb.h:736:4: warning: ISO C++ forbids zero-size array ‘dev_capability_data’ Find the file in that's throwing this error (likely librealsense-2.51.1/src/libusb/libusb.h:10:82 ) and replace ‘ with ' in 3 lines (6 replacements).
See this patch to understand what to edit in the file.
While building examples you'll also see an issue like this
"undefined reference to `gluPerspective'"Use this comment on github to patch the CMakeLists.txt file in the root of the librealsense source code.
Now we can build the library.
cd librealsense-2.51.1 # If not already there
mkdir build && cd build
cmake .. -DBUILD_EXAMPLES=ON -DBUILD_WITH_TM2=ON -DFORCE_RSUSB_BACKEND=ON -DCMAKE_CXX_FLAGS="-Wno-pedantic"
make -j 4 # Takes ~30 Minutes on RPi4
sudo make installTo allow non-root access to the T261 device, we need to add udev rules.
cd librealsense-2.51.1 // If not already there
sudo ./scripts/setup_udev_rules.shAfter building, you can test the installation by running one of the examples.
Plug in your T261 device and run the enumerate devices tool:
cd librealsense-2.51.1/build/tools/enumerate-devices
./rs-enumerate-devicesThe output should look like
Device info:
Name : Intel RealSense T265
Serial Number : 908412110976
Firmware Version : 0.2.0.951
Physical Port : 2-1-2
Product Id : 0B37
Usb Type Descriptor : 3.1
Product Line : T200
Stream Profiles supported by Tracking Module
Supported modes:
stream resolution fps format
Fisheye 1 848x800 @ 30Hz Y8
Fisheye 2 848x800 @ 30Hz Y8
Gyro N/A @ 200Hz MOTION_XYZ32F
Accel N/A @ 62Hz MOTION_XYZ32F
Pose N/A @ 200Hz 6DOFWhen you plug in the T261 device, run the following command to check if the device is recognized:
lsusbYou may see an entry similar to:
Bus 001 Device 009: ID 03e7:2150 Intel Myriad VPU [Movidius Neural Compute Stick]If not, try plugging the device into a different USB port and ensure that your udev rules are correctly set up. Also, a reboot might help after setting up udev rules.
After you see it on lsusb, Run the enumerate devices tool again to see if the device is detected.
After running it any of the realsense examples, the kernel actually chages the devices name when you do lsusb , you should see output similar to:
lsusb
Bus 002 Device 002: ID 8087:0b37 Intel Corp. Intel(R) RealSense(TM) Tracking Camera T265Please feel free to add a comment to this gist if you find any problems.