mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
added rotation for solos external mag
This commit is contained in:
committed by
Lorenz Meier
parent
f41f60901d
commit
94bfad5057
@@ -239,5 +239,15 @@ rotate_3f(enum Rotation rot, float &x, float &y, float &z)
|
|||||||
y = -z; z = -tmp;
|
y = -z; z = -tmp;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ROTATION_YAW_293_PITCH_68_ROLL_90: {
|
||||||
|
float tmpx = x;
|
||||||
|
float tmpy = y;
|
||||||
|
float tmpz = z;
|
||||||
|
x = 0.143039f * tmpx + 0.368776f * tmpy + -0.918446f * tmpz;
|
||||||
|
y = -0.332133f * tmpx + -0.856289f * tmpy + -0.395546f * tmpz;
|
||||||
|
z = -0.932324f * tmpx + 0.361625f * tmpy + 0.000000f * tmpz;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ enum Rotation {
|
|||||||
ROTATION_ROLL_180_PITCH_270 = 27,
|
ROTATION_ROLL_180_PITCH_270 = 27,
|
||||||
ROTATION_PITCH_90_YAW_180 = 28,
|
ROTATION_PITCH_90_YAW_180 = 28,
|
||||||
ROTATION_PITCH_90_ROLL_90 = 29,
|
ROTATION_PITCH_90_ROLL_90 = 29,
|
||||||
|
ROTATION_YAW_293_PITCH_68_ROLL_90 = 30,
|
||||||
ROTATION_MAX
|
ROTATION_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -117,7 +118,7 @@ const rot_lookup_t rot_lookup[] = {
|
|||||||
{270, 0, 270 },
|
{270, 0, 270 },
|
||||||
{180, 270, 0 },
|
{180, 270, 0 },
|
||||||
{ 0, 90, 180 },
|
{ 0, 90, 180 },
|
||||||
{ 90, 90, 0 }
|
{ 90, 68, 293 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user