APM:Libraries
AP_SpdHgtControl.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 /*
7  This defines a generic interface for speed & height controllers. Each
8  specific controller should be a subclass of this generic
9  interface. All variables used by controllers should be in their
10  own class.
11  */
12 
13 #include <AP_Common/AP_Common.h>
14 #include <AP_Param/AP_Param.h>
15 #include <DataFlash/DataFlash.h>
16 #include <AP_Vehicle/AP_Vehicle.h>
17 
19 public:
20  // Update the internal state of the height and height rate estimator
21  // Update of the inertial speed rate estimate internal state
22  // Should be called at 50Hz or faster
23  virtual void update_50hz(void) = 0;
24 
25 
26  // Update of the pitch and throttle demands
27  // Should be called at 10Hz or faster
28  virtual void update_pitch_throttle( int32_t hgt_dem_cm,
29  int32_t EAS_dem_cm,
30  enum AP_Vehicle::FixedWing::FlightStage flight_stage,
31  float distance_beyond_land_wp,
32  int32_t ptchMinCO_cd,
33  int16_t throttle_nudge,
34  float hgt_afe,
35  float load_factor) = 0;
36 
37  // demanded throttle in percentage
38  // should return 0 to 100
39  virtual int32_t get_throttle_demand(void)=0;
40 
41  // demanded pitch angle in centi-degrees
42  // should return -9000 to +9000
43  virtual int32_t get_pitch_demand(void)=0;
44 
45  // Rate of change of velocity along X body axis in m/s^2
46  virtual float get_VXdot(void)=0;
47 
48  // return current target airspeed
49  virtual float get_target_airspeed(void) const = 0;
50 
51  // return maximum climb rate
52  virtual float get_max_climbrate(void) const = 0;
53 
54  // added to let SoaringController reset pitch integrator to zero
55  virtual void reset_pitch_I(void) = 0;
56 
57  // return landing sink rate
58  virtual float get_land_sinkrate(void) const = 0;
59 
60  // return landing airspeed
61  virtual float get_land_airspeed(void) const = 0;
62 
63  // set path_proportion accessor
64  virtual void set_path_proportion(float path_proportion) = 0;
65 
66  // add new controllers to this enum. Users can then
67  // select which controller to use by setting the
68  // SPDHGT_CONTROLLER parameter
71  };
72 
73 
74 };
virtual void reset_pitch_I(void)=0
virtual float get_land_sinkrate(void) const =0
virtual float get_VXdot(void)=0
virtual float get_land_airspeed(void) const =0
A system for managing and storing variables that are of general interest to the system.
virtual void set_path_proportion(float path_proportion)=0
virtual void update_50hz(void)=0
virtual void update_pitch_throttle(int32_t hgt_dem_cm, int32_t EAS_dem_cm, enum AP_Vehicle::FixedWing::FlightStage flight_stage, float distance_beyond_land_wp, int32_t ptchMinCO_cd, int16_t throttle_nudge, float hgt_afe, float load_factor)=0
virtual float get_max_climbrate(void) const =0
virtual int32_t get_pitch_demand(void)=0
virtual int32_t get_throttle_demand(void)=0
Common definitions and utility routines for the ArduPilot libraries.
virtual float get_target_airspeed(void) const =0