Skip to content
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

remove rotation 41 (ROLL_270_YAW_180) #16449

Merged
merged 1 commit into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/lib/conversion/RotationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ TEST(Rotations, duplicates)
if (j == ROTATION_ROLL_180_YAW_90 && i == ROTATION_PITCH_180_YAW_270) { continue; }


// ROTATION_ROLL_90_PITCH_180 (31) = ROTATION_ROLL_270_YAW_180 (41)
if (i == ROTATION_ROLL_90_PITCH_180 && j == ROTATION_ROLL_270_YAW_180) { continue; }

if (j == ROTATION_ROLL_90_PITCH_180 && i == ROTATION_ROLL_270_YAW_180) { continue; }


// otherwise all rotations should be different
ASSERT_GT((transformed_1 - transformed_2).norm(), 0) << "Rotation " << i << " and " << j << " equal";
}
Expand Down
5 changes: 1 addition & 4 deletions src/lib/conversion/rotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,7 @@ rotate_3f(enum Rotation rot, float &x, float &y, float &z)
return;
}

case ROTATION_ROLL_90_PITCH_180:

// FALLTHROUGH
case ROTATION_ROLL_270_YAW_180: {
case ROTATION_ROLL_90_PITCH_180: {
tmp = y;
x = -x;
y = -z;
Expand Down
8 changes: 3 additions & 5 deletions src/lib/conversion/rotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,17 @@ enum Rotation {
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_MAX
};

typedef struct {
struct rot_lookup_t {
uint16_t roll;
uint16_t pitch;
uint16_t yaw;
} rot_lookup_t;
};

const rot_lookup_t rot_lookup[] = {
static constexpr rot_lookup_t rot_lookup[ROTATION_MAX] = {
{ 0, 0, 0 },
{ 0, 0, 45 },
{ 0, 0, 90 },
Expand Down Expand Up @@ -143,7 +142,6 @@ const rot_lookup_t rot_lookup[] = {
{ 90, 68, 293 },
{ 0, 315, 0 },
{ 90, 315, 0 },
{270, 0, 180 },
};

/**
Expand Down
3 changes: 0 additions & 3 deletions src/modules/commander/mag_calibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,6 @@ calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub, int32_t cal_ma

// FALLTHROUGH
case ROTATION_PITCH_180_YAW_270: // skip 27, same as 10 ROTATION_ROLL_180_YAW_90

// FALLTHROUGH
case ROTATION_ROLL_270_YAW_180: // skip 41, same as 31 ROTATION_ROLL_90_PITCH_180
MSE[r] = FLT_MAX;
break;

Expand Down
5 changes: 2 additions & 3 deletions src/modules/mavlink/mavlink_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,8 @@ static_assert(MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 == static_cast<MAV_SE
static_assert(MAV_SENSOR_ROTATION_PITCH_315 == static_cast<MAV_SENSOR_ORIENTATION>(ROTATION_PITCH_315), "Pitch: 315");
static_assert(MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 == static_cast<MAV_SENSOR_ORIENTATION>(ROTATION_ROLL_90_PITCH_315),
"Roll: 90, Pitch: 315");
static_assert(MAV_SENSOR_ROTATION_ROLL_270_YAW_180 == static_cast<MAV_SENSOR_ORIENTATION>(ROTATION_ROLL_270_YAW_180),
"Roll: 270, Yaw: 180");
static_assert(42 == ROTATION_MAX, "Keep MAV_SENSOR_ROTATION and PX4 Rotation in sync");

static_assert(41 == ROTATION_MAX, "Keep MAV_SENSOR_ROTATION and PX4 Rotation in sync");

static uint16_t cm_uint16_from_m_float(float m)
{
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ PARAM_DEFINE_FLOAT(SENS_DPRES_ANSC, 0);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @group Sensors
*/
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_acc0.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_ACC0_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_acc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_ACC1_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_acc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_ACC2_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_acc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_ACC3_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_gyro0.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_GYRO0_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_gyro1.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_GYRO1_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_gyro2.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_GYRO2_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_gyro3.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_GYRO3_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_mag0.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_MAG0_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_mag1.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_MAG1_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_mag2.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_MAG2_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down
3 changes: 1 addition & 2 deletions src/modules/sensors/sensor_params_mag3.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ PARAM_DEFINE_INT32(CAL_MAG3_PRIO, -1);
* @value 38 Roll 90°, Pitch 68°, Yaw 293°
* @value 39 Pitch 315°
* @value 40 Roll 90°, Pitch 315°
* @value 41 Roll 270°, Yaw 180°
*
* @min -1
* @max 41
* @max 40
* @reboot_required true
* @category system
* @group Sensor Calibration
Expand Down