Skip to content

Commit

Permalink
AP_ExternalAHRS: Clarify public interface design intent
Browse files Browse the repository at this point in the history
* Discussions with Tridge on design intent for these accessors

Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 authored and tridge committed Nov 28, 2023
1 parent d9d5e91 commit be668dd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,22 @@ class AP_ExternalAHRS_backend {
// Get model/type name
virtual const char* get_name() const = 0;

// accessors for AP_AHRS
// Accessors for AP_AHRS

// If not healthy, none of the other API's can be trusted.
// Example: Serial cable is severed.
virtual bool healthy(void) const = 0;
// The communication interface is up and the device has sent valid data.
virtual bool initialised(void) const = 0;
virtual bool pre_arm_check(char *failure_msg, uint8_t failure_msg_len) const = 0;
virtual void get_filter_status(nav_filter_status &status) const {}
virtual void send_status_report(class GCS_MAVLINK &link) const {}

// check for new data
// Check for new data.
// This is used when there's not a separate thread for EAHRS.
// This can also copy interim state protected by locking.
virtual void update() = 0;

protected:
AP_ExternalAHRS::state_t &state;
uint16_t get_rate(void) const;
Expand Down

0 comments on commit be668dd

Please sign in to comment.