Fixed [simple] terrain following altitude hold mode to work again.
This commit is contained in:
parent
0f68fb3633
commit
019b6d29fe
4 changed files with 15 additions and 3 deletions
|
@ -176,6 +176,8 @@ public:
|
|||
inline void set_TargetDistance( double val ) { TargetDistance = val; }
|
||||
inline double get_TargetAltitude() const { return TargetAltitude; }
|
||||
inline void set_TargetAltitude( double val ) { TargetAltitude = val; }
|
||||
inline double get_TargetAGL() const { return TargetAGL; }
|
||||
inline void set_TargetAGL( double val ) { TargetAGL = val; }
|
||||
inline double get_TargetClimbRate() const { return TargetClimbRate; }
|
||||
inline void set_TargetClimbRate( double val ) { TargetClimbRate = val; }
|
||||
|
||||
|
|
|
@ -381,6 +381,8 @@ bool FGJSBsim::copy_from_JSBsim() {
|
|||
Position->GetLongitude(),
|
||||
Position->Geth() );
|
||||
|
||||
_set_Altitude_AGL( Position->GetDistanceAGL() );
|
||||
|
||||
_set_Euler_Angles( Rotation->Getphi(),
|
||||
Rotation->Gettht(),
|
||||
Rotation->Getpsi() );
|
||||
|
|
|
@ -469,7 +469,7 @@ bool FGLaRCsim::copy_from_LaRCsim() {
|
|||
_set_Geodetic_Position( Latitude, tmp_lon, Altitude );
|
||||
_set_Euler_Angles( Phi, Theta, Psi );
|
||||
|
||||
_set_Altitude_AGL( Altitude-Runway_altitude );
|
||||
_set_Altitude_AGL( Altitude - Runway_altitude );
|
||||
|
||||
// Miscellaneous quantities
|
||||
_set_T_Local_to_Body(T_local_to_body_m);
|
||||
|
|
|
@ -571,6 +571,12 @@ setAPTerrainLock (bool lock)
|
|||
{
|
||||
current_autopilot->set_AltitudeMode(FGAutopilot::FG_ALTITUDE_TERRAIN);
|
||||
current_autopilot->set_AltitudeEnabled(lock);
|
||||
current_autopilot->set_TargetAGL(
|
||||
current_aircraft.fdm_state->get_Altitude_AGL() * SG_FEET_TO_METER
|
||||
);
|
||||
cout << "Target AGL = "
|
||||
<< current_aircraft.fdm_state->get_Altitude_AGL() * SG_FEET_TO_METER
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1030,6 +1036,8 @@ fgInitProps ()
|
|||
fgSetArchivable("/autopilot/locks/glide-slope");
|
||||
fgTie("/autopilot/locks/terrain", getAPTerrainLock, setAPTerrainLock);
|
||||
fgSetArchivable("/autopilot/locks/terrain");
|
||||
fgTie("/autopilot/settings/agl-ft", getAPAltitude, setAPAltitude);
|
||||
fgSetArchivable("/autopilot/settings/agl-ft");
|
||||
fgTie("/autopilot/settings/climb-rate-fpm", getAPClimb, setAPClimb, false);
|
||||
fgSetArchivable("/autopilot/settings/climb-rate-fpm");
|
||||
fgTie("/autopilot/locks/heading", getAPHeadingLock, setAPHeadingLock);
|
||||
|
@ -1195,7 +1203,7 @@ FGAndCondition::FGAndCondition ()
|
|||
|
||||
FGAndCondition::~FGAndCondition ()
|
||||
{
|
||||
for (int i = 0; i < _conditions.size(); i++)
|
||||
for (unsigned int i = 0; i < _conditions.size(); i++)
|
||||
delete _conditions[i];
|
||||
}
|
||||
|
||||
|
@ -1228,7 +1236,7 @@ FGOrCondition::FGOrCondition ()
|
|||
|
||||
FGOrCondition::~FGOrCondition ()
|
||||
{
|
||||
for (int i = 0; i < _conditions.size(); i++)
|
||||
for (unsigned int i = 0; i < _conditions.size(); i++)
|
||||
delete _conditions[i];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue