mich1342 / ros2_laser_scan_merger

A ros2 package to merge several laserscan topics by creating a new virtual laserscan topic. Each source laserscan could be configure via the parameter to determine the heading of each source laserscan and the relative position of each source laserscan to the virtual laserscan
56 stars 27 forks source link

Incompatible QoS Policy #11

Closed endris2002 closed 7 months ago

endris2002 commented 8 months ago

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

mich1342 commented 8 months ago

Hi,

Try to change the subscriber reliability policy to system default

endris2002 commented 8 months ago

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.

mich1342 commented 8 months ago

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

endris2002 commented 8 months ago

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

mich1342 commented 8 months ago

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)

endris2002 commented 8 months ago

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

mich1342 commented 8 months ago

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

mich1342 commented 8 months ago

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

endris2002 commented 8 months ago

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.

endris2002 commented 7 months ago

Do you have any new insights from your tests?

mich1342 commented 7 months ago

Hi @endris2002,

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

mich1342 commented 7 months ago

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

mich1342 commented 7 months ago

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

endris2002 commented 3 months ago

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

mich1342 commented 3 months ago

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.