Ricbot realsense

From Rsewiki
Revision as of 09:04, 15 May 2026 by Jca (talk | contribs)

Back to Ricbot

Intel RealSense

Install

sudo apt-get install automake libtool libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-dev
sudo apt install libssl-dev

There is a script to download and compile, e.g. on Raspberry Pi here: https://github.com/realsenseai/librealsense/blob/master/doc/libuvc_installation.md

To install pyrealsense2 at the same time as librealsense, line 46 of the 'libuvc_installation.sh' build script should be changed from this:

cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release

to this:

cmake ../ -DFORCE_LIBUVC=true -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON_BINDINGS:bool=true

From MartyG-RealSense on a pose here: https://github.com/realsenseai/librealsense/issues/13373

Library and examples

This is an alternative to the script above.

cd ~/git
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
mkdir build
cd build
cmake ..
make -j3
sudo make install

Copy udev rules to udev

sudo cp ~/git/librealsense/config/99-realsense*.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules

All example commands start with rs-, e.g.:

rs-capture
rs-pointcloud

Intel Librealsense

Installing support for Intel librealsense.

sudo apt install libssl-dev
sudo apt-get install freeglut3-dev
sudo apt-get install xorg-dev
cd git
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
mkdir build
cd build
cmake ..

I also needed to install libusb-1.0-0-dev

sudo apt install libusb-1.0-0-dev

This path was not included in the CMakeLists.txt, so I added this line at the beginning of the CMakeLists.txt:

cd librealsense
nano CMakeLists.txt

add

include_directories( /usr/include/libusb-1.0/ )

like here:

cmake_minimum_required(VERSION 3.10)

set( LRS_TARGET realsense2 )
project( ${LRS_TARGET} LANGUAGES CXX C )

# Allow librealsense2 and all of the nested project to include the main repo folder
set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${REPO_ROOT})
include_directories( /usr/include/libusb-1.0/ )

include(CMake/lrs_options.cmake)
include(CMake/connectivity_check.cmake)
...

D435 failed at reboot

at times (after reboot) I can no longer enumerate realsense devices, I get

$ rs-enumerate-devices 
15/05 09:00:33,247 ERROR [140732254925120] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY
15/05 09:00:33,249 ERROR [140732304337472] (uvc-sensor.cpp:428) acquire_power failed: failed to set power state
15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_create_device( info_list:0x555598c13730, index:0 ) UNKNOWN] failed to set power state
15/05 09:00:33,251 ERROR [140732304337472] (rs.cpp:280) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument "device"
Could not create device - failed to set power state . Check SDK logs for details
No device detected. Is it plugged in?