mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 20:48:33 -04:00
Plane: avoid copying the DCM matrix
This commit is contained in:
parent
703a1ba438
commit
55f7d18979
@ -119,9 +119,9 @@ static void calc_gndspeed_undershoot()
|
||||
// This prevents flyaway if wind takes plane backwards
|
||||
if (g_gps && g_gps->status() >= GPS::GPS_OK_FIX_2D) {
|
||||
Vector2f gndVel = ahrs.groundspeed_vector();
|
||||
Matrix3f rotMat = ahrs.get_dcm_matrix();
|
||||
const Matrix3f &rotMat = ahrs.get_dcm_matrix();
|
||||
Vector2f yawVect = Vector2f(rotMat.a.x,rotMat.b.x);
|
||||
yawVect = (yawVect).normalized();
|
||||
yawVect.normalize();
|
||||
float gndSpdFwd = yawVect * gndVel;
|
||||
groundspeed_undershoot = (g.min_gndspeed_cm > 0) ? (g.min_gndspeed_cm - gndSpdFwd*100) : 0;
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ test_mag(uint8_t argc, const Menu::arg *argv)
|
||||
if(medium_loopCounter == 5) {
|
||||
if (compass.read()) {
|
||||
// Calculate heading
|
||||
Matrix3f m = ahrs.get_dcm_matrix();
|
||||
const Matrix3f &m = ahrs.get_dcm_matrix();
|
||||
heading = compass.calculate_heading(m);
|
||||
compass.null_offsets();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user