Skip to content

Commit

Permalink
AP_ExternalAHRS: link in CINS param table
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed May 9, 2024
1 parent a3e4c07 commit c9e1e57
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
9 changes: 8 additions & 1 deletion libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ const AP_Param::GroupInfo AP_ExternalAHRS::var_info[] = {
// @Units: Hz
// @User: Standard
AP_GROUPINFO("_LOG_RATE", 5, AP_ExternalAHRS, log_rate, 10),

#if AP_EXTERNAL_AHRS_CINS_ENABLED
// @Group: _CINS_
// @Path: ../AP_CINS/AP_CINS.cpp
AP_SUBGROUPPTR(cins_ptr, "_CINS_", 6, AP_ExternalAHRS, AP_CINS),
#endif


AP_GROUPEND
};
Expand Down Expand Up @@ -133,7 +140,7 @@ void AP_ExternalAHRS::init(void)

#if AP_EXTERNAL_AHRS_CINS_ENABLED
case DevType::CINS:
backend = new AP_ExternalAHRS_CINS(this, state);
backend = new AP_ExternalAHRS_CINS(this, state, cins_ptr);
return;
#endif

Expand Down
8 changes: 8 additions & 0 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include <AP_Common/Location.h>
#include <AP_NavEKF/AP_Nav_Common.h>

#if AP_EXTERNAL_AHRS_CINS_ENABLED
class AP_CINS;
#endif

class AP_ExternalAHRS_backend;

class AP_ExternalAHRS {
Expand Down Expand Up @@ -203,6 +207,10 @@ class AP_ExternalAHRS {

// true when user has disabled the GNSS
bool gnss_is_disabled;

#if AP_EXTERNAL_AHRS_CINS_ENABLED
AP_CINS *cins_ptr;
#endif
};

namespace AP {
Expand Down
4 changes: 3 additions & 1 deletion libraries/AP_ExternalAHRS/AP_ExternalAHRS_CINS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@

// constructor
AP_ExternalAHRS_CINS::AP_ExternalAHRS_CINS(AP_ExternalAHRS *_frontend,
AP_ExternalAHRS::state_t &_state) :
AP_ExternalAHRS::state_t &_state,
AP_CINS *&cins_ptr) :
AP_ExternalAHRS_backend(_frontend, _state)
{
cins_ptr = &cins;
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "CINS Started");
cins.init();
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_ExternalAHRS/AP_ExternalAHRS_CINS.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class AP_ExternalAHRS_CINS : public AP_ExternalAHRS_backend {

public:
AP_ExternalAHRS_CINS(AP_ExternalAHRS *frontend, AP_ExternalAHRS::state_t &state);
AP_ExternalAHRS_CINS(AP_ExternalAHRS *frontend, AP_ExternalAHRS::state_t &state, AP_CINS *&cins_ptr);

// accessors for AP_AHRS
bool healthy(void) const override {
Expand Down

0 comments on commit c9e1e57

Please sign in to comment.