1
0
Fork 0

April 25, 2000 updates from Jon.

This commit is contained in:
curt 2000-04-25 17:43:40 +00:00
parent 8f71890c08
commit e9b2b521ca

View file

@ -114,19 +114,21 @@ int FGJSBsim::update( int multiloop ) {
// lets try to avoid really screwing up the JSBsim model // lets try to avoid really screwing up the JSBsim model
if ( get_Altitude() < -9000 ) { if ( get_Altitude() < -9000 ) {
save_alt = get_Altitude(); save_alt = get_Altitude();
set_Altitude( 0.0 ); set_Altitude( 0.0 );
} }
// copy control positions into the JSBsim structure // copy control positions into the JSBsim structure
FDMExec.GetFCS()->SetDaCmd( controls.get_aileron()); FDMExec.GetFCS()->SetDaCmd( controls.get_aileron());
FDMExec.GetFCS()->SetDeCmd( controls.get_elevator() FDMExec.GetFCS()->SetDeCmd( controls.get_elevator()
+ controls.get_elevator_trim() ); + controls.get_elevator_trim() );
FDMExec.GetFCS()->SetDrCmd( controls.get_rudder()); FDMExec.GetFCS()->SetDrCmd( controls.get_rudder());
FDMExec.GetFCS()->SetDfCmd( 0.0 ); FDMExec.GetFCS()->SetDfCmd( 0.0 );
// FDMExec.GetFCS()->SetDsCmd( 0.0 ); FDMExec.GetFCS()->SetDsbCmd( 0.0 );
FDMExec.GetFCS()->SetDspCmd( 0.0 );
FDMExec.GetFCS()->SetThrottleCmd( FGControls::ALL_ENGINES, FDMExec.GetFCS()->SetThrottleCmd( FGControls::ALL_ENGINES,
controls.get_throttle( 0 ) * 100.0 ); controls.get_throttle( 0 ) * 100.0 );
// FCS->SetBrake( controls.get_brake( 0 ) ); // FCS->SetBrake( controls.get_brake( 0 ) );
// Inform JSBsim of the local terrain altitude // Inform JSBsim of the local terrain altitude
@ -139,11 +141,11 @@ int FGJSBsim::update( int multiloop ) {
// printf("Altitude = %.2f\n", Altitude * 0.3048); // printf("Altitude = %.2f\n", Altitude * 0.3048);
// printf("Radius to Vehicle = %.2f\n", Radius_to_vehicle * 0.3048); // printf("Radius to Vehicle = %.2f\n", Radius_to_vehicle * 0.3048);
/* FDMExec.GetState()->Setsim_time(State->Getsim_time() /* FDMExec.GetState()->Setsim_time(State->Getsim_time()
+ State->Getdt() * multiloop); */ + State->Getdt() * multiloop); */
for ( int i = 0; i < multiloop; i++ ) { for ( int i = 0; i < multiloop; i++ ) {
FDMExec.Run(); FDMExec.Run();
} }
// printf("%d FG_Altitude = %.2f\n", i, FG_Altitude * 0.3048); // printf("%d FG_Altitude = %.2f\n", i, FG_Altitude * 0.3048);
@ -157,13 +159,13 @@ int FGJSBsim::update( int multiloop ) {
// but lets restore our original bogus altitude when we are done // but lets restore our original bogus altitude when we are done
if ( save_alt < -9000.0 ) { if ( save_alt < -9000.0 ) {
set_Altitude( save_alt ); set_Altitude( save_alt );
} }
double end_elev = get_Altitude(); double end_elev = get_Altitude();
if ( time_step > 0.0 ) { if ( time_step > 0.0 ) {
// feet per second // feet per second
set_Climb_Rate( (end_elev - start_elev) / time_step ); set_Climb_Rate( (end_elev - start_elev) / time_step );
} }
return 1; return 1;
@ -180,14 +182,14 @@ int FGJSBsim::copy_to_JSBsim() {
int FGJSBsim::copy_from_JSBsim() { int FGJSBsim::copy_from_JSBsim() {
// Velocities // Velocities
// set_Velocities_Local( FDMExec.GetPosition()->GetVn(), set_Velocities_Local( FDMExec.GetPosition()->GetVn(),
// FDMExec.GetPosition()->GetVe(), FDMExec.GetPosition()->GetVe(),
// FDMExec.GetPosition()->GetVd() ); FDMExec.GetPosition()->GetVd() );
// set_Velocities_Ground( V_north_rel_ground, V_east_rel_ground, // set_Velocities_Ground( V_north_rel_ground, V_east_rel_ground,
// V_down_rel_ground ); // V_down_rel_ground );
// set_Velocities_Local_Airmass( V_north_airmass, V_east_airmass, // set_Velocities_Local_Airmass( V_north_airmass, V_east_airmass,
// V_down_airmass ); // V_down_airmass );
// set_Velocities_Local_Rel_Airmass( V_north_rel_airmass, // set_Velocities_Local_Rel_Airmass( V_north_rel_airmass,
// V_east_rel_airmass, V_down_rel_airmass ); // V_east_rel_airmass, V_down_rel_airmass );
// set_Velocities_Gust( U_gust, V_gust, W_gust ); // set_Velocities_Gust( U_gust, V_gust, W_gust );
// set_Velocities_Wind_Body( U_body, V_body, W_body ); // set_Velocities_Wind_Body( U_body, V_body, W_body );