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.
24 #ifndef _AUTOPILOT_HXX
25 #define _AUTOPILOT_HXX
28 #include <Aircraft/aircraft.hxx>
29 #include <FDM/flight.hxx>
30 #include <Controls/controls.hxx>
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
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
48 double TargetSlope; // the glide slope hold value
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
58 } fgAPData, *fgAPDataPtr ;
62 #define AP_CURRENT_HEADING -1
66 void fgAPInit( fgAIRCRAFT *current_aircraft );
69 void fgAPToggleHeading( void );
70 void fgAPToggleAltitude( void );
71 void fgAPToggleTerrainFollow( void );
72 void fgAPToggleAutoThrottle( void );
74 bool fgAPTerrainFollowEnabled( void );
75 bool fgAPAltitudeEnabled( void );
76 bool fgAPHeadingEnabled( void );
77 bool fgAPAutoThrottleEnabled( void );
79 void fgAPAltitudeAdjust( double inc );
80 void fgAPHeadingAdjust( double inc );
81 void fgAPAutoThrottleAdjust( double inc );
83 void fgAPHeadingSet( double value );
88 void fgAPAdjust( puObject * );
90 #endif // _AUTOPILOT_HXX