Ricbot realsense
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
The RealSense D435 is connected to a powered USB3 hub. The Raspberry is powered by a 5V supply through expansion pins. It is a default 64-bit Raspberry Pi OS:
$ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian
error
At times (after reboot), I can no longer enumerate RealSense devices, and 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?
lsusb
But lsusb find the device
$ lsusb Bus 004 Device 004: ID 8086:0b07 Intel Corp. RealSense D435 Bus 004 Device 005: ID 2676:ba05 Basler AG Vision Camera Bus 004 Device 003: ID 05e3:0626 Genesys Logic, Inc. Hub Bus 004 Device 002: ID 05e3:0626 Genesys Logic, Inc. Hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 003: ID 05e3:0610 Genesys Logic, Inc. Hub Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub