|
|
|
@ -39,15 +39,20 @@ AP_AHRS_View::AP_AHRS_View(AP_AHRS &_ahrs, enum Rotation _rotation, float pitch_
@@ -39,15 +39,20 @@ AP_AHRS_View::AP_AHRS_View(AP_AHRS &_ahrs, enum Rotation _rotation, float pitch_
|
|
|
|
|
AP_HAL::panic("Unsupported AHRS view %u\n", (unsigned)rotation); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_pitch_trim_deg = pitch_trim_deg; |
|
|
|
|
// Add pitch trim
|
|
|
|
|
y_angle = wrap_360(y_angle + pitch_trim_deg); |
|
|
|
|
|
|
|
|
|
rot_view.from_euler(0, radians(y_angle), 0); |
|
|
|
|
rot_view.from_euler(0, radians(wrap_360(y_angle + pitch_trim_deg)), 0); |
|
|
|
|
|
|
|
|
|
// setup initial state
|
|
|
|
|
update(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// apply pitch trim
|
|
|
|
|
void AP_AHRS_View::set_pitch_trim(float trim_deg) { |
|
|
|
|
_pitch_trim_deg = trim_deg;
|
|
|
|
|
rot_view.from_euler(0, radians(wrap_360(y_angle + _pitch_trim_deg)), 0); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// update state
|
|
|
|
|
void AP_AHRS_View::update(bool skip_ins_update) |
|
|
|
|
{ |
|
|
|
|