Skip to content

Instantly share code, notes, and snippets.

@ubdussamad
Last active November 3, 2025 19:30
Show Gist options
  • Select an option

  • Save ubdussamad/8442c3b6315edb30381e57cdf00e9f93 to your computer and use it in GitHub Desktop.

Select an option

Save ubdussamad/8442c3b6315edb30381e57cdf00e9f93 to your computer and use it in GitHub Desktop.
Build librealsense for T261/T265 on Raspberry Pi 4 running Ubuntu 22.04 in the big year 2025

Realsense for T261

Building Realsense in this Version in the big 2025 is painful to say the least Since T261's software support is crap, I had to build an older version of librealsense that still supports T261 and use an older version of Ubuntu to get it working.

My System Info

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-raspi

If your system info is different, you might need to adjust some steps accordingly.

Downloading

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.1

Installing Dependencies

Make sure you have the required dependencies installed.

sudo apt-get update
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config
sudo apt-get install libgtk-3-dev libglfw3-dev libglfw3
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install libasound2-dev libpulse-dev
sudo apt-get install libudev-dev libx11-dev libxinerama-dev libxc

Check with chatgpt incase i missed a few dependencies.

Patches to the source code

While building it ( steps for building later) you'll run into some problems with gcc 10+ since this library was build ages ago??

Patch 1:

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 places. See this patch to understand what to edit in the file.

Patch 2:

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.

Building

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

Adding Udev Rules

To 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.sh

Testing the Installation

After 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-devices

The 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    6DOF

Troubleshooting

When you plug in the T261 device, run the following command to check if the device is recognized:

lsusb

You 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.

Run the enumerate devices tool again to see if the device is detected.

After running it, you should see output similar to:

lsusb
Bus 002 Device 002: ID 8087:0b37 Intel Corp. Intel(R) RealSense(TM) Tracking Camera T265
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment