Last active
May 15, 2017 16:05
-
-
Save willwhui/95afb9c53b2a38134600be8b1cc86e1b to your computer and use it in GitHub Desktop.
Ros By Example Chapter 10 - Robot vision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
硬件:Macbook Air | |
操作系统:Ubuntu 14.04 | |
ROS: Indigo |
10.5 ROS to OpenCV: The cv_bridge Package
教材错误
这一节里面源代码有误,导致运行出错
cv_bridge_demo.py的image_callback方法里面的第一行:
frame = self.bridge.imgmsg_to_cv2(ros_image, "passthrough")
应为
frame = self.bridge.imgmsg_to_cv2(ros_image, "bgr8")
教程附带的完整代码里面用了前面那一行,
但是详细说明里面采用了后面这行。
10.10.2 Viewing Skeletons in RViz
教材不完善:运行rosrun openni_tracker openni_tracker
时提示“InitFromXml failed: Can't create any node of the requested type!”
花了几个小时google之,最终在Google group Ros By Example找到了答案:
需要安装一个教材中不曾提到的kinect-nite驱动。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
10.3.3 Testing your Kinect or Xtion Camera
kinect到手,回头按照RBX1的“10.3.3 Testing your Kinect or Xtion Camera”,测试
rosrun image_view image_view image:=/camera/rgb/image_raw
成功。
测试
rosrun image_view image_view image:=/camera/depth_registered /image_rect
不成功:看不到深度视图。
得找下原因。
想起了自己买的最新版的rbx1.pdf,发现两个版本的教程有点不同。
旧的是这样的:
新的是这样的:
然而依然看不到教程中的效果,教程上说是有明暗变化的图像,我这里只是全灰的。
Google “chapter 10 image:=/camera/depth/image_rect Unable to convert '32FC1' image for display”
发现有人也在问:
http://answers.ros.org/question/248800/unable-to-convert-32fc1-image-for-display-cv_bridgecvtcolorfordisplay/
这里有人问,但是没有正确的解决方案。
http://answers.ros.org/question/245792/cannot-see-depth-image-kinect-unable-to-convert-32fc1-image-for-display-cv_bridgecvtcolorfordisplay/
这也是一个同样的问题,根据其中一个人的回答(http://answers.ros.org/question/245792/cannot-see-depth-image-kinect-unable-to-convert-32fc1-image-for-display-cv_bridgecvtcolorfordisplay/?answer=251004#post-id-251004 )
通过改为订阅另一个topic,如下命令:
rosrun image_view image_view image:=/camera/depth/image_raw
可以得到深度视图。
解决。