install and run the ORBSLAM3 WITH ROS1 and REALSENSE D435i camera on Ubuntu 20.04
-ubuntu 20.04
-ROS1
-Pangolin 0.6
-Eigen 3
-Opencv 4.2
-C++14 Compiler
Use this (https://github.com/doubleZ0108/OpenCV-4.2.0) to install opencv
Before building Pangolin, ensure the necessary dependencies are installed:
sudo apt update
sudo apt install -y cmake g++ libglew-dev libboost-dev libboost-thread-dev \
libboost-filesystem-dev libboost-program-options-dev libjpeg-dev libpng-dev \
libtiff5-dev libegl1-mesa-dev
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
git checkout 86eb4975fc4fc8b5d92148c2e370045ae9bf9f5d
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
sudo apt-get install libeigen3-dev
There is no boost in the official website, but if boost is not installed, many errors about C++ will be reported and it cannot be located.
wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz
tar -xvf boost_1_77_0.tar.gz
cd boost_1_77_0
./bootstrap.sh
sudo ./b2 install
sudo apt install libpython2.7-dev
Clone the repository:
git clone https://github.com/hussains72/SLAM3_Imp.git
cd ~/SLAM3_Imp
chmod +x build.sh
./build.sh
sudo gedit ~/.bashrc
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/sajid/SLAM3_Imp/Examples_old/ROS
source ~/.bashrc
cd ~/SLAM3_Imp
chmod +x build_ros.sh
./build_ros.sh
install dependencies
sudo apt update && sudo apt upgrade
sudo apt install git cmake build-essential libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
sudo apt install ros-noetic-catkin python3-catkin-tools python3-pip
pip3 install -U setuptools
sudo apt-get install ros-noetic-ddynamic-reconfigure
Install librealsense from Source
mkdir -p ~/realsense_ws/src
cd ~/realsense_ws/src
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
git checkout v2.50.0 # Recommended version
mkdir build && cd build
cmake .. -DBUILD_EXAMPLES=true -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
Verify installation
realsense-viewer
Install ROS Wrapper for RealSense from Source
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros
git checkout 2.3.2 # Recommended version
cd ~/catkin_ws
catkin_make
source devel/setup.bash
Configure the ROS Wrapper
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
Test the ROS wrapper
roslaunch realsense2_camera rs_camera.launch
Before running the node check
echo $ROS_PACKAGE_PATH
/home/sajid/SLAM3_Imp/Examples_old/ROS:/home/sajid/catkin_ws/src:/opt/ros/noetic/share
monocular node
rosrun ORB_SLAM3 Mono Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml
RGBD node
rosrun ORB_SLAM3 RGBD Vocabulary/ORBvoc.txt Examples/RGB-D/TUM1.yaml