1 // JSBsim.cxx -- interface to the JSBsim flight model
3 // Written by Curtis Olson, started February 1999.
5 // Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
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 #include <simgear/compiler.h>
26 #ifdef SG_MATH_EXCEPTION_CLASH
32 #include <simgear/constants.h>
33 #include <simgear/debug/logstream.hxx>
34 #include <simgear/math/sg_geodesy.hxx>
35 #include <simgear/misc/sg_path.hxx>
37 #include <Scenery/scenery.hxx>
39 #include <Aircraft/aircraft.hxx>
40 #include <Controls/controls.hxx>
41 #include <Main/globals.hxx>
42 #include <Main/fg_props.hxx>
44 #include <FDM/JSBSim/FGFDMExec.h>
45 #include <FDM/JSBSim/FGAircraft.h>
46 #include <FDM/JSBSim/FGFCS.h>
47 #include <FDM/JSBSim/FGPosition.h>
48 #include <FDM/JSBSim/FGRotation.h>
49 #include <FDM/JSBSim/FGState.h>
50 #include <FDM/JSBSim/FGTranslation.h>
51 #include <FDM/JSBSim/FGAuxiliary.h>
52 #include <FDM/JSBSim/FGInitialCondition.h>
53 #include <FDM/JSBSim/FGTrim.h>
54 #include <FDM/JSBSim/FGAtmosphere.h>
55 #include <FDM/JSBSim/FGMassBalance.h>
56 #include <FDM/JSBSim/FGAerodynamics.h>
59 /******************************************************************************/
61 FGJSBsim::FGJSBsim( double dt )
66 fdmex = new FGFDMExec;
68 State = fdmex->GetState();
69 Atmosphere = fdmex->GetAtmosphere();
70 FCS = fdmex->GetFCS();
71 MassBalance = fdmex->GetMassBalance();
72 Propulsion = fdmex->GetPropulsion();
73 Aircraft = fdmex->GetAircraft();
74 Translation = fdmex->GetTranslation();
75 Rotation = fdmex->GetRotation();
76 Position = fdmex->GetPosition();
77 Auxiliary = fdmex->GetAuxiliary();
78 Aerodynamics = fdmex->GetAerodynamics();
79 GroundReactions = fdmex->GetGroundReactions();
82 Atmosphere->UseInternal();
84 fgic=new FGInitialCondition(fdmex);
87 SGPath aircraft_path( globals->get_fg_root() );
88 aircraft_path.append( "Aircraft" );
90 SGPath engine_path( globals->get_fg_root() );
91 engine_path.append( "Engine" );
95 result = fdmex->LoadModel( aircraft_path.str(),
97 fgGetString("/sim/aircraft") );
100 SG_LOG( SG_FLIGHT, SG_INFO, " loaded aircraft.");
102 SG_LOG( SG_FLIGHT, SG_INFO,
103 " aircraft does not exist (you may have mis-typed the name).");
107 SG_LOG( SG_FLIGHT, SG_INFO, "" );
108 SG_LOG( SG_FLIGHT, SG_INFO, "" );
109 SG_LOG( SG_FLIGHT, SG_INFO, "After loading aircraft definition file ..." );
111 int Neng = Propulsion->GetNumEngines();
112 SG_LOG( SG_FLIGHT, SG_INFO, "num engines = " << Neng );
113 for(int i=0;i<Neng;i++) {
114 add_engine( FGEngInterface() );
117 if ( GroundReactions->GetNumGearUnits() <= 0 ) {
118 SG_LOG( SG_FLIGHT, SG_ALERT, "num gear units = "
119 << GroundReactions->GetNumGearUnits() );
120 SG_LOG( SG_FLIGHT, SG_ALERT, "This is a very bad thing because with 0 gear units, the ground trimming");
121 SG_LOG( SG_FLIGHT, SG_ALERT, "routine (coming up later in the code) will core dump.");
122 SG_LOG( SG_FLIGHT, SG_ALERT, "Halting the sim now, and hoping a solution will present itself soon!");
129 fgSetDouble("/fdm/trim/pitch-trim", FCS->GetPitchTrimCmd());
130 fgSetDouble("/fdm/trim/throttle", FCS->GetThrottleCmd(0));
131 fgSetDouble("/fdm/trim/aileron", FCS->GetDaCmd());
132 fgSetDouble("/fdm/trim/rudder", FCS->GetDrCmd());
134 startup_trim = fgGetNode("/sim/startup/trim", true);
136 trimmed = fgGetNode("/fdm/trim/trimmed", true);
137 trimmed->setBoolValue(false);
139 pitch_trim = fgGetNode("/fdm/trim/pitch-trim", true );
140 throttle_trim = fgGetNode("/fdm/trim/throttle", true );
141 aileron_trim = fgGetNode("/fdm/trim/aileron", true );
142 rudder_trim = fgGetNode("/fdm/trim/rudder", true );
145 stall_warning = fgGetNode("/sim/aircraft/alarms/stall-warning",true);
146 stall_warning->setDoubleValue(0);
149 /******************************************************************************/
150 FGJSBsim::~FGJSBsim(void) {
152 delete fdmex; fdmex=NULL;
153 delete fgic; fgic=NULL;
157 /******************************************************************************/
159 // Initialize the JSBsim flight model, dt is the time increment for
160 // each subsequent iteration through the EOM
162 void FGJSBsim::init() {
164 SG_LOG( SG_FLIGHT, SG_INFO, "Starting and initializing JSBsim" );
166 // Explicitly call the superclass's
167 // init method first.
170 fdmex->GetState()->Initialize(fgic);
171 fdmex->RunIC(fgic); //loop JSBSim once w/o integrating
172 // fdmex->Run(); //loop JSBSim once
173 copy_from_JSBsim(); //update the bus
175 SG_LOG( SG_FLIGHT, SG_INFO, " Initialized JSBSim with:" );
177 switch(fgic->GetSpeedSet()) {
179 SG_LOG(SG_FLIGHT,SG_INFO, " Vn,Ve,Vd= "
180 << Position->GetVn() << ", "
181 << Position->GetVe() << ", "
182 << Position->GetVd() << " ft/s");
185 SG_LOG(SG_FLIGHT,SG_INFO, " U,V,W= "
186 << Translation->GetUVW(1) << ", "
187 << Translation->GetUVW(2) << ", "
188 << Translation->GetUVW(3) << " ft/s");
191 SG_LOG(SG_FLIGHT,SG_INFO, " Mach: "
192 << Translation->GetMach() );
196 SG_LOG(SG_FLIGHT,SG_INFO, " Indicated Airspeed: "
197 << Auxiliary->GetVcalibratedKTS() << " knots" );
201 stall_warning->setBoolValue(false);
203 SG_LOG( SG_FLIGHT, SG_INFO, " Bank Angle: "
204 << Rotation->Getphi()*RADTODEG << " deg" );
205 SG_LOG( SG_FLIGHT, SG_INFO, " Pitch Angle: "
206 << Rotation->Gettht()*RADTODEG << " deg" );
207 SG_LOG( SG_FLIGHT, SG_INFO, " True Heading: "
208 << Rotation->Getpsi()*RADTODEG << " deg" );
209 SG_LOG( SG_FLIGHT, SG_INFO, " Latitude: "
210 << Position->GetLatitude() << " deg" );
211 SG_LOG( SG_FLIGHT, SG_INFO, " Longitude: "
212 << Position->GetLongitude() << " deg" );
213 SG_LOG( SG_FLIGHT, SG_INFO, " Altitude: "
214 << Position->Geth() << " feet" );
215 SG_LOG( SG_FLIGHT, SG_INFO, " loaded initial conditions" );
217 SG_LOG( SG_FLIGHT, SG_INFO, " set dt" );
219 SG_LOG( SG_FLIGHT, SG_INFO, "Finished initializing JSBSim" );
225 /******************************************************************************/
227 // Run an iteration of the EOM (equations of motion)
229 bool FGJSBsim::update( int multiloop ) {
233 double save_alt = 0.0;
237 trimmed->setBoolValue(false);
240 if ( startup_trim->getBoolValue() ) {
243 fdmex->RunIC(fgic); //apply any changes made through the set_ functions
248 for( i=0; i<get_num_engines(); i++ ) {
249 FGEngInterface * e = get_engine(i);
250 FGEngine * eng = Propulsion->GetEngine(i);
251 FGThruster * thrust = Propulsion->GetThruster(i);
252 eng->SetMagnetos( globals->get_controls()->get_magnetos(i) );
253 eng->SetStarter( globals->get_controls()->get_starter(i) );
254 e->set_Throttle( globals->get_controls()->get_throttle(i) );
258 for ( i=0; i < multiloop; i++ ) {
262 struct FGJSBBase::Message* msg;
263 while (fdmex->ReadMessage()) {
264 msg = fdmex->ProcessMessage();
266 case FGJSBBase::Message::eText:
267 cout << msg->messageId << ": " << msg->text << endl;
269 case FGJSBBase::Message::eBool:
270 cout << msg->messageId << ": " << msg->text << " " << msg->bVal << endl;
272 case FGJSBBase::Message::eInteger:
273 cout << msg->messageId << ": " << msg->text << " " << msg->iVal << endl;
275 case FGJSBBase::Message::eDouble:
276 cout << msg->messageId << ": " << msg->text << " " << msg->dVal << endl;
279 cerr << "Unrecognized message type." << endl;
284 for( i=0; i<get_num_engines(); i++ ) {
285 FGEngInterface * e = get_engine(i);
286 FGEngine * eng = Propulsion->GetEngine(i);
287 FGThruster * thrust = Propulsion->GetThruster(i);
288 e->set_Manifold_Pressure( eng->getManifoldPressure_inHg() );
289 e->set_RPM( thrust->GetRPM() );
290 e->set_EGT( eng->getExhaustGasTemp_degF() );
291 e->set_CHT( eng->getCylinderHeadTemp_degF() );
292 e->set_Oil_Temp( eng->getOilTemp_degF() );
293 e->set_Running_Flag( eng->GetRunning() );
294 e->set_Cranking_Flag( eng->GetCranking() );
300 stall_warning->setDoubleValue( Aircraft->GetStallWarn() );
302 // translate JSBsim back to FG structure so that the
303 // autopilot (and the rest of the sim can use the updated values
308 /******************************************************************************/
310 // Convert from the FGInterface struct to the JSBsim generic_ struct
312 bool FGJSBsim::copy_to_JSBsim() {
313 // copy control positions into the JSBsim structure
315 FCS->SetDaCmd( globals->get_controls()->get_aileron());
316 FCS->SetDeCmd( globals->get_controls()->get_elevator());
317 FCS->SetPitchTrimCmd(globals->get_controls()->get_elevator_trim());
318 FCS->SetDrCmd( -globals->get_controls()->get_rudder());
319 FCS->SetDfCmd( globals->get_controls()->get_flaps() );
320 FCS->SetDsbCmd( 0.0 ); //speedbrakes
321 FCS->SetDspCmd( 0.0 ); //spoilers
322 FCS->SetLBrake( globals->get_controls()->get_brake( 0 ) );
323 FCS->SetRBrake( globals->get_controls()->get_brake( 1 ) );
324 FCS->SetCBrake( globals->get_controls()->get_brake( 2 ) );
325 for (int i = 0; i < get_num_engines(); i++) {
326 FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
327 FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i));
330 Position->SetSeaLevelRadius( get_Sea_level_radius() );
331 Position->SetRunwayRadius( scenery.get_cur_elev()*SG_METER_TO_FEET
332 + get_Sea_level_radius() );
334 Atmosphere->SetExTemperature(get_Static_temperature());
335 Atmosphere->SetExPressure(get_Static_pressure());
336 Atmosphere->SetExDensity(get_Density());
337 Atmosphere->SetWindNED(get_V_north_airmass(),
338 get_V_east_airmass(),
339 get_V_down_airmass());
340 // SG_LOG(SG_FLIGHT,SG_INFO, "Wind NED: "
341 // << get_V_north_airmass() << ", "
342 // << get_V_east_airmass() << ", "
343 // << get_V_down_airmass() );
348 /******************************************************************************/
350 // Convert from the JSBsim generic_ struct to the FGInterface struct
352 bool FGJSBsim::copy_from_JSBsim() {
355 _set_Inertias( MassBalance->GetMass(),
356 MassBalance->GetIxx(),
357 MassBalance->GetIyy(),
358 MassBalance->GetIzz(),
359 MassBalance->GetIxz() );
361 _set_CG_Position( MassBalance->GetXYZcg(1),
362 MassBalance->GetXYZcg(2),
363 MassBalance->GetXYZcg(3) );
365 _set_Accels_Body( Aircraft->GetBodyAccel()(1),
366 Aircraft->GetBodyAccel()(2),
367 Aircraft->GetBodyAccel()(3) );
369 //_set_Accels_CG_Body( Aircraft->GetBodyAccel()(1),
370 // Aircraft->GetBodyAccel()(2),
371 // Aircraft->GetBodyAccel()(3) );
373 _set_Accels_CG_Body_N ( Aircraft->GetNcg()(1),
374 Aircraft->GetNcg()(2),
375 Aircraft->GetNcg()(3) );
377 _set_Accels_Pilot_Body( Auxiliary->GetPilotAccel()(1),
378 Auxiliary->GetPilotAccel()(2),
379 Auxiliary->GetPilotAccel()(3) );
381 // _set_Accels_Pilot_Body_N( Auxiliary->GetPilotAccel()(1)/32.1739,
382 // Auxiliary->GetNpilot(2)/32.1739,
383 // Auxiliary->GetNpilot(3)/32.1739 );
385 _set_Nlf( Aerodynamics->GetNlf() );
389 _set_Velocities_Local( Position->GetVn(),
393 _set_Velocities_Wind_Body( Translation->GetUVW(1),
394 Translation->GetUVW(2),
395 Translation->GetUVW(3) );
397 _set_V_rel_wind( Translation->GetVt() );
399 _set_V_equiv_kts( Auxiliary->GetVequivalentKTS() );
401 // _set_V_calibrated( Auxiliary->GetVcalibratedFPS() );
403 _set_V_calibrated_kts( Auxiliary->GetVcalibratedKTS() );
405 _set_V_ground_speed( Position->GetVground() );
407 _set_Omega_Body( Rotation->GetPQR(1),
409 Rotation->GetPQR(3) );
411 _set_Euler_Rates( Rotation->GetEulerRates(1),
412 Rotation->GetEulerRates(2),
413 Rotation->GetEulerRates(3) );
415 _set_Geocentric_Rates(Position->GetLatitudeDot(),
416 Position->GetLongitudeDot(),
417 Position->Gethdot() );
419 _set_Mach_number( Translation->GetMach() );
422 _updatePosition( Position->GetLatitude(),
423 Position->GetLongitude(),
426 _set_Altitude_AGL( Position->GetDistanceAGL() );
428 _set_Euler_Angles( Rotation->Getphi(),
430 Rotation->Getpsi() );
432 _set_Alpha( Translation->Getalpha() );
433 _set_Beta( Translation->Getbeta() );
436 _set_Gamma_vert_rad( Position->GetGamma() );
437 // set_Gamma_horiz_rad( Gamma_horiz_rad );
439 _set_Earth_position_angle( Auxiliary->GetEarthPositionAngle() );
441 _set_Climb_Rate( Position->Gethdot() );
444 for ( i = 1; i <= 3; i++ ) {
445 for ( j = 1; j <= 3; j++ ) {
446 _set_T_Local_to_Body( i, j, State->GetTl2b(i,j) );
452 bool FGJSBsim::ToggleDataLogging(void) {
453 return fdmex->GetOutput()->Toggle();
457 bool FGJSBsim::ToggleDataLogging(bool state) {
459 fdmex->GetOutput()->Enable();
462 fdmex->GetOutput()->Disable();
469 void FGJSBsim::set_Latitude(double lat) {
470 static const SGPropertyNode *altitude
471 = fgGetNode("/position/altitude-ft");
473 if ( altitude->getDoubleValue() > -9990 ) {
474 alt = altitude->getDoubleValue();
479 double sea_level_radius_meters, lat_geoc;
481 SG_LOG(SG_FLIGHT,SG_INFO,"FGJSBsim::set_Latitude: " << lat );
482 SG_LOG(SG_FLIGHT,SG_INFO," cur alt (ft) = " << alt );
484 sgGeodToGeoc( lat, alt * SG_FEET_TO_METER,
485 &sea_level_radius_meters, &lat_geoc );
487 _set_Sea_level_radius( sea_level_radius_meters * SG_METER_TO_FEET );
488 fgic->SetSeaLevelRadiusFtIC( sea_level_radius_meters * SG_METER_TO_FEET );
489 fgic->SetLatitudeRadIC( lat_geoc );
493 void FGJSBsim::set_Longitude(double lon) {
495 SG_LOG(SG_FLIGHT,SG_INFO,"FGJSBsim::set_Longitude: " << lon );
497 fgic->SetLongitudeRadIC( lon );
501 void FGJSBsim::set_Altitude(double alt) {
502 static const SGPropertyNode *latitude
503 = fgGetNode("/position/latitude-deg");
505 double sea_level_radius_meters,lat_geoc;
507 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Altitude: " << alt );
508 SG_LOG(SG_FLIGHT,SG_INFO, " lat (deg) = " << latitude->getDoubleValue() );
510 sgGeodToGeoc( latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS, alt,
511 &sea_level_radius_meters, &lat_geoc);
512 _set_Sea_level_radius( sea_level_radius_meters * SG_METER_TO_FEET );
513 fgic->SetSeaLevelRadiusFtIC( sea_level_radius_meters * SG_METER_TO_FEET );
514 fgic->SetLatitudeRadIC( lat_geoc );
515 fgic->SetAltitudeFtIC(alt);
519 void FGJSBsim::set_V_calibrated_kts(double vc) {
520 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_V_calibrated_kts: " << vc );
522 fgic->SetVcalibratedKtsIC(vc);
526 void FGJSBsim::set_Mach_number(double mach) {
527 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Mach_number: " << mach );
529 fgic->SetMachIC(mach);
533 void FGJSBsim::set_Velocities_Local( double north, double east, double down ){
534 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Local: "
535 << north << ", " << east << ", " << down );
537 fgic->SetVnorthFpsIC(north);
538 fgic->SetVeastFpsIC(east);
539 fgic->SetVdownFpsIC(down);
543 void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){
544 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Wind_Body: "
545 << u << ", " << v << ", " << w );
547 fgic->SetUBodyFpsIC(u);
548 fgic->SetVBodyFpsIC(v);
549 fgic->SetWBodyFpsIC(w);
554 void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) {
555 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Euler_Angles: "
556 << phi << ", " << theta << ", " << psi );
558 fgic->SetPitchAngleRadIC(theta);
559 fgic->SetRollAngleRadIC(phi);
560 fgic->SetTrueHeadingRadIC(psi);
565 void FGJSBsim::set_Climb_Rate( double roc) {
566 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Climb_Rate: " << roc );
568 fgic->SetClimbRateFpsIC(roc);
572 void FGJSBsim::set_Gamma_vert_rad( double gamma) {
573 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Gamma_vert_rad: " << gamma );
575 fgic->SetFlightPathAngleRadIC(gamma);
580 void FGJSBsim::set_Sea_level_radius(double slr) {
581 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Sea_level_radius: " << slr );
583 fgic->SetSeaLevelRadiusFtIC(slr);
587 void FGJSBsim::set_Runway_altitude(double ralt) {
588 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Runway_altitude: " << ralt );
590 _set_Runway_altitude( ralt );
591 fgic->SetTerrainAltitudeFtIC( ralt );
595 void FGJSBsim::set_Static_pressure(double p) {
596 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Static_pressure: " << p );
598 Atmosphere->SetExPressure(p);
599 if(Atmosphere->External() == true)
603 void FGJSBsim::set_Static_temperature(double T) {
604 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Static_temperature: " << T );
606 Atmosphere->SetExTemperature(T);
607 if(Atmosphere->External() == true)
612 void FGJSBsim::set_Density(double rho) {
613 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Density: " << rho );
615 Atmosphere->SetExDensity(rho);
616 if(Atmosphere->External() == true)
620 void FGJSBsim::set_Velocities_Local_Airmass (double wnorth,
623 SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Local_Airmass: "
624 << wnorth << ", " << weast << ", " << wdown );
626 _set_Velocities_Local_Airmass( wnorth, weast, wdown );
627 Atmosphere->SetWindNED(wnorth, weast, wdown );
628 if(Atmosphere->External() == true)
632 void FGJSBsim::init_gear(void ) {
634 FGGearInterface *gear;
635 FGGroundReactions* gr=fdmex->GetGroundReactions();
636 int Ngear=GroundReactions->GetNumGearUnits();
637 for (int i=0;i<Ngear;i++) {
638 add_gear_unit( FGGearInterface() );
639 gear=get_gear_unit(i);
640 gear->SetX( gr->GetGearUnit(i)->GetBodyLocation()(1) );
641 gear->SetY( gr->GetGearUnit(i)->GetBodyLocation()(2) );
642 gear->SetZ( gr->GetGearUnit(i)->GetBodyLocation()(3) );
643 gear->SetWoW( gr->GetGearUnit(i)->GetWOW() );
644 if ( gr->GetGearUnit(i)->GetBrakeGroup() > 0 ) {
645 gear->SetBrake(true);
647 if ( gr->GetGearUp() ) {
648 gear->SetPosition( 0.0 );
653 void FGJSBsim::update_gear(void) {
655 FGGearInterface* gear;
656 FGGroundReactions* gr=fdmex->GetGroundReactions();
657 int Ngear=GroundReactions->GetNumGearUnits();
658 for (int i=0;i<Ngear;i++) {
659 gear=get_gear_unit(i);
660 gear->SetWoW( gr->GetGearUnit(i)->GetWOW() );
661 if ( gr->GetGearUp() ) {
662 gear->SetPosition( 0.0 );
667 void FGJSBsim::do_trim(void) {
670 if(fgic->GetVcalibratedKtsIC() < 10 ) {
671 fgic->SetVcalibratedKtsIC(0.0);
672 fgtrim=new FGTrim(fdmex,fgic,tGround);
674 fgtrim=new FGTrim(fdmex,fgic,tLongitudinal);
676 if( !fgtrim->DoTrim() ) {
680 trimmed->setBoolValue(true);
682 State->ReportState();
684 pitch_trim->setDoubleValue( FCS->GetPitchTrimCmd() );
685 throttle_trim->setDoubleValue( FCS->GetThrottleCmd(0) );
686 aileron_trim->setDoubleValue( FCS->GetDaCmd() );
687 rudder_trim->setDoubleValue( FCS->GetDrCmd() );
689 globals->get_controls()->set_elevator_trim(FCS->GetPitchTrimCmd());
690 globals->get_controls()->set_elevator(FCS->GetDeCmd());
691 globals->get_controls()->set_throttle(FGControls::ALL_ENGINES,
692 FCS->GetThrottleCmd(0));
694 globals->get_controls()->set_aileron(FCS->GetDaCmd());
695 globals->get_controls()->set_rudder( FCS->GetDrCmd());
697 SG_LOG( SG_FLIGHT, SG_INFO, " Trim complete" );