Skip to content

Instantly share code, notes, and snippets.

@willwhui
Last active May 15, 2017 16:05
Show Gist options
  • Save willwhui/95afb9c53b2a38134600be8b1cc86e1b to your computer and use it in GitHub Desktop.
Save willwhui/95afb9c53b2a38134600be8b1cc86e1b to your computer and use it in GitHub Desktop.
Ros By Example Chapter 10 - Robot vision
硬件:Macbook Air
操作系统:Ubuntu 14.04
ROS: Indigo
@willwhui
Copy link
Author

willwhui commented May 12, 2017

5月10日,看到这里的时候觉得应该买硬件了:(RBX1)10.9 OpenNI and Skeleton Tracking。
加了exbot.net提供的ros爱好者群,咨询了前辈之后,在咸鱼选了个二手kinect 320元。
虽说有线不如xtion方便,但是便宜,并且据说可以改造成接移动电源的。
以后可以再搞个xtion。

@willwhui
Copy link
Author

willwhui commented May 12, 2017

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,发现两个版本的教程有点不同。
旧的是这样的:

roslaunch freenect_launch freenect-registered-xyzrgb.launch
rosrun image_view image_view image:=/camera/depth_registered/image_rect

新的是这样的:

roslaunch freenect_launch freenect.launch
rosrun image_view image_view image:=/camera/depth/image_rect

然而依然看不到教程中的效果,教程上说是有明暗变化的图像,我这里只是全灰的。

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
可以得到深度视图。
解决。

@willwhui
Copy link
Author

willwhui commented May 12, 2017

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")
教程附带的完整代码里面用了前面那一行,
但是详细说明里面采用了后面这行。

@willwhui
Copy link
Author

willwhui commented May 15, 2017

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