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

Fix: Merge messages if all level 0 in C++ (matching python) #436

Open
wants to merge 3 commits into
base: ros2
Choose a base branch
from

Conversation

hilary-luo
Copy link

This change will align how the C++ and python merge summary functionality works. (

if (lvl > DiagnosticStatus.OK) == (self.level > DiagnosticStatus.OK):
)

In python, if both messages have level "OK" or if both messages are "not OK" then the message text will get merged. Otherwise, the "OK" message will be overwritten with the "not OK" message. This operation makes sense to me as the intended outcome.

However, in C++ the messages were only getting merged if they were both "not OK". In the situation where both messages were "OK", only the first message was being captured and shown.

@hilary-luo hilary-luo changed the title Merge messages if all level 0, matching python Fix: Merge messages if all level 0 in C++ (matching python) Feb 4, 2025
@ct2034
Copy link
Collaborator

ct2034 commented Feb 10, 2025

Hi @hilary-luo.
Thanks for your contribution and for spotting this incosistency. I am happy using the merging behaviour in both languages. I just have to see what the CI needs.

@ct2034
Copy link
Collaborator

ct2034 commented Feb 10, 2025

Can you please also adopt the tests.

@ct2034 ct2034 added bug This is a bug in the code (and not a new feature) ros2 PR tackling a ROS2 branch labels Feb 10, 2025
@hilary-luo
Copy link
Author

hilary-luo commented Feb 12, 2025

@ct2034 Looks like all tests are passing now. Please let me know if you need anything else from me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug in the code (and not a new feature) ros2 PR tackling a ROS2 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants