]> git.mxchange.org Git - flightgear.git/blob - Simulator/Autopilot/autopilot.hxx
Merge FG_Simulator as subdirectory
[flightgear.git] / Simulator / 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 // (Log is kept at end of this file)
23                        
24                        
25 #ifndef _AUTOPILOT_HXX
26 #define _AUTOPILOT_HXX
27                        
28
29 #include <Aircraft/aircraft.hxx>
30 #include <FDM/flight.hxx>
31 #include <Controls/controls.hxx>
32                        
33                        
34 // Structures
35 typedef struct {
36     bool heading_hold;   // the current state of the heading hold
37     bool altitude_hold;  // the current state of the altitude hold
38     bool terrain_follow; // the current state of the terrain follower
39     bool auto_throttle;  // the current state of the auto throttle
40
41     double TargetHeading;     // the heading the AP should steer to.
42     double TargetAltitude;    // altitude to hold
43     double TargetAGL;         // the terrain separation
44     double TargetClimbRate;   // climb rate to shoot for
45     double TargetSpeed;       // speed to shoot for
46     double alt_error_accum;   // altitude error accumulator
47     double speed_error_accum; // speed error accumulator
48
49     double TargetSlope; // the glide slope hold value
50     
51     double MaxRoll ; // the max the plane can roll for the turn
52     double RollOut;  // when the plane should roll out
53     // measured from Heading
54     double MaxAileron; // how far to move the aleroin from center
55     double RollOutSmooth; // deg to use for smoothing Aileron Control
56     double MaxElevator; // the maximum elevator allowed
57     double SlopeSmooth; // smoothing angle for elevator
58     
59 } fgAPData, *fgAPDataPtr ;
60                 
61
62 // Defines
63 #define AP_CURRENT_HEADING -1
64
65
66 // prototypes
67 void fgAPInit( fgAIRCRAFT *current_aircraft );
68 int fgAPRun( void );
69 void fgAPToggleHeading( void );
70 void fgAPToggleAltitude( void );
71 void fgAPToggleTerrainFollow( void );
72 void fgAPToggleAutoThrottle( void );
73
74 bool fgAPAltitudeEnabled( void );
75 bool fgAPHeadingEnabled( void );
76 bool fgAPAutoThrottleEnabled( void );
77 void fgAPAltitudeAdjust( double inc );
78 void fgAPHeadingAdjust( double inc );
79 void fgAPAutoThrottleAdjust( double inc );
80
81
82 #endif // _AUTOPILOT_HXX
83
84
85 // $Log$
86 // Revision 1.9  1999/02/12 23:22:36  curt
87 // Allow auto-throttle adjustment while active.
88 //
89 // Revision 1.8  1999/02/12 22:17:15  curt
90 // Changes contributed by Norman Vine to allow adjustment of the autopilot
91 // while it is activated.
92 //