Ask Your Question
1

changing value 0/nan to max distance (urg/hokuyo node)

asked 2015-01-09 03:38:49 -0500

charkoteow gravatar image

updated 2015-01-09 03:53:27 -0500

Trying to map a quite big open space but some values returned from the node is 'nan' which i suspect are areas which has no obstacle or whatsoever at max distance. How can i turn this 'nan' into a defined value so gmapping can mark it as free space?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2015-01-09 08:39:29 -0500

Are you using the urg_node or the hokuyo_node? The lasers send error codes telling what types of erroneous readings they are getting. The urg_node turns all error readings into NaN, but the hokuyo_node turns errors that are reported as "outside of max distance" into INF. Check out this chunk of code from the hokuyo_node to see where they are setting INF values. Having INF values will allow you to specifically know that there are no objects in range, then you could use a LaserScanRangeFilter to move all INF values to a max_range+1 value. Then you can use ~maxRange and ~maxUrange params in gmapping to properly handle these readings.

In summary, I've had much better luck with hokuyo_node than urg_node for specifically the reason you are describing.

edit flag offensive delete link more

Comments

played with the filters. amazing. it's working now. thank you very much.

charkoteow gravatar image charkoteow  ( 2015-01-09 20:36:16 -0500 )edit

edit: i was using the urg_node before. going to use hokuyo_node from now on since it can support the old uhg-08lx

charkoteow gravatar image charkoteow  ( 2015-01-09 20:37:02 -0500 )edit
1

answered 2017-06-01 03:20:51 -0500

Will Chamberlain gravatar image

updated 2017-06-01 03:22:20 -0500

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/20901... and http://answers.ros.org/question/20899... .

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-01-09 03:38:49 -0500

Seen: 2,023 times

Last updated: Jun 01 '17