iralabdisco / ira_laser_tools

All laser type assemblers and manipulators.
BSD 3-Clause "New" or "Revised" License
204 stars 218 forks source link

Laser Merger doesn't compute range data (fixed value) #29

Open sohartma opened 4 years ago

sohartma commented 4 years ago

I have 3 laser scan topics that i want to merge. (they are actually ultrasonic sensors that i convert to 3 LaserScan topics) The three topics are working fine, publishing the range. But the merged topic /scan_multi only publishes a fixed value for the range. I tried editing the params in the launch file according to my us sensors. The fixed value is always bigger than the range_max value i set in the launch file.

the launch file params:

        <param name="destination_frame" value="sonar_link"/>
    <param name="cloud_destination_topic" value="/merged_cloud"/>
    <param name="scan_destination_topic" value="/scan_multi"/>
            <param name="laserscan_topics" value ="/car/scan /car/scan_l /car/scan_r" /> <!-- LIST OF THE LASER SCAN TOPICS TO SUBSCRIBE -->

            <param name="angle_min" value="-2.0"/>
            <param name="angle_max" value="2.0"/>
            <param name="angle_increment" value="0.0058"/>
            <param name="scan_time" value="0.0333333"/>
            <param name="range_min" value="0.05"/>
            <param name="range_max" value="1.0"/>

The output:

ubuntu@ubuntu-VirtualBox:~$ rostopic echo /scan_multi header: seq: 231 stamp: secs: 1595207444 nsecs: 54525514 frame_id: "base_link" angle_min: -2.0 angle_max: 2.0 angle_increment: 0.00579999992624 time_increment: 0.0 scan_time: 0.0333333015442 range_min: 0.0500000007451 range_max: 1.0 ranges: [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, .......] intensities: []

How can i fix this? Maybe edit the configuration file?

nakai-omer commented 2 years ago

I know this is an old question, but just in case someone also runs into this. This lib by default fills in the data with your range_max value + 1. Then it overrides this data with data from your scan topics. There are a couple mis-configurations that can cause the merger to ignore the laser data. For example, if the min/max angles configured are incorrect, and your data comes at a higher/lower angle, it will ignore the data, and leave you with the default values, in your case 2.0. You can turn on debug logging, and you should see a log message for cases when your data is ignored.

As a side note, a fixed number default range value is different than what packages like slam_toolbox expect. It should really be changed into infinity instead of range_max + 1 (2.0 in above example).