1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1317 Added better comments on the function of the partial calculation of the rotation matrix. And added a remark on the debuging variable in the airspeed object definition

This commit is contained in:
Andres 2014-05-13 17:30:50 +02:00
parent 530c0aa967
commit c5372dd0b4
3 changed files with 14 additions and 6 deletions

View File

@ -194,7 +194,8 @@ void Quaternion2R(float q[4], float Rbe[3][3])
}
// ** Find x of body frame from quaternion **
// ** Find first row of Rbe, that rotates a vector from earth fixed to body frame, from quaternion **
// ** This vector corresponds to the fuselage/roll vector xB **
void QuaternionC2xB(const float q0, const float q1, const float q2, const float q3, float x[3])
{
const float q0s = q0 * q0, q1s = q1 * q1, q2s = q2 * q2, q3s = q3 * q3;
@ -211,7 +212,8 @@ void Quaternion2xB(const float q[4], float x[3])
}
// ** Find y of body frame from quaternion **
// ** Find second row of Rbe, that rotates a vector from earth fixed to body frame, from quaternion **
// ** This vector corresponds to the spanwise/pitch vector yB **
void QuaternionC2yB(const float q0, const float q1, const float q2, const float q3, float y[3])
{
const float q0s = q0 * q0, q1s = q1 * q1, q2s = q2 * q2, q3s = q3 * q3;
@ -228,7 +230,8 @@ void Quaternion2yB(const float q[4], float y[3])
}
// ** Find z of body frame from quaternion **
// ** Find third row of Rbe, that rotates a vector from earth fixed to body frame, from quaternion **
// ** This vector corresponds to the vertical/yaw vector zB **
void QuaternionC2zB(const float q0, const float q1, const float q2, const float q3, float z[3])
{
const float q0s = q0 * q0, q1s = q1 * q1, q2s = q2 * q2, q3s = q3 * q3;

View File

@ -50,15 +50,18 @@ void RPY2Quaternion(const float rpy[3], float q[4]);
// ** Find Rbe, that rotates a vector from earth fixed to body frame, from quaternion **
void Quaternion2R(float q[4], float Rbe[3][3]);
// ** Find x of body frame from quaternion **
// ** Find first row of Rbe, that rotates a vector from earth fixed to body frame, from quaternion **
// ** This vector corresponds to the fuselage/roll vector xB **
void QuaternionC2xB(const float q0, const float q1, const float q2, const float q3, float x[3]);
void Quaternion2xB(const float q[4], float x[3]);
// ** Find y of body frame from quaternion **
// ** Find second row of Rbe, that rotates a vector from earth fixed to body frame, from quaternion **
// ** This vector corresponds to the spanwise/pitch vector yB **
void QuaternionC2yB(const float q0, const float q1, const float q2, const float q3, float y[3]);
void Quaternion2yB(const float q[4], float y[3]);
// ** Find x of body frame from quaternion **
// ** Find third row of Rbe, that rotates a vector from earth fixed to body frame, from quaternion **
// ** This vector corresponds to the vertical/yaw vector zB **
void QuaternionC2zB(const float q0, const float q1, const float q2, const float q3, float z[3]);
void Quaternion2zB(const float q[4], float z[3]);

View File

@ -7,12 +7,14 @@
<field name="DifferentialPressure" units="Pa" type="float" elements="1"/>
<field name="Temperature" units="K" type="float" elements="1"/>
<field name="CalibratedAirspeed" units="m/s" type="float" elements="1"/>
<!-- For debugin/testng purposes. Should be deleted before merge -->
<field name="f" units="" type="float" elements="3"/>
<field name="v" units="" type="float" elements="3"/>
<field name="df" units="" type="float" elements="3"/>
<field name="dv" units="" type="float" elements="3"/>
<field name="absdf" units="" type="float" elements="1"/>
<field name="dvdotdf" units="" type="float" elements="1"/>
<!-- End of debuging variables-->
<field name="TrueAirspeed" units="m/s" type="float" elements="1" defaultvalue="-1"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>