mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-28 02:33:58 -04:00
AP_Rally: add static create method
This commit is contained in:
parent
c6eb48009b
commit
2f2abc2924
@ -35,9 +35,16 @@ struct PACKED RallyLocation {
|
|||||||
/// @class AP_Rally
|
/// @class AP_Rally
|
||||||
/// @brief Object managing Rally Points
|
/// @brief Object managing Rally Points
|
||||||
class AP_Rally {
|
class AP_Rally {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AP_Rally(AP_AHRS &ahrs);
|
static AP_Rally create(AP_AHRS &ahrs) {
|
||||||
|
return AP_Rally{ahrs};
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr AP_Rally(AP_Rally &&other) = default;
|
||||||
|
|
||||||
|
/* Do not allow copies */
|
||||||
|
AP_Rally(const AP_Rally &other) = delete;
|
||||||
|
AP_Rally &operator=(const AP_Rally&) = delete;
|
||||||
|
|
||||||
// data handling
|
// data handling
|
||||||
bool get_rally_point_with_index(uint8_t i, RallyLocation &ret) const;
|
bool get_rally_point_with_index(uint8_t i, RallyLocation &ret) const;
|
||||||
@ -46,7 +53,7 @@ public:
|
|||||||
uint8_t get_rally_max(void) const { return _storage.size() / AP_RALLY_WP_SIZE; }
|
uint8_t get_rally_max(void) const { return _storage.size() / AP_RALLY_WP_SIZE; }
|
||||||
|
|
||||||
float get_rally_limit_km() const { return _rally_limit_km; }
|
float get_rally_limit_km() const { return _rally_limit_km; }
|
||||||
|
|
||||||
Location rally_location_to_location(const RallyLocation &ret) const;
|
Location rally_location_to_location(const RallyLocation &ret) const;
|
||||||
|
|
||||||
// logic handling
|
// logic handling
|
||||||
@ -59,6 +66,9 @@ public:
|
|||||||
// parameter block
|
// parameter block
|
||||||
static const struct AP_Param::GroupInfo var_info[];
|
static const struct AP_Param::GroupInfo var_info[];
|
||||||
|
|
||||||
|
protected:
|
||||||
|
AP_Rally(AP_AHRS &ahrs);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool is_valid(const Location &rally_point) const { return true; }
|
virtual bool is_valid(const Location &rally_point) const { return true; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user