From 5589b3f7ad5fab8209e355c5ecf253d513b0e0bc Mon Sep 17 00:00:00 2001 From: ncnynl Date: Wed, 30 Nov 2022 18:16:12 +0800 Subject: [PATCH] add orbslam2 install script --- .../shell/install_orbslam2_ros1_source.sh | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 commands_extra/ros1_algorithm/shell/install_orbslam2_ros1_source.sh diff --git a/commands_extra/ros1_algorithm/shell/install_orbslam2_ros1_source.sh b/commands_extra/ros1_algorithm/shell/install_orbslam2_ros1_source.sh new file mode 100755 index 0000000..8571321 --- /dev/null +++ b/commands_extra/ros1_algorithm/shell/install_orbslam2_ros1_source.sh @@ -0,0 +1,59 @@ +#!/bin/bash +################################################################ +# Function :Install ROS1 Noetic ORB_SLAM2 # +# Platform :All Linux Based Platform # +# Version :1.0 # +# Date :2022-11-30 # +# Author :ncnynl EndlessLoops # +# Contact :1043931@qq.com # +# Company :Foshan AiZheTeng Information Technology Co.,Ltd. # +# URL: https://ncnynl.com # +################################################################ + +workspace=ros1_vslam_ws + +if [ -d ~/$workspace/ORB_SLAM2 ]; then + echo "ORB_SLAM2 have installed!!" +else + if [ ! -d ~/$workspace/ ];then + mkdir -p ~/$workspace/ + fi + ## isntall lib + sudo apt-get update + sudo apt-get install libpython2.7-dev libboost-filesystem-dev libboost-dev libboost-thread-dev libglew-dev libblas-dev liblapack-dev + sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev build-essential + + ## install Pangolin + cd ~/$workspace/ + git clone https://ghproxy.com/https://github.com/stevenlovegrove/Pangolin + cd ~/$workspace/Pangolin + git checkout 25159034e62011b3527228e476cec51f08e87602 + mkdir build + cd build + cmake -DCPP11_NO_BOOST=1 .. + make + + ## install ORB_SLAM2/ + cd ~/$workspace/ + git clone -b noetic https://gitee.com/ncnynl/ORB_SLAM2/ + cd ~/$workspace/ORB_SLAM2 + chmod +x build.sh build_ros.sh + ./build.sh + #echo "ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/ros1_vslam_ws/ORB_SLAM2/Examples/ROS" >> ~/.bashrc + + + + #add to bashrc if not exits + if ! grep -Fq "$workspace/ORB_SLAM2/Examples/ROS" ~/.bashrc + then + echo "ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:$HOME/ros1_vslam_ws/ORB_SLAM2/Examples/ROS" >> ~/.bashrc + echo " $workspace workspace have installed successfully! writed to ~/.bashrc" + else + echo "Has been inited before! Please check ~/.bashrc" + fi + ./build_ros.sh + + echo "ROS ${ROS_DISTRO} ORB_SLAM2 installed successfully" +fi + + -- Gitee