Tweaks from Tony to JSBSim.cxx jsbsim interface to flightgear.
Added ls_trim.c to the LaRCsim library.
This commit is contained in:
parent
d9bff43bde
commit
e9d12ee586
3 changed files with 9 additions and 13 deletions
|
@ -59,7 +59,9 @@
|
||||||
|
|
||||||
FGJSBsim::FGJSBsim(void) {
|
FGJSBsim::FGJSBsim(void) {
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
|
runcount=0;
|
||||||
|
|
||||||
fdmex=new FGFDMExec;
|
fdmex=new FGFDMExec;
|
||||||
fgic=new FGInitialCondition(fdmex);
|
fgic=new FGInitialCondition(fdmex);
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
|
@ -203,12 +205,6 @@ bool FGJSBsim::update( int multiloop ) {
|
||||||
|
|
||||||
double save_alt = 0.0;
|
double save_alt = 0.0;
|
||||||
|
|
||||||
|
|
||||||
// lets try to avoid really screwing up the JSBsim model
|
|
||||||
if ( get_Altitude() < -9000 ) {
|
|
||||||
save_alt = get_Altitude();
|
|
||||||
set_Altitude( 0.0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
copy_to_JSBsim();
|
copy_to_JSBsim();
|
||||||
|
|
||||||
|
@ -228,8 +224,9 @@ bool FGJSBsim::update( int multiloop ) {
|
||||||
}
|
}
|
||||||
fgtrim->ReportState();
|
fgtrim->ReportState();
|
||||||
delete fgtrim;
|
delete fgtrim;
|
||||||
|
|
||||||
needTrim=false;
|
|
||||||
|
needTrim=false;
|
||||||
|
|
||||||
|
|
||||||
controls.set_elevator_trim(fdmex->GetFCS()->GetPitchTrimCmd());
|
controls.set_elevator_trim(fdmex->GetFCS()->GetPitchTrimCmd());
|
||||||
|
@ -264,9 +261,7 @@ bool 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 ) {
|
|
||||||
set_Altitude( save_alt );
|
|
||||||
}
|
|
||||||
|
|
||||||
//climb rate now set from FDM in copy_from_x()
|
//climb rate now set from FDM in copy_from_x()
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -200,6 +200,7 @@ private:
|
||||||
FGInitialCondition *fgic;
|
FGInitialCondition *fgic;
|
||||||
bool needTrim;
|
bool needTrim;
|
||||||
|
|
||||||
|
int runcount;
|
||||||
bool trimmed;
|
bool trimmed;
|
||||||
float trim_elev;
|
float trim_elev;
|
||||||
float trim_throttle;
|
float trim_throttle;
|
||||||
|
|
|
@ -27,7 +27,7 @@ libLaRCsim_a_SOURCES = \
|
||||||
ls_model.c ls_model.h \
|
ls_model.c ls_model.h \
|
||||||
ls_sim_control.h \
|
ls_sim_control.h \
|
||||||
ls_step.c ls_step.h \
|
ls_step.c ls_step.h \
|
||||||
ls_sym.h ls_types.h \
|
ls_sym.h ls_trim.c ls_types.h \
|
||||||
$(AIRCRAFT_MODEL) \
|
$(AIRCRAFT_MODEL) \
|
||||||
ls_interface.c ls_interface.h
|
ls_interface.c ls_interface.h
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue