Intel Realsens on Ubuntu 20.04 + ROS noetic (installation desription)
[deprecated] Feb 2021
Ubuntu 20.04 LTS is now natively supported by the RealSenseā¢ SDK 2.0.
- Have a look on https://github.com/IntelRealSense/lib...
Intel Realsens on Ubuntu 20.04
I just like to share my installation desription for my intel realsense d435 on ubuntu 20.04 with ros noetic. At the moment the realsense interface is without python bindings.
librealsens
# preparations
export REALSENSE_SOURCE_DIR=$HOME/projects/librealsense/
sudo apt-get install guvcview git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
git clone https://github.com/IntelRealSense/librealsense.git $REALSENSE_SOURCE_DIR
mkdir $REALSENSE_SOURCE_DIR/build
cd $REALSENSE_SOURCE_DIR/build
# build
export REALSENSE_INSTALL_PREFIX=/opt/realsense
sudo mkdir -p $REALSENSE_INSTALL_PREFIX;
sudo chown $USER:$USER -R $REALSENSE_INSTALL_PREFIX # not relay needed -> you could run _make_ followed by _sudo make install_
cmake ../ -DFORCE_RSUSB_BACKEND=true -DBUILD_PYTHON_BINDINGS=false -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true -DCMAKE_INSTALL_PREFIX=$REALSENSE_INSTALL_PREFIX
make install
# extend the ld search path
sudo sh -c "echo $REALSENSE_INSTALL_PREFIX/lib > /etc/ld.so.conf.d/realsense.conf"
sudo ldconfig
# udev rules
cd ~/projects/librealsense/
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/99-realsense-libusb.rules && sudo udevadm control --reload-rules && udevadm trigger
# make cmake config avaliable
echo "export realsense2_DIR=/opt/realsense/lib/cmake/realsense2" >> ~/.bashrc
# reboot
Test
/opt/realsense/bin/realsense-viewer
ROS
export REALSENSE_ROS_WS=$HOME/projects/ros/ws00
sudo apt install ros-noetic-ddynamic-reconfigure
git clone https://github.com/IntelRealSense/realsense-ros.git $REALSENSE_ROS_WS/src/realsense-ros
cd $REALSENSE_ROS_WS
catkin_make
Uninstall
rm -rf /opt/realsense
sudo rm /etc/ld.so.conf.d/realsense.conf
sudo ldconfig
sudo rm /etc/udev/rules.d/99-realsense-libusb.rules
sudo udevadm control --reload-rules && udevadm trigger
# --> remove the line "export realsense2_DIR=/opt/realsense/lib/cmake/realsense2" from ~/.bashrc
Thanks a ton! This really helped me!
Does this require to install an older kernel? Because the first apt-get throws an error:
@thodor I used a vanilla 20.04 that I downloaded on Oct 30; and I'm pretty sure the kernel was a 5.4.0, as that is the kernel for 20.04 (https://ubuntu.com/blog/ubuntu-kernel...) My current kernel is
5.4.0-56-generic
, but it's possible that the patch revision was less than 56 at the time this procedure worked for me; however I think the kernel and the patch number might not be the issue. Hope it works out for you...Note: To preserve compatibility by staying on a 5.4 kernel on 20.04 and not the newer 5.8 kernel (that by default you will get auto-upgraded to as of ~Jan 2021), you can hold some packages like described here: https://askubuntu.com/questions/93849... (No idea what's up with that failure with a 5.4.0-56 kernel though :/ )
How would this change if it were to apply python bindings? Is it as simple as changing -DBUILD_PYTHON_BINDINGS=false to -DBUILD_PYTHON_BINDINGS=true?