【ros depthimage_to_laser kinect2】

kinect2的深度图可以转换成激光来用,使用depthimage_to_laser

 

这个tf是用来给rviz显示的

1)开启kinect2

rosrun kinect2_bridge kinect2_bridge
 
 

2)开启 depthimage_to_laser

rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/kinect2/qhd/image_depth_rect camera_info:=/kinect2/qhd/camera_info

3)开启rviz

rosrun rviz rviz

按topic找到laserScan rviz没有显示啥 有报错

Transform For frame [camera_depth_frame]: No transform to fixed frame [map]. TF error: [Lookup would require extrapolation into the future. Requested time

4)发布static_tf 

rosrun tf static_transform_publisher 0 0 0 0 0 0 1 map camera_depth_frame 10

根据https://answers.ros.org/question/195962/rviz-fixed-frame-world-does-not-exist/

说rviz不知道把scan放哪,按照报错说的,要给他个tf

显示如下:

 

写了个小launch

<launch>
<node pkg="kinect2_bridge" type="kinect2_bridge" name="kinect2_bridge" output="screen"/>
<node pkg="depthimage_to_laserscan" type="depthimage_to_laserscan" name="depthimage_to_laser" output="screen" >
    <remap from="image" to="kinect2/qhd/image_depth_rect"/>
    <remap from="camera_info" to="kinect2/qhd/camera_info"/>
</node>
<node pkg="rviz" type="rviz" name="rviz" />
<node pkg="tf" type="static_transform_publisher" name="tf_static" args="0 0 0 0 0 0 1 map camera_depth_frame 10"/>
</launch>

 

转载于:https://www.cnblogs.com/xy123001/p/8241412.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值