Path: blob/master/libraries/AC_InputManager/AC_InputManager_Heli.h
9316 views
#pragma once12/// @file AC_InputManager_Heli.h3/// @brief Pilot manual control input library for Conventional Helicopter45#include <AP_Param/AP_Param.h>6#include <AP_Common/AP_Common.h>7#include "AC_InputManager.h"89# define AC_ATTITUDE_HELI_STAB_COLLECTIVE_MIN_DEFAULT 010# define AC_ATTITUDE_HELI_STAB_COLLECTIVE_LOW_DEFAULT 4011# define AC_ATTITUDE_HELI_STAB_COLLECTIVE_HIGH_DEFAULT 6012# define AC_ATTITUDE_HELI_STAB_COLLECTIVE_MAX_DEFAULT 1001314/// @class AP_InputManager_Heli15/// @brief Class managing the pilot's control inputs for Conventional Helicopter16class AC_InputManager_Heli : public AC_InputManager {17public:18// Constructor19AC_InputManager_Heli()20: AC_InputManager()21{22// setup parameter defaults23AP_Param::setup_object_defaults(this, var_info);24}2526/* Do not allow copies */27CLASS_NO_COPY(AC_InputManager_Heli);2829//pass the last collective output from non-manual throttle mode30void set_last_coll_output(float collective) { _old_flightmode_col_output = collective; }3132// get_pilot_desired_collective - rescale's pilot collective pitch input in Stabilize and Acro modes33float get_pilot_desired_collective(int16_t control_in);3435// set_use_stab_col - setter function36void set_use_stab_col(bool use) { _im_flags_heli.use_stab_col = use; }3738// set collective_ramp - setter function39void set_collective_ramp(float ramp) { _ramp = constrain_float(ramp, 0.0, 1.0); }4041// parameter_check - returns true if input manager specific parameters are sensible, used for pre-arm check42bool parameter_check(char* fail_msg, uint8_t fail_msg_len) const;4344static const struct AP_Param::GroupInfo var_info[];4546private:47struct InputManagerHeliFlags {48bool use_stab_col; // 1 if we should use Stabilise mode collective range, 0 for Acro range49} _im_flags_heli;5051// previous flight mode collective output52float _old_flightmode_col_output;5354// ramp factor from previous mode to current mode collective output55float _ramp;5657AP_Int16 _heli_stab_col_min; // minimum collective pitch setting at zero throttle input in Stabilize mode58AP_Int16 _heli_stab_col_low; // collective pitch setting at mid-low throttle input in Stabilize mode59AP_Int16 _heli_stab_col_high; // collective pitch setting at mid-high throttle input in Stabilize mode60AP_Int16 _heli_stab_col_max; // maximum collective pitch setting at full throttle input in Stabilize mode61AP_Float _acro_col_expo; // used to soften collective pitch inputs near center point in Acro mode6263};646566