Installation of realsense-ros under Ubuntu18.04

reference:

RealSense D435i configuration process under Ubuntu18_Ice Cream Blog-CSDN Blog

0 installation environment

System: Ubuntu 18.04

           ROS melodic 

Equipment: Realsense D435i

1 RealSense SDK installation

1.1 Clone SDK

Open the terminal (default is in the root directory, you can replace the installation directory as needed)

git clone https://github.com/IntelRealSense/librealsense
cd librealsense

1.2 Install dependencies

Continue typing in the terminal

sudo apt-get install libudev-dev pkg-config libgtk-3-dev
sudo apt-get install libusb-1.0-0-dev pkg-config
sudo apt-get install libglfw3-dev
sudo apt-get install libssl-dev

1.3 Install permission script

sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger

1.4 Compilation and installation

The make command sometimes reports an error. Sometimes it is enough to execute the following command again at another time. It is quite metaphysical.

mkdir build
cd build
cmake ../ -DBUILD_EXAMPLES=true
make -j4
sudo make install

1.5 Test whether the installation is successful

cd librealsense/build/examples/capture
./rs-capture

Or use the command:

realsense-viewer

2 Install RealSense-ROS

2.1 Installation

mkdir -p realsense_ws/src
cd realsense_ws/src

git clone -b ros1-legacy https://github.com/IntelRealSense/realsense-ros.git
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
cd .. && catkin_make
git clone -b ros1-legacy https://github.com/IntelRealSense/realsense-ros.git

The -b means downloading the corresponding ros1 branch.

This specification is made because constant updates to the corresponding git web page will make the original correct installation process no longer valid.

(If you do not specify a branch, the following error will appear in catkin_make: This workspace contains non-catkin packages in it, and catkin cannot build a non-homogeneous. This error means that there is a ros2 package under the src folder)

2.2 Add environment dependencies

echo "source ~/realsense_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

2.3 Test whether the installation is successful

roslaunch realsense2_camera demo_pointcloud.launch 

If something pops out, OK, you're done!

2.4 Use of RVIZ

Modify Fixed Frame to camera_link, then click add to add the corresponding topic. 

3 Miscellaneous questions

3.1 Virtual machine connection issues

Problem: The camera obviously shows connection, but cheese and realsense-viewer show that the device cannot be detected.

 Solution: Just adjust the USB compatibility in the virtual machine settings to 3.0 or above.

Guess you like

Origin blog.csdn.net/see_sunrise/article/details/127775079
Recommended