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 ROS 2 message equality check #964

Merged

Conversation

achim-k
Copy link
Contributor

@achim-k achim-k commented Sep 4, 2023

Public-Facing Changes

Fix ROS 2 message equality check

Description

Use a custom comparison function that compares messages by their __slots__ fields.

Fixes #959
Resolves FG-4775

Copy link
Member

@jtbandes jtbandes left a comment

Choose a reason for hiding this comment

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

Seems fine. I am not an expert in __slots__. For reference, I believe this is the original implementation which this dynamic generation code was adapted from:

https://github.com/ros/genpy/blob/f70658f2200dfb7c98e99e9cf15be61cfaa1a432/src/genpy/message.py#L419

@achim-k achim-k enabled auto-merge (squash) September 6, 2023 13:45
@achim-k achim-k merged commit 1f3a471 into main Sep 6, 2023
24 checks passed
@achim-k achim-k deleted the achim/fg-4775-ros2-decoded-messages-__eq__-always-returns-true branch September 6, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

ROS2 decoded messages __eq__ always returns true
2 participants