mich1342/ros2_laser_scan_merger

Incompatible QoS Policy

endris2002 opened this issue · 15 comments

Hello @mich1342,

in the context of a university project, I am using two Hokuyo Lidar sensors on a mobile robot. In order to merge the two LaserScans I wanted to use your ros2_laser_scan_merger. Besides the Laser drivers, where I am using urg_node2, I have the same Prerequisites as mentioned in your README file.

The issue I am facing is the Incompability of the Quality of Service Policy for a new subscriber on the /scan topic. The issue occurs as follows:

[pointcloud_to_laserscan_node-2] [WARN] [1704810450.436717006] [pointcloud_to_laserscan]: New subscription discovered on topic '/scan', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY

[rviz2-2] [WARN] [1704809583.330060618] [rviz]: New publisher discovered on topic '/scan', offering incompatible QoS. No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY

These warnings also occur for other topics.

After trying some quick fixes from the Internet without success, I don't know how to handle this issue. Have you faced something like this, or something similar?
Thank you very much in advance for your help!

This is how Rviz and a cutout of my rqt_graph look like:
rosgraph
Screenshot from 2024-01-09 15-52-57

Hi,

Try to change the subscriber reliability policy to system default

Hello,

In rviz I have already tried system default, as I saw your QoS declaration in the main.cpp, but this did not solve the issue for me. Or can I change the policy somewhere else than in Rviz?

Thank you for your fast reply.

Hi,

Please try the others policy also for your subscribers (History, reliability, and durability).

Please try to subscribe the /scan topic from cli

ros2 topic echo /scan

If it shows something then the package is working

How exactly can I do this?

"Please try to subscribe the /scan topic from cli"

for me currently the displayed LaserScan in Rviz flickers in ms from the front laser data to the back laser data, so the LaserScans do not seem merged

Hi,

Just open your terminal. Source your ros2 opt and run the

ros2 topic echo /scan

After running all of your lidars driver and the laser scan merger package.

Could you also show me the rviz showing all of your raw lidars data together with the used parameters (you could use rqt reconfigure to view the actively used parameters)

After I did I launched everything as you said, I got this message at the very beginning of ros2 topic echo /scan

Some, but not all, publishers are offering QoSReliabilityPolicy.RELIABLE. Falling back to QoSReliabilityPolicy.BEST_EFFORT as it will connect to all publishers

This message is followed by LaserScan messages switching between front and back lidar.

For one second rviz looks like this:
Screenshot from 2024-01-16 15-28-05

and the after another split second like this:
Screenshot from 2024-01-16 15-28-23

ros2-laser-scan-merger.txt
pointcloud-to-laserscan.txt

If it is due to QoS issues, you could try to change the laserscans subscriber QoS following your Lidars default QoS here at line 33

https://github.com/mich1342/ros2_laser_scan_merger/blob/main/src/main.cpp

Here are some options you could try

image

Additionally, could you try this version first?

https://github.com/mich1342/ros2_laser_scan_merger/tree/14e2939616b85ee6d84b54689467ebf086c9a516

This is the last version I have actually test with real hardware. Will test current version tomorrow with the real hardware

I tried out your recommendations, unfortunately without success and the same persisting errors. Maybe you have other tips to solve the issue when you test the new version. Thank you in advance and for your fast responses.

Do you have any new insights from your tests?

Hi @endris2002,

Unfortunately, no issue at all with my test. Everything is working.

Hi @endris2002 ,

Just do some commit related to changing the default reliability QoS to sensor data. Please check. Should be good with the Best Effort QoS now. Thank you

I have checked with 2-3 robots and the issue is not coming anymore. Will close the issue for now

This is still an issue, could you show me your rqt_graph??

Hi @endris2002 ,

I currently do not have access to my robot. I do not see any points of you look at my rqt_graph since everything is there in my cases. One thing you could do is try to create your own package to test the laser scan subscription.