Skip to content

Commit

Permalink
AP_AHRS: log attitude target at full resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per committed Aug 31, 2024
1 parent 857588c commit 94b7c59
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
32 changes: 16 additions & 16 deletions libraries/AP_AHRS/AP_AHRS_Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ void AP_AHRS::Write_Attitude(const Vector3f &targets, uint64_t sample_time_us) c
const struct log_Attitude pkt{
LOG_PACKET_HEADER_INIT(LOG_ATTITUDE_MSG),
time_us : sample_time_us,
control_roll : (int16_t)targets.x,
roll : (int16_t)roll_sensor,
control_pitch : (int16_t)targets.y,
pitch : (int16_t)pitch_sensor,
control_yaw : (uint16_t)wrap_360_cd(targets.z),
yaw : (uint16_t)wrap_360_cd(yaw_sensor),
error_rp : (uint16_t)(get_error_rp() * 100),
error_yaw : (uint16_t)(get_error_yaw() * 100),
control_roll : targets.x,
roll : roll_sensor,
control_pitch : targets.y,
pitch : pitch_sensor,
control_yaw : wrap_360_cd(targets.z),
yaw : wrap_360_cd(yaw_sensor),
error_rp : (get_error_rp() * 100),
error_yaw : (get_error_yaw() * 100),
active : uint8_t(active_EKF_type()),
};
AP::logger().WriteBlock(&pkt, sizeof(pkt));
Expand Down Expand Up @@ -130,14 +130,14 @@ void AP_AHRS_View::Write_AttitudeView(const Vector3f &targets, uint64_t sample_t
const struct log_Attitude pkt{
LOG_PACKET_HEADER_INIT(LOG_ATTITUDE_MSG),
time_us : sample_time_us,
control_roll : (int16_t)targets.x,
roll : (int16_t)roll_sensor,
control_pitch : (int16_t)targets.y,
pitch : (int16_t)pitch_sensor,
control_yaw : (uint16_t)wrap_360_cd(targets.z),
yaw : (uint16_t)wrap_360_cd(yaw_sensor),
error_rp : (uint16_t)(get_error_rp() * 100),
error_yaw : (uint16_t)(get_error_yaw() * 100),
control_roll : targets.x,
roll : roll_sensor,
control_pitch : targets.y,
pitch : pitch_sensor,
control_yaw : wrap_360_cd(targets.z),
yaw : wrap_360_cd(yaw_sensor),
error_rp : (get_error_rp() * 100),
error_yaw : (get_error_yaw() * 100),
active : uint8_t(AP::ahrs().active_EKF_type()),
};
AP::logger().WriteBlock(&pkt, sizeof(pkt));
Expand Down
18 changes: 9 additions & 9 deletions libraries/AP_AHRS/LogStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ struct PACKED log_AOA_SSA {
struct PACKED log_Attitude {
LOG_PACKET_HEADER;
uint64_t time_us;
int16_t control_roll;
int16_t roll;
int16_t control_pitch;
int16_t pitch;
uint16_t control_yaw;
uint16_t yaw;
uint16_t error_rp;
uint16_t error_yaw;
float control_roll;
int32_t roll;
float control_pitch;
int32_t pitch;
float control_yaw;
int32_t yaw;
float error_rp;
float error_yaw;
uint8_t active;
};

Expand Down Expand Up @@ -165,7 +165,7 @@ struct PACKED log_ATSC {
{ LOG_AOA_SSA_MSG, sizeof(log_AOA_SSA), \
"AOA", "Qff", "TimeUS,AOA,SSA", "sdd", "F00" , true }, \
{ LOG_ATTITUDE_MSG, sizeof(log_Attitude),\
"ATT", "QccccCCCCB", "TimeUS,DesRoll,Roll,DesPitch,Pitch,DesYaw,Yaw,ErrRP,ErrYaw,AEKF", "sddddhhdh-", "FBBBBBBBB-" , true }, \
"ATT", "QfifififfB", "TimeUS,DesRoll,Roll,DesPitch,Pitch,DesYaw,Yaw,ErrRP,ErrYaw,AEKF", "sddddhhdh-", "FBBBBBBBB-" , true }, \
{ LOG_ORGN_MSG, sizeof(log_ORGN), \
"ORGN","QBLLe","TimeUS,Type,Lat,Lng,Alt", "s#DUm", "F-GGB" }, \
{ LOG_POS_MSG, sizeof(log_POS), \
Expand Down

0 comments on commit 94b7c59

Please sign in to comment.