From c37424aff2ca04efa180e3d00b2b24cef38a12c1 Mon Sep 17 00:00:00 2001 From: baumanta Date: Tue, 28 Apr 2020 13:52:42 +0200 Subject: [PATCH] sort enum by mavlink MAV_SENSOR_ORIENTATION --- src/lib/conversion/rotation.h | 56 ++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/src/lib/conversion/rotation.h b/src/lib/conversion/rotation.h index b8ecf8f111c5..46dc75a48b54 100644 --- a/src/lib/conversion/rotation.h +++ b/src/lib/conversion/rotation.h @@ -75,17 +75,27 @@ enum Rotation { ROTATION_ROLL_270_YAW_135 = 23, ROTATION_PITCH_90 = 24, ROTATION_PITCH_270 = 25, - ROTATION_ROLL_270_YAW_270 = 26, - ROTATION_ROLL_180_PITCH_270 = 27, - ROTATION_PITCH_90_YAW_180 = 28, - ROTATION_PITCH_90_ROLL_90 = 29, - ROTATION_YAW_293_PITCH_68_ROLL_90 = 30, - ROTATION_PITCH_90_ROLL_270 = 31, - ROTATION_PITCH_9_YAW_180 = 32, - ROTATION_PITCH_45 = 33, - ROTATION_PITCH_315 = 34, - ROTATION_ROLL_90_YAW_270 = 35, - ROTATION_ROLL_270_YAW_180 = 41, + ROTATION_PITCH_180_YAW_90 = 26, + ROTATION_PITCH_180_YAW_270 = 27, + ROTATION_ROLL_90_PITCH_90 = 28, + ROTATION_ROLL_180_PITCH_90 = 29, + ROTATION_ROLL_270_PITCH_90 = 30, + ROTATION_ROLL_90_PITCH_180 = 31, + ROTATION_ROLL_270_PITCH_180 = 32, + ROTATION_ROLL_90_PITCH_270 = 33, + ROTATION_ROLL_180_PITCH_270 = 34, + ROTATION_ROLL_270_PITCH_270 = 35, + ROTATION_ROLL_90_PITCH_180_YAW_90 = 36, + ROTATION_ROLL_90_YAW_270 = 37, + ROTATION_ROLL_90_PITCH_68_YAW_293 = 38, + ROTATION_PITCH_315 = 39, + ROTATION_ROLL_90_PITCH_315 = 40, + ROTATION_ROLL_270_YAW_180 = 41, + ROTATION_ROLL_270_YAW_270 = 42, + ROTATION_PITCH_90_YAW_180 = 43, + ROTATION_YAW_293_PITCH_68_ROLL_90 = 44, + ROTATION_PITCH_9_YAW_180 = 45, + ROTATION_PITCH_45 = 46, ROTATION_MAX }; @@ -122,17 +132,27 @@ const rot_lookup_t rot_lookup[] = { {270, 0, 135 }, { 0, 90, 0 }, { 0, 270, 0 }, - {270, 0, 270 }, - {180, 270, 0 }, - { 0, 90, 180 }, + { 0, 180, 90 }, + { 0, 180, 270 }, { 90, 90, 0 }, - { 90, 68, 293 }, + {180, 90, 0 }, {270, 90, 0 }, - { 0, 9, 180 }, - { 0, 45, 0 }, - { 0, 315, 0 }, + { 90, 180, 0 }, + {270, 180, 0 }, + { 90, 270, 0 }, + {180, 270, 0 }, + {270, 270, 0 }, + { 90, 180, 90 }, { 90, 0, 270 }, + { 90, 68, 293 }, + { 0, 315, 0 }, + { 90, 315, 0 }, {270, 0, 180 }, + {270, 0, 270 }, + { 0, 90, 180 }, + {293, 68, 90 }, + { 0, 9, 180 }, + { 0, 45, 0 }, }; /**