Problem with merging two lidars
Hi there,
Can someone explain why this is happening? I am using the ira_laser_tools.
NOTE: The L corresponds to the right as you see the robot in the picture and R to the left.
<gazebo reference="sick_L_laser">
<material value="Gazebo/Blue" />
<sensor type="ray" name="sick_lms_5_laser_gazebo_v0">
<always_on>true</always_on>
<update_rate>100.0</update_rate>
<pose>0 0 0 0 0 0</pose>
<visualize>false</visualize>
<ray>
<scan>
<horizontal>
<samples>720</samples>
<resolution>1</resolution>
<min_angle>-1.5708</min_angle> <!--90 moires -->
<max_angle>2.44346</max_angle> <!--140 moires -->
</horizontal>
</scan>
<range>
<min>0.05</min>
<max>10.0</max>
<resolution>0.01</resolution>
</range>
</ray>
<plugin name="gazebo_ros_sick_lms_5_laser_gazebo_v0_controller" filename="libgazebo_ros_laser.so">
<gaussianNoise>0.0005</gaussianNoise>
<alwaysOn>true</alwaysOn>
<updateRate>100.0</updateRate>
<topicName>scan_L</topicName>
<frameName>sick_L_laser</frameName>
</plugin>
</sensor>
</gazebo>
<gazebo reference="sick_R_laser">
<material value="Gazebo/Blue" />
<sensor type="ray" name="sick_lms_5_laser_gazebo_v0">
<always_on>true</always_on>
<update_rate>100.0</update_rate>
<pose>0 0 0 0 0 0</pose>
<visualize>true</visualize>
<ray>
<scan>
<horizontal>
<samples>720</samples>
<resolution>1</resolution>
<min_angle>-2.44346</min_angle> <!--140 moires -->
<max_angle>1.5708</max_angle> <!--90 moires -->
</horizontal>
</scan>
<range>
<min>0.05</min>
<max>10.0</max>
<resolution>0.01</resolution>
</range>
</ray>
<plugin name="gazebo_ros_sick_lms_5_laser_gazebo_v0_controller" filename="libgazebo_ros_laser.so">
<gaussianNoise>0.0005</gaussianNoise>
<alwaysOn>true</alwaysOn>
<updateRate>100.0</updateRate>
<topicName>scan_R</topicName>
<frameName>sick_R_laser</frameName>
</plugin>
</sensor>
</gazebo>
-- IRA_LASER_TOOLS --
<launch>
<node pkg="ira_laser_tools" name="laserscan_multi_merger" type="laserscan_multi_merger" output="screen">
<param name="destination_frame" value="base_link"/>
<param name="cloud_destination_topic" value="merged_cloud"/>
<param name="scan_destination_topic" value="scan_multi"/>
<param name="laserscan_topics" value ="/scan_L /scan_R" />
<param name="angle_min" value="-3.1415"/>
<param name="angle_max" value="3.1415"/>
<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="50.0"/>
</node>
</launch>
could you also please upload your config file for ira_laser_tools?
of course,
And have you tested whether the angle min and max are not causing that problem? You in effect have min of -140 and max of 140, instead of +/- 180. Basically, have you already tried adapting all of these params to your laser scanners?
I have the same angle min and max in the real lidars and no problem appears at all, only in gazebo. So I am wondering I am doing something wrong with gazebo plugins or gazebo has the problem?
The Gazebo plugins are supposed to be a model of the real sensor, but do not recreate/represent data in the exact same way. However, if the individual sensors in Gazebo are working properly (without ira_laser_tools), then the problem doesn't seem to be due to Gazebo as the laser_tools package is basically post processing the data and shouldn't affect the plugins themselves.
I would still suggest adapting the ira_laser_tools config for your actual sensors. If it already works fine, then with the correct config, it should work fine too. Then you have a better base of narrowing down the problem. Of course, if by changing the config something stops working as it is now, you can always revert back the config.