ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

jarvisschultz' answer above is right, but for those who want an example, a starting point for me was changing from this

<launch>
<node name="pioneer_driver" pkg="p2os_driver" type="p2os_driver">
</node>
<node name="hokuyo_node" pkg="hokuyo_node" type="hokuyo_node">
</node>
<node pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0.1 0 0.1397 0 0 0 1 base_link laser 100" />
<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="0.1 0 0.1397 0 0 0 1 base_link camera_link 100" />
</launch>

to this

<launch>
<node name="pioneer_driver" pkg="p2os_driver" type="p2os_driver">
</node>
<node name="hokuyo_node" pkg="hokuyo_node" type="hokuyo_node">
</node>
<node pkg="laser_filters" type="scan_to_scan_filter_chain" name="laser_filter">
        <rosparam command="load" file="[path]/hokuyo_config.yaml" /> 
        <remap from="base_scan" to="scan" />
</node>
<node pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0.1 0 0.1397 0 0 0 1 base_link laser 100" />
<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="0.1 0 0.1397 0 0 0 1 base_link camera_link 100" />
</launch>

with [path]/hokuyo_config.yaml like;

scan_filter_chain:
- name: range
  type: LaserScanRangeFilter
  params:
    lower_threshold: 0.2
    upper_threshold: .inf

jarvisschultz' answer above is right, but for those who want an example, a starting point for me was changing from this

<launch>
<node name="pioneer_driver" pkg="p2os_driver" type="p2os_driver">
</node>
<node name="hokuyo_node" pkg="hokuyo_node" type="hokuyo_node">
</node>
<node pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0.1 0 0.1397 0 0 0 1 base_link laser 100" />
<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="0.1 0 0.1397 0 0 0 1 base_link camera_link 100" />
</launch>

to this

<launch>
<node name="pioneer_driver" pkg="p2os_driver" type="p2os_driver">
</node>
<node name="hokuyo_node" pkg="hokuyo_node" type="hokuyo_node">
</node>
<node pkg="laser_filters" type="scan_to_scan_filter_chain" name="laser_filter">
        <rosparam command="load" file="[path]/hokuyo_config.yaml" /> 
        <remap from="base_scan" to="scan" />
</node>
<node pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0.1 0 0.1397 0 0 0 1 base_link laser 100" />
<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="0.1 0 0.1397 0 0 0 1 base_link camera_link 100" />
</launch>

with [path]/hokuyo_config.yaml like;

scan_filter_chain:
- name: range
  type: LaserScanRangeFilter
  params:
    lower_threshold: 0.2
    upper_threshold: .inf

See http://answers.ros.org/question/209018/using-laser_filters-to-convert-inf-readings-to-max_range-1-from-hokuyo/ and http://answers.ros.org/question/208992/changing-value-of-nan-in-urg_node-to-max-distance/ .