Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure compatible QoS in ros2 subscriptions #104

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

pepisg
Copy link
Contributor

@pepisg pepisg commented Jun 8, 2022

This PR implements a function to get the QoS with which topics are being published, and then uses that function to subscribe to topics using the same QoS. This aims to avoid incompatibilities when subscribing in ROS2.

This aims to solve #93

@nakai-omer
Copy link

nakai-omer commented Jul 21, 2022

Please merge this

EDIT:
I am getting the following error trying to run this, using humble:

[rosboard_node-27] AttributeError: 'Subscriber' object has no attribute '_sub'
[rosboard_node-27] [INFO] [1658420978.174763043] [rosboard_node]: Subscribing to /map
[rosboard_node-27]
[rosboard_node-27] >>> [rcutils|error_handling.c:108] rcutils_set_error_state()
[rosboard_node-27] This error state is being overwritten:
[rosboard_node-27]
[rosboard_node-27] 'Unknown QoS history policy, at ./src/qos.cpp:61'
[rosboard_node-27]
[rosboard_node-27] with this new error message:
[rosboard_node-27]
[rosboard_node-27] 'create_publisher() failed setting topic QoS, at ./src/subscription.cpp:223'

Copy link

@HX2003 HX2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the following in rosboard/rosboard.py after line 135 and it works.

                if(topic_info[0].qos_profile.history == HistoryPolicy.UNKNOWN):
                    topic_info[0].qos_profile.history = HistoryPolicy.KEEP_LAST  

@dheera
Copy link
Owner

dheera commented Sep 5, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants