-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Message versioning and translation for ROS #24113
base: main
Are you sure you want to change the base?
Conversation
This adds "_v" + string(T::MESSAGE_VERSION) to the ROS topic if the message contains a MESSAGE_VERSION field (and the version is non-zero).
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 152 byte (0.01 %)]
px4_fmu-v6x [Total VM Diff: 160 byte (0.01 %)]
Updated: 2024-12-17T08:46:46 |
098194d
to
6a3bb95
Compare
6a3bb95
to
ef7c759
Compare
The steps include: | ||
- Copy the message file (`.msg`/`.srv`) to `px4_msgs_old/msg` (or `px4_msgs_old/srv`) and add the current version to the file name. | ||
For example `msg/versioned/VehicleAttitude.msg` becomes `px4_msgs_old/msg/VehicleAttitudeV3.msg`. | ||
Update the existing translations that use the current topic version to the now old version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the existing translations that use the current topic version to the now old version.
How/where shall this be done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now described in more depth in PX4/PX4-user_guide#3465. I'll remove it from here and link to that instead.
For example `px4_msgs::msg::VehicleAttitude` becomes `px4_msgs_old::msg::VehicleAttitudeV3`. | ||
- Increment `MESSAGE_VERSION` and update the message fields as desired. | ||
- Add a version translation by adding a new translation header. Examples: | ||
- [`translations/example_translation_direct_v1.h`](translations/example_translation_direct_v1.h) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are in the example header names v1
and v2
, when so far the example was to change v3
-> v4
??
Follow-up to #23850
I ended up adding a script that copies the translation node and msg files into a ROS workspace. I tested an approach of directly adding PX4 into a workspace, but ran into too many issues (e.g. msg namespace cannot be customized independently, or that there cannot be multiple subprojects if the toplevel directory already contains a CMakeLists.txt).