AP_NavEKF3: add static create method
This commit is contained in:
parent
e2fe36357a
commit
bd6145af6d
@ -31,13 +31,23 @@
|
|||||||
class NavEKF3_core;
|
class NavEKF3_core;
|
||||||
class AP_AHRS;
|
class AP_AHRS;
|
||||||
|
|
||||||
class NavEKF3
|
class NavEKF3 {
|
||||||
{
|
|
||||||
public:
|
|
||||||
friend class NavEKF3_core;
|
friend class NavEKF3_core;
|
||||||
static const struct AP_Param::GroupInfo var_info[];
|
|
||||||
|
|
||||||
NavEKF3(const AP_AHRS *ahrs, AP_Baro &baro, const RangeFinder &rng);
|
public:
|
||||||
|
static NavEKF3 create(const AP_AHRS *ahrs,
|
||||||
|
AP_Baro &baro,
|
||||||
|
const RangeFinder &rng) {
|
||||||
|
return NavEKF3{ahrs, baro, rng};
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr NavEKF3(NavEKF3 &&other) = default;
|
||||||
|
|
||||||
|
/* Do not allow copies */
|
||||||
|
NavEKF3(const NavEKF3 &other) = delete;
|
||||||
|
NavEKF3 &operator=(const NavEKF3&) = delete;
|
||||||
|
|
||||||
|
static const struct AP_Param::GroupInfo var_info[];
|
||||||
|
|
||||||
// allow logging to determine the number of active cores
|
// allow logging to determine the number of active cores
|
||||||
uint8_t activeCores(void) const {
|
uint8_t activeCores(void) const {
|
||||||
@ -349,8 +359,10 @@ public:
|
|||||||
|
|
||||||
// get timing statistics structure
|
// get timing statistics structure
|
||||||
void getTimingStatistics(int8_t instance, struct ekf_timing &timing);
|
void getTimingStatistics(int8_t instance, struct ekf_timing &timing);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
NavEKF3(const AP_AHRS *ahrs, AP_Baro &baro, const RangeFinder &rng);
|
||||||
|
|
||||||
uint8_t num_cores; // number of allocated cores
|
uint8_t num_cores; // number of allocated cores
|
||||||
uint8_t primary; // current primary core
|
uint8_t primary; // current primary core
|
||||||
NavEKF3_core *core = nullptr;
|
NavEKF3_core *core = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user