Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AC_AttitudeControl/AC_WeatherVane.h
Views: 1798
#include <AP_Param/AP_Param.h>12// weather vane class3class AC_WeatherVane {4public:56// Constructor7AC_WeatherVane(void);89CLASS_NO_COPY(AC_WeatherVane);1011// Calculate and return the yaw output to weathervane the vehicle12bool get_yaw_out(float &yaw_output, const int16_t pilot_yaw, const float hgt, const float roll_cdeg, const float pitch_cdeg, const bool is_takeoff, const bool is_landing);1314// Function to reset all flags and set values. Invoked whenever the weather vaning process is interrupted15void reset(void);1617// allow/disallow weather vaning from other means than by the parameter18void allow_weathervaning(bool allow) { allowed = allow; }1920static const struct AP_Param::GroupInfo var_info[];2122private:2324// Different options for the direction that vehicle will turn into wind25enum class Direction {26TAKEOFF_OR_LAND_ONLY = -1,27OFF = 0,28NOSE_IN = 1, // Only nose into wind29NOSE_OR_TAIL_IN = 2, // Nose in or tail into wind, which ever is closest30SIDE_IN = 3, // Side into wind for copter tailsitters31TAIL_IN = 4, // backwards, for tailsitters, makes it easier to descend32};3334enum class Options {35PITCH_ENABLE = (1<<0),36};3738// Parameters39AP_Int8 _direction;40AP_Float _gain;41AP_Float _min_dz_ang_deg;42AP_Float _min_height;43AP_Float _max_vel_xy;44AP_Float _max_vel_z;45AP_Int8 _landing_direction;46AP_Int8 _takeoff_direction;47AP_Int16 _options;4849float last_output;50bool active_msg_sent;51uint32_t first_activate_ms;52uint32_t last_check_ms;5354// Init to true here to avoid a race between init of RC_channel and weathervane55bool allowed = true;56};575859