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