Skip to content

About

Raspberry Pi 5 with RealSense on Ubuntu 24.04

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Raspberry Pi 5 with RealSense on Ubuntu 24.04

This document is modified from https://github.com/mathklk/realsense_raspberry_pi4 to be compatible with Ubuntu 24.04 on the Raspberry Pi 5.

Hardware

  • Raspberry Pi 5 Model B 8GB
  • Intel Realsense D435

Operating System

  • Ubuntu 24.04

Pre-install Requirements

  • Start by updating, upgrading, and installing dependencies and tools:
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install automake libtool vim cmake libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-dev
sudo apt-get install clang
sudo apt-get install libtbb-dev
* Create a new `udev` rule:
```bash
cd ~
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
  • Apply the change:
sudo udevadm control --reload-rules && udevadm trigger
  • Modify the library path by adding the following line to the .bashrc file:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

Apply the change:

source ~/.bashrc

Installation

Install protobuf:

cd ~
git clone --depth=1 -b v3.10.0 https://github.com/google/protobuf.git
cd protobuf
./autogen.sh
./configure
make -j$(nproc)
sudo make install
cd python
export LD_LIBRARY_PATH=../src/.libs
python3 setup.py build --cpp_implementation
python3 setup.py test --cpp_implementation
sudo python3 setup.py install --cpp_implementation
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=3
sudo ldconfig
protoc --version

Change default C/C++ compiler to clang (#9962)

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++

Install RealSense SDK (librealsense):

cd ~/librealsense
mkdir build && cd build
sudo cmake .. -DBUILD_EXAMPLES=true -DCMAKE_BUILD_TYPE=Release -DFORCE_LIBUVC=true
sudo make -j4
sudo make install

Install RealSense SDK Python bindings (pyrealsense2):

cd ~/librealsense/build
sudo cmake .. -DBUILD_PYTHON_BINDINGS=bool:true -DPYTHON_EXECUTABLE=$(which python3)
sudo make -j4
sudo make install
  • Change the default compiler back to gcc
unset CC
unset CXX
  • Modify the Python path:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.12/dist-packages:/home/$(whoami)/librealsense/build/Release
  • Persist the change:
echo 'export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.12/dist-packages:/home/$(whoami)/librealsense/build/Release' >> ~/.bashrc
source ~/.bashrc

Install OpenGL:

sudo apt-get install python3-opengl
sudo -H pip3 install pyopengl
sudo -H pip3 install pyopengl_accelerate

Launch Realsense Viewer:

  • Require display and desktop user to access realsense-viewer
realsense-viewer

Test Realsense Library on Python :

( Script : https://github.com/mathklk/realsense_raspberry_pi4 )

  • Download the example python script from this repo
cd ~
wget https://raw.githubusercontent.com/mathklk/realsense_raspberry_pi4/master/example.py
chmod +x example.py
  • Run the script (requires a desktop environment to show the image)

Testing Script

  • In this video, I use a Raspberry Pi 5 with 8GB RAM running Ubuntu 24.04 and an HDMI capture device to stream the display to OBS on my notebook .

  • Hardware

    • Raspberry Pi 5 Model B 8GB
    • Intel Realsense D435
    • HDMI Capture (Display on notebook with OBS Studio)

Testing Video

e8f17f69-ce15-425f-8366-d7bb56b7d7db-ezgif com-optimize

Hardware

Automatic Pipe Feeder

About

Raspberry Pi 5 with RealSense on Ubuntu 24.04

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors