From 38fa74a27a9a100330a7674d5b7e9876573c6fca Mon Sep 17 00:00:00 2001 From: Claudio Micheli Date: Tue, 17 Aug 2021 17:53:45 +0200 Subject: [PATCH] rotations: introduce support for ROTATION_PITCH_90_YAW_45 Signed-off-by: Claudio Micheli --- src/lib/conversion/rotation.h | 7 ++++++- src/modules/mavlink/mavlink_messages.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/conversion/rotation.h b/src/lib/conversion/rotation.h index 80a9910d8b..c0cf8569f6 100644 --- a/src/lib/conversion/rotation.h +++ b/src/lib/conversion/rotation.h @@ -91,7 +91,9 @@ enum Rotation : uint8_t { ROTATION_ROLL_90_PITCH_68_YAW_293 = 38, ROTATION_PITCH_315 = 39, ROTATION_ROLL_90_PITCH_315 = 40, - + RESERVED_0 = 41, + RESERVED_1 = 42, + ROTATION_PITCH_90_YAW_45 = 43, ROTATION_MAX }; @@ -143,6 +145,9 @@ static constexpr rot_lookup_t rot_lookup[ROTATION_MAX] = { { 90, 68, 293 }, { 0, 315, 0 }, { 90, 315, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 90, 45 }, }; /** diff --git a/src/modules/mavlink/mavlink_messages.cpp b/src/modules/mavlink/mavlink_messages.cpp index 8fb7bbb153..dce22d90c5 100644 --- a/src/modules/mavlink/mavlink_messages.cpp +++ b/src/modules/mavlink/mavlink_messages.cpp @@ -233,7 +233,7 @@ static_assert(MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 == static_cast(ROTATION_PITCH_315), "Pitch: 315"); static_assert(MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 == static_cast(ROTATION_ROLL_90_PITCH_315), "Roll: 90, Pitch: 315"); -static_assert(41 == ROTATION_MAX, "Keep MAV_SENSOR_ROTATION and PX4 Rotation in sync"); +static_assert(41 + 3 == ROTATION_MAX, "Keep MAV_SENSOR_ROTATION and PX4 Rotation in sync"); static const StreamListItem streams_list[] = {