一开始没加tf会报错如下
[ WARN] [1531227099.238940419]: MessageFilter [target=map ]: Dropped 100.00% of messages so far.
解决如下
启动传感器驱动,加上tf变换,从/odom到激光
roslaunch urg_node urg_lidar.launch
<launch>
<!-- A simple launch file for the urg_node package. -->
<!-- When using an IP-connected LIDAR, populate the "ip_address" parameter with the address of the LIDAR.
Otherwise, leave it blank. If supported by your LIDAR, you may enable the publish_intensity
and/or publish_multiecho options. -->
<node name="urg_node" pkg="urg_node" type="urg_node" output="screen">
<param name="ip_address" value="192.168.1.10"/>
<param name="frame_id" value="laser"/>
<param name="calibrate_time" value="true"/>
<param name="publish_intensity" value="false"/>
<param name="publish_multiecho" value="false"/>
<param name="min_ang" value="-2.356194437"/>
<param name="max_ang" value="2.35619443"/>
</node>
<!-- static TF transform from base to laser -->
<node pkg="tf" type="static_transform_publisher" name="base_to_laser" args="0.0 0.0 0.28 0 0.0 0.0 base_footprint laser 100"/>
</launch>
然后 rosrun rviz rviz
点击左下方Add图标,然后下滑找到LaserScan,ok添加进来
在左侧栏打开LaseScan项,然后把topic选择/scan
如果此时还是不可的话
左侧栏第一项Global Option下的Fixed Frame ,选择为base_footprint,或者改写为laser
然后现在应该没问题了,可以看到rviz中有传感器数据了
还有几个命令可以看到激光在ros中的数据和格式
rostopic info /scan
信息
rosmsg show sensor_msgs/LaserScan
数据内容
rostopic echo /scan -n1
传感器数据
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)