AP_ExternalAHRS: Change to Boolean value

This commit is contained in:
muramura 2023-09-24 18:00:11 +09:00 committed by Randy Mackay
parent f3914dfc16
commit 45fc140e1d
2 changed files with 20 additions and 20 deletions

View File

@ -245,20 +245,20 @@ void AP_ExternalAHRS_MicroStrain5::get_filter_status(nav_filter_status &status)
{
memset(&status, 0, sizeof(status));
if (last_ins_pkt != 0 && last_gps_pkt != 0) {
status.flags.initalized = 1;
status.flags.initalized = true;
}
if (healthy() && last_ins_pkt != 0) {
status.flags.attitude = 1;
status.flags.vert_vel = 1;
status.flags.vert_pos = 1;
status.flags.attitude = true;
status.flags.vert_vel = true;
status.flags.vert_pos = true;
if (gnss_data.fix_type >= 3) {
status.flags.horiz_vel = 1;
status.flags.horiz_pos_rel = 1;
status.flags.horiz_pos_abs = 1;
status.flags.pred_horiz_pos_rel = 1;
status.flags.pred_horiz_pos_abs = 1;
status.flags.using_gps = 1;
status.flags.horiz_vel = true;
status.flags.horiz_pos_rel = true;
status.flags.horiz_pos_abs = true;
status.flags.pred_horiz_pos_rel = true;
status.flags.pred_horiz_pos_abs = true;
status.flags.using_gps = true;
}
}
}

View File

@ -744,21 +744,21 @@ void AP_ExternalAHRS_VectorNav::get_filter_status(nav_filter_status &status) con
memset(&status, 0, sizeof(status));
if (type == TYPE::VN_300) {
if (last_pkt1 && last_pkt2) {
status.flags.initalized = 1;
status.flags.initalized = true;
}
if (healthy() && last_pkt2) {
status.flags.attitude = 1;
status.flags.vert_vel = 1;
status.flags.vert_pos = 1;
status.flags.attitude = true;
status.flags.vert_vel = true;
status.flags.vert_pos = true;
const struct VN_packet2 &pkt2 = *last_pkt2;
if (pkt2.GPS1Fix >= 3) {
status.flags.horiz_vel = 1;
status.flags.horiz_pos_rel = 1;
status.flags.horiz_pos_abs = 1;
status.flags.pred_horiz_pos_rel = 1;
status.flags.pred_horiz_pos_abs = 1;
status.flags.using_gps = 1;
status.flags.horiz_vel = true;
status.flags.horiz_pos_rel = true;
status.flags.horiz_pos_abs = true;
status.flags.pred_horiz_pos_rel = true;
status.flags.pred_horiz_pos_abs = true;
status.flags.using_gps = true;
}
}
} else {