1999-02-12 22:17:14 +00:00
|
|
|
// autopilot.hxx -- autopilot defines and prototypes (very alpha)
|
|
|
|
//
|
|
|
|
// Written by Jeff Goeke-Smith, started April 1998.
|
|
|
|
//
|
|
|
|
// Copyright (C) 1998 Jeff Goeke-Smith - jgoeke@voyager.net
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
// (Log is kept at end of this file)
|
1998-04-14 02:18:44 +00:00
|
|
|
|
|
|
|
|
1999-02-12 22:17:14 +00:00
|
|
|
#ifndef _AUTOPILOT_HXX
|
|
|
|
#define _AUTOPILOT_HXX
|
1998-04-14 02:18:44 +00:00
|
|
|
|
1998-04-22 13:21:26 +00:00
|
|
|
|
1998-10-16 23:26:44 +00:00
|
|
|
#include <Aircraft/aircraft.hxx>
|
1999-02-01 21:33:23 +00:00
|
|
|
#include <FDM/flight.hxx>
|
1998-10-17 01:33:52 +00:00
|
|
|
#include <Controls/controls.hxx>
|
1998-04-14 02:18:44 +00:00
|
|
|
|
|
|
|
|
1998-05-07 23:11:50 +00:00
|
|
|
// Structures
|
1998-04-14 02:18:44 +00:00
|
|
|
typedef struct {
|
1999-02-12 22:17:14 +00:00
|
|
|
bool heading_hold; // the current state of the heading hold
|
|
|
|
bool altitude_hold; // the current state of the altitude hold
|
|
|
|
bool terrain_follow; // the current state of the terrain follower
|
|
|
|
bool auto_throttle; // the current state of the auto throttle
|
1998-09-29 01:59:27 +00:00
|
|
|
|
|
|
|
double TargetHeading; // the heading the AP should steer to.
|
|
|
|
double TargetAltitude; // altitude to hold
|
1998-10-02 12:46:43 +00:00
|
|
|
double TargetAGL; // the terrain separation
|
1998-09-29 14:55:29 +00:00
|
|
|
double TargetClimbRate; // climb rate to shoot for
|
1998-10-02 12:46:43 +00:00
|
|
|
double TargetSpeed; // speed to shoot for
|
1998-09-29 01:59:27 +00:00
|
|
|
double alt_error_accum; // altitude error accumulator
|
1998-10-02 12:46:43 +00:00
|
|
|
double speed_error_accum; // speed error accumulator
|
1998-10-01 00:37:57 +00:00
|
|
|
|
1998-09-29 01:59:27 +00:00
|
|
|
double TargetSlope; // the glide slope hold value
|
|
|
|
|
|
|
|
double MaxRoll ; // the max the plane can roll for the turn
|
|
|
|
double RollOut; // when the plane should roll out
|
|
|
|
// measured from Heading
|
|
|
|
double MaxAileron; // how far to move the aleroin from center
|
|
|
|
double RollOutSmooth; // deg to use for smoothing Aileron Control
|
|
|
|
double MaxElevator; // the maximum elevator allowed
|
|
|
|
double SlopeSmooth; // smoothing angle for elevator
|
|
|
|
|
|
|
|
} fgAPData, *fgAPDataPtr ;
|
1998-04-14 02:18:44 +00:00
|
|
|
|
|
|
|
|
1998-05-07 23:11:50 +00:00
|
|
|
// Defines
|
|
|
|
#define AP_CURRENT_HEADING -1
|
|
|
|
|
|
|
|
|
1998-04-14 02:18:44 +00:00
|
|
|
// prototypes
|
|
|
|
void fgAPInit( fgAIRCRAFT *current_aircraft );
|
|
|
|
int fgAPRun( void );
|
1998-09-29 01:59:27 +00:00
|
|
|
void fgAPToggleHeading( void );
|
|
|
|
void fgAPToggleAltitude( void );
|
1998-10-01 00:37:57 +00:00
|
|
|
void fgAPToggleTerrainFollow( void );
|
1998-10-02 12:46:43 +00:00
|
|
|
void fgAPToggleAutoThrottle( void );
|
1998-04-14 02:18:44 +00:00
|
|
|
|
1999-02-12 22:17:14 +00:00
|
|
|
bool fgAPAltitudeEnabled( void );
|
|
|
|
bool fgAPHeadingEnabled( void );
|
1999-02-12 23:22:35 +00:00
|
|
|
bool fgAPAutoThrottleEnabled( void );
|
1999-02-12 22:17:14 +00:00
|
|
|
void fgAPAltitudeAdjust( double inc );
|
|
|
|
void fgAPHeadingAdjust( double inc );
|
1999-02-12 23:22:35 +00:00
|
|
|
void fgAPAutoThrottleAdjust( double inc );
|
1999-02-12 22:17:14 +00:00
|
|
|
|
1998-04-14 02:18:44 +00:00
|
|
|
|
1999-02-12 22:17:14 +00:00
|
|
|
#endif // _AUTOPILOT_HXX
|
1998-04-22 13:21:26 +00:00
|
|
|
|
|
|
|
|
1999-02-12 22:17:14 +00:00
|
|
|
// $Log$
|
1999-02-12 23:22:35 +00:00
|
|
|
// Revision 1.9 1999/02/12 23:22:36 curt
|
|
|
|
// Allow auto-throttle adjustment while active.
|
|
|
|
//
|
1999-02-12 22:17:14 +00:00
|
|
|
// Revision 1.8 1999/02/12 22:17:15 curt
|
|
|
|
// Changes contributed by Norman Vine to allow adjustment of the autopilot
|
|
|
|
// while it is activated.
|
|
|
|
//
|