Search code examples
ros

Where can I find the file to set the distance for the urg_node?


I would like to set the distance at which urg_node is to be detected.

I changed lines 88 and 89 of the launch file, but the detection distance did not change

88  param name="range_min" type="double" value="0.01"

89  param name="range_max" type="double" value="50.0"

Source code in https://github.com/vstoneofficial/mecanumrover_samples

in mecanumrover_samples/launch/gmapping.launch


Solution

  • I'm not familiar with this exact lidar but in urg_node documentation (http://wiki.ros.org/urg_node) there's no mention of parameters for min max detection range and I didn't find any implementation of it in the source code. So it's not possible to do that directly without modifying source code of urg_node_driver.cpp. But there is a way

    ROS way to do it would be to pass lidar data through filter node and use the filtered output. To do so can use LaserScanRangeFilter filter config for laser_filters package:

    And if you use filters you'll need to remap http://wiki.ros.org/roslaunch/XML/remap some topic names to have correct data flow lidar->filter->gmapping/etc

    PS lines 88 89 that you edited are meant for ydlidar_ros_driver I assume you're are not using ydlidar so that's not what you want