Conversation
| */ | ||
|
|
||
| /** | ||
| * @brief Provides access to the vehicle's odometry estimate |
There was a problem hiding this comment.
Can you document why and when you would want to use this over e.g. https://github.com/rocketSzw/px4-ros2-interface-lib/blob/915ccd5db66bf7d4fc2accf44f5cafaab8dbd76a/px4_ros2_cpp/include/px4_ros2/odometry/attitude.hpp?
Just to avoid confusion.
There was a problem hiding this comment.
The primary motivation is to ensure strict time synchronization of the full state vector.
In the default PX4 dds configuration, local_position and attitude are published at 50Hz, but angular velocity is often omitted. For advanced control scenarios—such as MPC or End-to-End Reinforcement Learning (mapping states directly to motor throttles)—we require position, velocity, attitude, and angular rates to be aligned at the exact same timestamp.
While attitude.hpp handles orientation, it does not inherently bundle the necessary odometry/velocity data synchronously. This wrapper fills that gap by providing a consolidated, consistent state snapshot, which is critical for the stability of my RL controller.
There was a problem hiding this comment.
Yes I'm aware of that :)
But someone looking at the code might not be, so can you add these explanations as a comment?
There was a problem hiding this comment.
Okay, I have added explanations and resolved the conflict.
…ude fields, set required PX4 data, registered the new header/source in the build, and added usage guidance to odometry.hpp explaining when to prefer this wrapper for synchronized position/velocity/attitude/rates.
Provide Odometry wrapper exposing NED position/velocity and attitude fields, set required PX4 data, and register the new header/source in the build.