-
Notifications
You must be signed in to change notification settings - Fork 15.5k
feat(ekf2): publish acceleration in VehicleOdometry #26944
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
Open
evannsmc
wants to merge
5
commits into
PX4:main
Choose a base branch
from
evannsmc:pr-vehicle-odometry-v1-final
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8ffa2c1
feat(ekf2): publish acceleration in VehicleOdometry
evannsmc 2e22ed3
Merge branch 'main' into pr-vehicle-odometry-v1-final
mrpollo b4d8239
ci: exclude msg/translation_node from clang-tidy SITL analysis
evannsmc aa80968
fix(ekf2): restore ITCM-stable signatures for PublishOdometry and Pub…
evannsmc 5c89e16
Merge branch 'main' into pr-vehicle-odometry-v1-final
evannsmc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Vehicle odometry data | ||
| # | ||
| # Fits ROS REP 147 for aerial vehicles | ||
|
|
||
| uint32 MESSAGE_VERSION = 0 | ||
|
|
||
| uint64 timestamp # [us] Time since system start | ||
| uint64 timestamp_sample # [us] Timestamp sample | ||
|
|
||
| uint8 pose_frame # [@enum POSE_FRAME] Position and orientation frame of reference | ||
| uint8 POSE_FRAME_UNKNOWN = 0 # Unknown frame | ||
| uint8 POSE_FRAME_NED = 1 # North-East-Down (NED) navigation frame. Aligned with True North. | ||
| uint8 POSE_FRAME_FRD = 2 # Forward-Right-Down (FRD) frame. Constant arbitrary heading offset from True North. Z is down. | ||
|
|
||
| float32[3] position # [m] [@frame local frame] [@invalid NaN If invalid/unknown] Position. Origin is position of GC at startup. | ||
| float32[4] q # [-] [@invalid NaN First value if invalid/unknown] Attitude (expressed as a quaternion) relative to pose reference frame at current location. Follows the Hamiltonian convention (w, x, y, z, right-handed, passive rotations from body to world) | ||
|
|
||
| uint8 velocity_frame # [@enum VELOCITY_FRAME] Reference frame of the velocity data | ||
| uint8 VELOCITY_FRAME_UNKNOWN = 0 # Unknown frame | ||
| uint8 VELOCITY_FRAME_NED = 1 # NED navigation frame at current position. | ||
| uint8 VELOCITY_FRAME_FRD = 2 # FRD navigation frame at current position. Constant arbitrary heading offset from True North. Z is down. | ||
| uint8 VELOCITY_FRAME_BODY_FRD = 3 # FRD body-fixed frame | ||
|
|
||
| float32[3] velocity # [m/s] [@frame @velocity_frame] [@invalid NaN If invalid/unknown] Velocity. | ||
| float32[3] angular_velocity # [rad/s] [@frame @VELOCITY_FRAME_BODY_FRD] [@invalid NaN If invalid/unknown] Angular velocity in body-fixed frame | ||
|
|
||
| float32[3] position_variance # [m^2] Variance of position error | ||
| float32[3] orientation_variance # [rad^2] Variance of orientation/attitude error (expressed in body frame) | ||
| float32[3] velocity_variance # [m^2/s^2] Variance of velocity error | ||
|
|
||
| uint8 reset_counter # [-] Reset counter. Counts reset events on attitude, velocity and position. | ||
| int8 quality # [-] [@invalid 0] Quality. Unused. | ||
|
|
||
| # TOPICS vehicle_odometry vehicle_mocap_odometry vehicle_visual_odometry | ||
| # TOPICS estimator_odometry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
msg/translation_node/translations/translation_vehicle_odometry_v1.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /**************************************************************************** | ||
| * Copyright (c) 2025 PX4 Development Team. | ||
| * SPDX-License-Identifier: BSD-3-Clause | ||
| ****************************************************************************/ | ||
| #pragma once | ||
|
|
||
| // Translate VehicleOdometry v0 <--> v1 | ||
| #include <limits> | ||
| #include <px4_msgs_old/msg/vehicle_odometry_v0.hpp> | ||
| #include <px4_msgs/msg/vehicle_odometry.hpp> | ||
|
|
||
| class VehicleOdometryV1Translation { | ||
| public: | ||
| using MessageOlder = px4_msgs_old::msg::VehicleOdometryV0; | ||
| static_assert(MessageOlder::MESSAGE_VERSION == 0); | ||
|
|
||
| using MessageNewer = px4_msgs::msg::VehicleOdometry; | ||
| static_assert(MessageNewer::MESSAGE_VERSION == 1); | ||
|
|
||
| static constexpr const char* kTopic = "fmu/out/vehicle_odometry"; | ||
|
|
||
| #define COMMON_VEHICLE_ODOMETRY_FIELDS(FUNCTION) \ | ||
| FUNCTION(timestamp) \ | ||
| FUNCTION(timestamp_sample) \ | ||
| FUNCTION(pose_frame) \ | ||
| FUNCTION(position) \ | ||
| FUNCTION(q) \ | ||
| FUNCTION(velocity_frame) \ | ||
| FUNCTION(velocity) \ | ||
| FUNCTION(angular_velocity) \ | ||
| FUNCTION(position_variance) \ | ||
| FUNCTION(orientation_variance) \ | ||
| FUNCTION(velocity_variance) \ | ||
| FUNCTION(reset_counter) \ | ||
| FUNCTION(quality) | ||
|
|
||
| #define COPY_FIELD_FROM_OLDER(field) msg_newer.field = msg_older.field; | ||
| #define COPY_FIELD_TO_OLDER(field) msg_older.field = msg_newer.field; | ||
|
|
||
| static void fromOlder(const MessageOlder &msg_older, MessageNewer &msg_newer) { | ||
| COMMON_VEHICLE_ODOMETRY_FIELDS(COPY_FIELD_FROM_OLDER) | ||
| msg_newer.acceleration.fill(std::numeric_limits<float>::quiet_NaN()); | ||
| } | ||
|
|
||
| static void toOlder(const MessageNewer &msg_newer, MessageOlder &msg_older) { | ||
| COMMON_VEHICLE_ODOMETRY_FIELDS(COPY_FIELD_TO_OLDER) | ||
| } | ||
|
|
||
| #undef COPY_FIELD_FROM_OLDER | ||
| #undef COPY_FIELD_TO_OLDER | ||
| #undef COMMON_VEHICLE_ODOMETRY_FIELDS | ||
| }; | ||
|
|
||
| REGISTER_TOPIC_TRANSLATION_DIRECT(VehicleOdometryV1Translation); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.