本文主要是介绍Ubuntu16.04安装iai_kinect2爬坑记录,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Ubuntu16.04安装iai_kinect2爬坑记录
安装iai_kinect2爬坑经共享
1. iai_kinect2下载安装
网上有很多的安装教程,将下载文件放入工作空间的src文件夹下。在src文件夹下打开终端输入命令
git clone https://github.com/code-iai/iai_kinect2.git
cd iai_kinect2
rosdep install -r --from-paths .
cd ~/catkin_ws #进入自己的工作空间下
catkin_make -DCMAKE_BUILD_TYPE="Release"
理论上到这里,每行命令都成功的情况下,就算配置结束了,可以使用命令
roslaunch kinect2_bridge kinect2_bridge.launch
进行最后的效果预览。(最后有提供)
2. kinect2_XXXX: Cannot locate rosdep definition for [XXX]
当使用rosdep install -r --from-paths . 出现以下命令报错时,使用
rosdep install --from-paths ~/catkin_ws/src/iai_kinect2 --ignore-src -r
注:使用自己的工作空间地址,如果依然报错,那就别管了。
3. Could not find a package configuration file provided by “cv_bridge” with any of the following names:
使用catkin_make -DCMAKE_BUILD_TYPE="Release"出现错误:
开始套娃~
看了网上很多教程,说可以使用
sudo apt-get install ros-kinect-cv-brigde
但是我根本没有这个软件包,会提示无法定位到软件包。没办法只能去直接下源码了。
git clone --branch kinetic https://hub.fastgit.org/ros-perception/vision_opencv.git#或者使用git clone --branch kinetic https://github.com/ros-perception/vision_opencv.git
记得要下载正确的版本。
将下载好的文件放在你的工作空间的src文件夹下。这时候出现了一个新的有趣的事情。现在有两个选择。
(1)可以使用进入cv_brigde文件夹下,编译安装cv_brigde。(不推荐,因为后面的错没法弄,但如果后面不报错,这个方法也可行)
cd cv_brigde
mkdir build && cd build
cmake ..
make
make install #可能会报错,建议加上sudo
(2)进入工作空间下使命catkin命令编译安装
catkin_make --pkg vision_opencv
再次使用命令
catkin_make -DCMAKE_BUILD_TYPE="Release"
然后出现错误
可以看到又少了一个,没办法,缺哪个装哪个,这个不需要指定版本。
git clone https://github.com/ros-perception/image_transport_plugins.git
文件下载下来,不需要将其中的内容取出来,不然要要把其中的内容一个一个放进去。
再次使用命令
catkin_make -DCMAKE_BUILD_TYPE="Release"
这时候就会直接成功了。
4. Failed to load nodelet [/kinect2_points_xyzrgb_XX] of type [depth_image_proc/point_cloud_xyzrgb]
编译成功以后不要忘记
source devel/setup.bash
然后使用命令
roslaunch kinect2_bridge kinect2_bridge.launch
然后就出红了。
[ERROR] [1625489619.447342991]: Failed to load nodelet [/kinect2_points_xyzrgb_sd] of type [depth_image_proc/point_cloud_xyzrgb] even after refreshing the cache: According to the loaded plugin descriptions the class depth_image_proc/point_cloud_xyzrgb with base class type nodelet::Nodelet does not exist. Declared types are kinect2_bridge/kinect2_bridge_nodelet nodelet_tutorial_math/Plus
[ERROR] [1625489619.447363189]: The error before refreshing the cache was: According to the loaded plugin descriptions the class depth_image_proc/point_cloud_xyzrgb with base class type nodelet::Nodelet does not exist. Declared types are kinect2_bridge/kinect2_bridge_nodelet nodelet_tutorial_math/Plus
[FATAL] [1625489619.447479178]: Failed to load nodelet '/kinect2_points_xyzrgb_sd` of type `depth_image_proc/point_cloud_xyzrgb` to manager `kinect2'
[ERROR] [1625489619.456329901]: Failed to load nodelet [/kinect2_points_xyzrgb_qhd] of type [depth_image_proc/point_cloud_xyzrgb] even after refreshing the cache: According to the loaded plugin descriptions the class depth_image_proc/point_cloud_xyzrgb with base class type nodelet::Nodelet does not exist. Declared types are kinect2_bridge/kinect2_bridge_nodelet nodelet_tutorial_math/Plus
[ERROR] [1625489619.456348069]: The error before refreshing the cache was: According to the loaded plugin descriptions the class depth_image_proc/point_cloud_xyzrgb with base class type nodelet::Nodelet does not exist. Declared types are kinect2_bridge/kinect2_bridge_nodelet nodelet_tutorial_math/Plus
[FATAL] [1625489619.456460876]: Failed to load nodelet '/kinect2_points_xyzrgb_qhd` of type `depth_image_proc/point_cloud_xyzrgb` to manager `kinect2'
[ERROR] [1625489619.464895019]: Failed to load nodelet [/kinect2_points_xyzrgb_hd] of type [depth_image_proc/point_cloud_xyzrgb] even after refreshing the cache: According to the loaded plugin descriptions the class depth_image_proc/point_cloud_xyzrgb with base class type nodelet::Nodelet does not exist. Declared types are kinect2_bridge/kinect2_bridge_nodelet nodelet_tutorial_math/Plus
[ERROR] [1625489619.464912232]: The error before refreshing the cache was: According to the loaded plugin descriptions the class depth_image_proc/point_cloud_xyzrgb with base class type nodelet::Nodelet does not exist. Declared types are kinect2_bridge/kinect2_bridge_nodelet nodelet_tutorial_math/Plus
[FATAL] [1625489619.465045516]: Failed to load nodelet '/kinect2_points_xyzrgb_hd` of type `depth_image_proc/point_cloud_xyzrgb` to manager `kinect2'
如果你使用的rosrun命令,其实也会出错,只是没显示出来而已。下载一个image_pipeline。放入src文件夹下。
git clone --branch kinetic https://github.com/ros-perception/image_pipeline.git
再次使用命令编译安装
catkin_make --pkg image_pipeline
这个时候如果再出现类似的问题接着装就好了。
再次使用命令
roslaunch kinect2_bridge kinect2_bridge.launch
出现下图表示正确
5. 结果展示
最后新开终端输入命令
source devel/setup.bash
rosrun kinect2_viewer kinect2_viewer
结果展示
爬坑结束。
这篇关于Ubuntu16.04安装iai_kinect2爬坑记录的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!