mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Mount: add static create method
This commit is contained in:
parent
c3647f0185
commit
563f9bfe89
@ -55,6 +55,16 @@ class AP_Mount
|
|||||||
friend class AP_Mount_SToRM32_serial;
|
friend class AP_Mount_SToRM32_serial;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static AP_Mount create(const AP_AHRS_TYPE &ahrs, const struct Location ¤t_loc) {
|
||||||
|
return AP_Mount{ahrs, current_loc};
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr AP_Mount(AP_Mount &&other) = default;
|
||||||
|
|
||||||
|
/* Do not allow copies */
|
||||||
|
AP_Mount(const AP_Mount &other) = delete;
|
||||||
|
AP_Mount &operator=(const AP_Mount&) = delete;
|
||||||
|
|
||||||
|
|
||||||
// Enums
|
// Enums
|
||||||
enum MountType {
|
enum MountType {
|
||||||
@ -66,9 +76,6 @@ public:
|
|||||||
Mount_Type_SToRM32_serial = 5 /// SToRM32 mount using custom serial protocol
|
Mount_Type_SToRM32_serial = 5 /// SToRM32 mount using custom serial protocol
|
||||||
};
|
};
|
||||||
|
|
||||||
// Constructor
|
|
||||||
AP_Mount(const AP_AHRS_TYPE &ahrs, const struct Location ¤t_loc);
|
|
||||||
|
|
||||||
// init - detect and initialise all mounts
|
// init - detect and initialise all mounts
|
||||||
void init(const AP_SerialManager& serial_manager);
|
void init(const AP_SerialManager& serial_manager);
|
||||||
|
|
||||||
@ -136,6 +143,7 @@ public:
|
|||||||
static const struct AP_Param::GroupInfo var_info[];
|
static const struct AP_Param::GroupInfo var_info[];
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
AP_Mount(const AP_AHRS_TYPE &ahrs, const struct Location ¤t_loc);
|
||||||
|
|
||||||
// private members
|
// private members
|
||||||
const AP_AHRS_TYPE &_ahrs;
|
const AP_AHRS_TYPE &_ahrs;
|
||||||
|
Loading…
Reference in New Issue
Block a user