标签:https font div 出现 cat dir sub ros 修改
1 mkdir -p ~/catkin_ws/src
2 cd ~/catkin_ws/src
3 catkin_init_workspace
1 cd ~/catkin_ws
2 catkin_make
gedit ~/.bashrc
1 cd catkin_ws/src
2 git clone https://github.com/OpenKinect/libfreenect2.git
3 cd libfreenect2
4 sudo apt-get install build-essential cmake pkg-config
5 sudo apt-get install libusb-1.0-0-dev
6 sudo apt-get install libturbojpeg libjpeg-turbo8-dev
7 sudo apt-get install libglfw3-dev
8 mkdir build && cd build
9 cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2
10 make
11 make install
PS:要找到libfreenect2,需要为基于cmake的第三方应用程序指定“cmake -Dfreenect2_DIR=$HOME/freenect2/lib/cmake/freenect2”(暂时没用)
1 sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/
2 ./bin/Protonect
1 cd ~/catkin_ws/src/
2 git clone https://github.com/code-iai/iai_kinect2.git
3 cd iai_kinect2
4 rosdep install -r --from-paths .
5 cd ~/catkin_ws
6 catkin_make -DCMAKE_BUILD_TYPE="Release"
gedit ~/.bashrc
roslaunch kinect2_bridge kinect2_bridge.launch
rosrun kinect2_viewer kinect2_viewer
1 cd ~/catkin_ws/src/ORB_SLAM2/
2 chmod +x build_ros.sh
3 ./build_ros.sh
锁定两文件路径
locate boost_system
locate boost_filesystem
前往系统给出的路径中,将libboost_system.so、libboost_system.so.1.58.0等四个文件复制到/Home/catkin_ws/src/ORB_SLAM2/lib路径下,如下图。
打开ORB_SLAM2/Examples/ROS/ORB_SLAM2文件夹下的CmakeLists.txt文件,在图示位置添加两行代码:
${PROJECT_SOURCE_DIR}/../../../lib/libboost_filesystem.so
${PROJECT_SOURCE_DIR}/../../../lib/libboost_system.so
然后再次执行,成功!
1 cd ~/catkin_ws/src/ORB_SLAM2/
2 chmod +x build_ros.sh
3 ./build_ros.sh
roslaunch kinect2_bridge kinect2_bridge.launch
rostopic list
将ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/ros_rgbd.cc的内容更改为
message_filters::Subscriber<sensor_msgs::Image> rgb_sub(nh, "/kinect2/qhd/image_color_rect", 1);
message_filters::Subscriber<sensor_msgs::Image> depth_sub(nh, "/kinect2/qhd/image_depth_rect", 1);
1 cd ~/catkin_ws/src/ORB_SLAM2/
2 chmod +x build_ros.sh
3 ./build_ros.sh
在ORB_SLAM2/Examples/RGB_D文件夹下,复制一份TUM1.yaml文件,将其重命名为kinect2_qhd.yaml(里面是深度相机的内参,我们暂且用TUM1的参数,等以后我们可以自己实际标定一下该深度相机,届时可以使用我们标定好的参数)
roslaunch kinect2_bridge kinect2_bridge.launch
打开新终端,接着输入
rosrun ORB_SLAM2 RGBD ~/catkin_ws/src/ORB_SLAM2/Vocabulary/ORBvoc.txt ~/catkin_ws/src/ORB_SLAM2/Examples/RGB-D/kinect2_qhd.yaml
基于Ubuntu 16.04,手持Kinect v2,实时跑通ORB_SLAM2
标签:https font div 出现 cat dir sub ros 修改
原文地址:https://www.cnblogs.com/pgzhanglin/p/13253611.html