Skip to content

Instantly share code, notes, and snippets.

@TemugeB
Last active December 28, 2023 08:13
Show Gist options
  • Save TemugeB/f810eeeb022e5c7afb51d09079bcda7d to your computer and use it in GitHub Desktop.
Save TemugeB/f810eeeb022e5c7afb51d09079bcda7d to your computer and use it in GitHub Desktop.
Build Realsense 2 SDK for Ubuntu 22, Kernel 6 with python support
As of Sep. 2023, the Realsense binaries released by intel does not support linux Kernel 6+. Thus, it needs to be built from source.
0. Install requried libraries
```
sudo apt-get install libssl-dev libusb-1.0-0-dev libudev-dev pkg-config libgtk-3-dev cmake
```
```
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at
```
1. Copy the repository
```
git clone https://github.com/IntelRealSense/librealsense.git
```
```
cd librealsense
```
2. Update udev rules
```
sudo apt-get install libudev-dev
```
```
sudo ./scripts/setup_udev_rules.sh
```
3. Build the package
```
mkdir build && cd build
```
```
cmake ../ -DFORCE_RSUSB_BACKEND=TRUE -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_BINDINGS=true -DBUILD_SHARED_LIBS=false
```
```
export PYTHONPATH=$PYTHONPATH:/usr/local/lib
```
```
sudo make uninstall && make clean && make **-j8**
```
4. Install the package
```
sudo make install
```
5. Install pyrealsense2
```
pip3 install pyrealsense2
```
6. Test installation
```
python3
```
```
import pyrealsense2
```
This should import the python bindings for realsense.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment