mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-08 17:03:57 -04:00
AP_NavEKF2: add static create method
This commit is contained in:
parent
6781a44046
commit
3c04f4e4d1
@ -34,13 +34,23 @@
|
|||||||
class NavEKF2_core;
|
class NavEKF2_core;
|
||||||
class AP_AHRS;
|
class AP_AHRS;
|
||||||
|
|
||||||
class NavEKF2
|
class NavEKF2 {
|
||||||
{
|
|
||||||
public:
|
|
||||||
friend class NavEKF2_core;
|
friend class NavEKF2_core;
|
||||||
static const struct AP_Param::GroupInfo var_info[];
|
|
||||||
|
|
||||||
NavEKF2(const AP_AHRS *ahrs, AP_Baro &baro, const RangeFinder &rng);
|
public:
|
||||||
|
static NavEKF2 create(const AP_AHRS *ahrs,
|
||||||
|
AP_Baro &baro,
|
||||||
|
const RangeFinder &rng) {
|
||||||
|
return NavEKF2{ahrs, baro, rng};
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr NavEKF2(NavEKF2 &&other) = default;
|
||||||
|
|
||||||
|
/* Do not allow copies */
|
||||||
|
NavEKF2(const NavEKF2 &other) = delete;
|
||||||
|
NavEKF2 &operator=(const NavEKF2&) = 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 {
|
||||||
@ -318,8 +328,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:
|
||||||
|
NavEKF2(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
|
||||||
NavEKF2_core *core = nullptr;
|
NavEKF2_core *core = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user