1 // autopilot.hxx -- autopilot defines and prototypes (very alpha)
3 // Written by Jeff Goeke-Smith, started April 1998.
5 // Copyright (C) 1998 Jeff Goeke-Smith - jgoeke@voyager.net
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.
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.
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.
22 // (Log is kept at end of this file)
25 #ifndef _AUTOPILOT_HXX
26 #define _AUTOPILOT_HXX
29 #include <Aircraft/aircraft.hxx>
30 #include <FDM/flight.hxx>
31 #include <Controls/controls.hxx>
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
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
49 double TargetSlope; // the glide slope hold value
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
59 } fgAPData, *fgAPDataPtr ;
63 #define AP_CURRENT_HEADING -1
67 void fgAPInit( fgAIRCRAFT *current_aircraft );
69 void fgAPToggleHeading( void );
70 void fgAPToggleAltitude( void );
71 void fgAPToggleTerrainFollow( void );
72 void fgAPToggleAutoThrottle( void );
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 );
82 #endif // _AUTOPILOT_HXX
86 // Revision 1.1 1999/04/05 21:32:49 curt
89 // Revision 1.9 1999/02/12 23:22:36 curt
90 // Allow auto-throttle adjustment while active.
92 // Revision 1.8 1999/02/12 22:17:15 curt
93 // Changes contributed by Norman Vine to allow adjustment of the autopilot
94 // while it is activated.