]> git.mxchange.org Git - flightgear.git/blob - src/Autopilot/autopilot.hxx
source tree reorganization prior to flightgear 0.7
[flightgear.git] / src / Autopilot / autopilot.hxx
1 // autopilot.hxx -- autopilot defines and prototypes (very alpha)
2 //
3 // Written by Jeff Goeke-Smith, started April 1998.
4 //
5 // Copyright (C) 1998 Jeff Goeke-Smith  - jgoeke@voyager.net
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22                        
23                        
24 #ifndef _AUTOPILOT_HXX
25 #define _AUTOPILOT_HXX
26                        
27
28 #include <Aircraft/aircraft.hxx>
29 #include <FDM/flight.hxx>
30 #include <Controls/controls.hxx>
31                        
32                        
33 // Structures
34 typedef struct {
35     bool heading_hold;   // the current state of the heading hold
36     bool altitude_hold;  // the current state of the altitude hold
37     bool terrain_follow; // the current state of the terrain follower
38     bool auto_throttle;  // the current state of the auto throttle
39
40     double TargetHeading;     // the heading the AP should steer to.
41     double TargetAltitude;    // altitude to hold
42     double TargetAGL;         // the terrain separation
43     double TargetClimbRate;   // climb rate to shoot for
44     double TargetSpeed;       // speed to shoot for
45     double alt_error_accum;   // altitude error accumulator
46     double speed_error_accum; // speed error accumulator
47
48     double TargetSlope; // the glide slope hold value
49     
50     double MaxRoll ; // the max the plane can roll for the turn
51     double RollOut;  // when the plane should roll out
52     // measured from Heading
53     double MaxAileron; // how far to move the aleroin from center
54     double RollOutSmooth; // deg to use for smoothing Aileron Control
55     double MaxElevator; // the maximum elevator allowed
56     double SlopeSmooth; // smoothing angle for elevator
57     
58 } fgAPData, *fgAPDataPtr ;
59                 
60
61 // Defines
62 #define AP_CURRENT_HEADING -1
63
64
65 // prototypes
66 void fgAPInit( fgAIRCRAFT *current_aircraft );
67 int fgAPRun( void );
68
69 void fgAPToggleHeading( void );
70 void fgAPToggleAltitude( void );
71 void fgAPToggleTerrainFollow( void );
72 void fgAPToggleAutoThrottle( void );
73
74 bool fgAPTerrainFollowEnabled( void );
75 bool fgAPAltitudeEnabled( void );
76 bool fgAPHeadingEnabled( void );
77 bool fgAPAutoThrottleEnabled( void );
78
79 void fgAPAltitudeAdjust( double inc );
80 void fgAPHeadingAdjust( double inc );
81 void fgAPAutoThrottleAdjust( double inc );
82
83 void fgAPHeadingSet( double value );
84
85 void fgAPReset(void);
86
87 class puObject;
88 void fgAPAdjust( puObject * );
89
90 #endif // _AUTOPILOT_HXX
91
92