AP_DAL: fixed handling of AHRS trim

This commit is contained in:
Andrew Tridgell 2020-11-08 15:18:47 +11:00
parent f145afabf3
commit 0e7611cebe
3 changed files with 5 additions and 6 deletions

View File

@ -60,6 +60,7 @@ void AP_DAL::start_frame(AP_DAL::FrameType frametype)
_RFRN.fly_forward = ahrs.get_fly_forward();
_RFRN.ahrs_airspeed_sensor_enabled = AP::ahrs().airspeed_sensor_enabled();
_RFRN.available_memory = hal.util->available_memory();
_RFRN.ahrs_trim = ahrs.get_trim();
WRITE_REPLAY_BLOCK_IFCHANGED(RFRN, _RFRN, old);
// update body conversion
@ -80,8 +81,6 @@ void AP_DAL::start_frame(AP_DAL::FrameType frametype)
_micros = _RFRH.time_us;
_millis = _RFRH.time_us / 1000UL;
_trim = ahrs.get_trim();
force_write = false;
#endif
}

View File

@ -189,9 +189,9 @@ public:
return _RFRN.fly_forward;
}
// get trim
// get ahrs trim
const Vector3f &get_trim() const {
return _trim;
return _RFRN.ahrs_trim;
}
const Matrix3f &get_rotation_vehicle_body_to_autopilot_body(void) const {
@ -322,7 +322,6 @@ private:
uint32_t _micros;
uint32_t _millis;
Vector3f _trim;
Matrix3f _rotation_vehicle_body_to_autopilot_body;
Location _home;
uint32_t _last_imu_time_us;

View File

@ -58,6 +58,7 @@ struct log_RFRN {
int32_t alt;
float EAS2TAS;
uint32_t available_memory;
Vector3f ahrs_trim;
uint8_t vehicle_class;
uint8_t ekf_type;
uint8_t armed:1;
@ -377,7 +378,7 @@ struct log_RBOH {
{ LOG_RFRF_MSG, RLOG_SIZE(RFRF), \
"RFRF", "BB", "FTypes,Slow", "--", "--" }, \
{ LOG_RFRN_MSG, RLOG_SIZE(RFRN), \
"RFRN", "IIIfIBBB", "HLat,HLon,HAlt,E2T,AM,VC,EKT,Flags", "DUm?????", "GGB-----" }, \
"RFRN", "IIIfIfffBBB", "HLat,HLon,HAlt,E2T,AM,TX,TY,TZ,VC,EKT,Flags", "DUm????????", "GGB--------" }, \
{ LOG_REV2_MSG, RLOG_SIZE(REV2), \
"REV2", "B", "Event", "-", "-" }, \
{ LOG_RSO2_MSG, RLOG_SIZE(RSO2), \