Skip to content

Commit

Permalink
AP_ExternalAHRS: Added filter updates for advanced navigation devices
Browse files Browse the repository at this point in the history
When running EAHRS update it will now check for flight mode and gnss enable and request the appropriate changes in the device filter.
  • Loading branch information
AN-DanielCook committed Feb 26, 2024
1 parent 4cc24d0 commit 8d2d80b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS_AdvancedNavigation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,19 @@ bool AP_ExternalAHRS_AdvancedNavigation::request_data(void)
}
}

// check for updates to environment that require INS filter updates
if (_fly_forward != in_fly_forward() || _gnss_disable != gnss_is_disabled()){
_fly_forward = in_fly_forward();
_gnss_disable = gnss_is_disabled();

// Select AdNav vehicle for current flight mode.
vehicle_type_e vehicle_type = vehicle_type_3d_aircraft;
if (_fly_forward == true) {
vehicle_type = vehicle_type_fixed_wing_plane;
}

set_filter_options(!_gnss_disable, vehicle_type);
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ class AP_ExternalAHRS_AdvancedNavigation: public AP_ExternalAHRS_backend
uint32_t _last_raw_gnss_pkt_ms;
uint32_t _device_id;
uint32_t _hardware_rev;

bool _gnss_disable;
bool _fly_forward;

void update_thread();
bool get_packets(void);
Expand Down

0 comments on commit 8d2d80b

Please sign in to comment.