1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #pragma once
- #include "stdint.h"
- #include <AP_Param/AP_Param.h>
- #include <AP_Math/AP_Math.h>
- #include <AP_Common/Location.h>
- namespace SITL {
- class SIM_Precland {
- public:
- SIM_Precland() {
- AP_Param::setup_object_defaults(this, var_info);
- };
-
- void update(const Location &loc, const Vector3f &position);
-
- bool healthy() const { return _healthy; }
-
- uint32_t last_update_ms() const { return _last_update_ms; }
- const Vector3f &get_target_position() const { return _target_pos; }
- bool is_enabled() const {return static_cast<bool>(_enable);}
- void set_default_location(float lat, float lon, int16_t yaw);
- static const struct AP_Param::GroupInfo var_info[];
- AP_Int8 _enable;
- AP_Float _origin_lat;
- AP_Float _origin_lon;
- AP_Float _origin_height;
- AP_Int16 _orient_yaw;
- AP_Int8 _type;
- AP_Int32 _rate;
- AP_Float _alt_limit;
- AP_Float _dist_limit;
- enum PreclandType {
- PRECLAND_TYPE_CYLINDER = 0,
- PRECLAND_TYPE_CONE = 1,
- PRECLAND_TYPE_SPHERE = 2,
- };
- private:
- uint32_t _last_update_ms;
- bool _healthy;
- Vector3f _target_pos;
- };
- }
|