mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 04:33:33 +08:00
conversion: added rotation +45 degree in pitch
This commit is contained in:
committed by
Lorenz Meier
parent
11e3081efd
commit
add20389f6
@@ -265,5 +265,12 @@ rotate_3f(enum Rotation rot, float &x, float &y, float &z)
|
||||
z = -0.156434f * tmpx + 0.000000f * tmpy + 0.987688f * tmpz;
|
||||
return;
|
||||
}
|
||||
|
||||
case ROTATION_PITCH_45: {
|
||||
tmp = HALF_SQRT_2 * x + HALF_SQRT_2 * z;
|
||||
z = HALF_SQRT_2 * z - HALF_SQRT_2 * x;
|
||||
x = tmp;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ enum Rotation {
|
||||
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_MAX
|
||||
};
|
||||
|
||||
@@ -124,6 +125,7 @@ const rot_lookup_t rot_lookup[] = {
|
||||
{ 90, 68, 293 },
|
||||
{270, 90, 0 },
|
||||
{ 0, 9, 180 },
|
||||
{ 0, 45, 0 },
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user