ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

ubuntu16.4运行RGBD SLAM

2020-12-11 22:33:48  阅读:278  来源: 互联网

标签:rgbdslam make catkin echo SLAM build install ubuntu16.4 RGBD


####仅作为笔记
环境:
Ubuntu16.04
照例贴出build.sh的内容:

#This script installs rgbdslam_v2 and g2o in ~/Code
#This script can be downloaded individually, as it 
#does not require rest of the rgbdslam repository.
#It will download all required code in the process.

#If you have a fast machine with 4GB RAM or more, increase the 
#two occurences of "-j2" below to parallelize the compilation more

#Prepare System
if test ! -d /opt/ros/kinetic; then
  echo This script assumes ROS kinetic to be installed
  echo The directory /opt/ros/kinetic was not found
  exit 1
fi

SUBDIR=~/Code            ##这里可以修改成自己设定的目录
echo "This script puts all code into '$SUBDIR'. Edit this script to change the location."
echo "Press enter to continue, Ctrl-C to cancel"
read
mkdir -p $SUBDIR

source /opt/ros/kinetic/setup.bash

echo
echo "Removing packages known to conflict (password required for apt-get)"
echo
sudo apt-get purge ros-kinetic-libg2o libqglviewer-dev

echo
echo "Updating ROS dependency database"
echo
rosdep update

echo "Install dependences for g2o"
sudo apt-get install libsuitesparse-dev libeigen3-dev
echo

echo
echo "Downloading, building and installing g2o"
echo
G2O_REPO_DIR=$SUBDIR/g2ofork
git clone -b c++03 https://github.com/felixendres/g2o.git $G2O_REPO_DIR
mkdir $G2O_REPO_DIR/build
cd $G2O_REPO_DIR/build
cmake .. -DCMAKE_INSTALL_PREFIX=$G2O_REPO_DIR/install -DG2O_BUILD_EXAMPLES=OFF
nice make -j2 install

echo
echo "Preparing catkin workspace for rgbdslam_v2"
echo
WORKSPACE=$SUBDIR/rgbdslam_catkin_ws
mkdir -p $WORKSPACE/src
cd $WORKSPACE/src
catkin_init_workspace
catkin_make -C $WORKSPACE
source $WORKSPACE/devel/setup.bash

echo
echo "Downloading rgbdslam_v2"
echo
#Get and build rgbdslam_v2
export G2O_DIR=$G2O_REPO_DIR/install
git clone -b kinetic https://github.com/felixendres/rgbdslam_v2.git $WORKSPACE/src/rgbdslam

#Install missing dependencies
rosdep install rgbdslam
echo
echo "Building rgbdslam_v2"
echo
nice catkin_make -C $WORKSPACE -j2
  1. g2o
sudo apt-get install cmake libeigen3-dev libsuitesparse-dev libqt4-dev qt4-qmake libqglviewer-dev qt5-qmake
git clone https://github.com/felixendres/g2o.git
cd g2o && mkdir build && cd build
cmake ..
make -j4 && sudo make install
  1. pcl-1.8
wget https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.1.tar.gz
tar -xvzf pcl-1.8.1.tar.gz
cd pcl-1.8.1 && mkdir build && cd build
cmake .. && make -j4
sudo make install
  1. rgbd slam
#修改 find_package(PCL 1.7 REQUIRED COMPONENTS common io)为:
# find_package(PCL 1.8 REQUIRED COMPONENTS common io)
#CMakeLists第6行加入:add_compile_options(-std=c++11)
cd ~/catkin_ws/src
wget -q http://github.com/felixendres/rgbdslam_v2/archive/kinetic.zip
rosdep update
rosdep install rgbdslam
catkin_make 
  1. 测试
#启动rgbdslam节点
roslaunch rgbdslam rgbdslam.launch
#主要修改topic
<param name="config/topic_image_mono"              value="/camera/rgb/image_color"/>
<param name="config/topic_image_depth"             value="/camera/depth/image"/>
#播放数据集
rosbag play rgbd_dataset_freiburg1_xyz.bag
  1. 测试结果
    在这里插入图片描述在这里插入图片描述

标签:rgbdslam,make,catkin,echo,SLAM,build,install,ubuntu16.4,RGBD
来源: https://blog.csdn.net/wyy13273181006/article/details/108858385

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有