James Turner: Add autobrake functionality
This commit is contained in:
parent
b937b5bbea
commit
6fec83155e
2 changed files with 20 additions and 2 deletions
|
@ -258,6 +258,10 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
speedbrake_pos_pct->setDoubleValue(0);
|
||||
spoilers_pos_pct->setDoubleValue(0);
|
||||
|
||||
ab_brake_engaged = fgGetNode("/autopilot/autobrake/engaged", true);
|
||||
ab_brake_left_pct = fgGetNode("/autopilot/autobrake/brake-left-output", true);
|
||||
ab_brake_right_pct = fgGetNode("/autopilot/autobrake/brake-right-output", true);
|
||||
|
||||
temperature = fgGetNode("/environment/temperature-degc",true);
|
||||
pressure = fgGetNode("/environment/pressure-inhg",true);
|
||||
density = fgGetNode("/environment/density-slugft3",true);
|
||||
|
@ -542,8 +546,18 @@ bool FGJSBsim::copy_to_JSBsim()
|
|||
// Parking brake sets minimum braking
|
||||
// level for mains.
|
||||
double parking_brake = globals->get_controls()->get_brake_parking();
|
||||
FCS->SetLBrake(FMAX(globals->get_controls()->get_brake_left(), parking_brake));
|
||||
FCS->SetRBrake(FMAX(globals->get_controls()->get_brake_right(), parking_brake));
|
||||
double left_brake = globals->get_controls()->get_brake_left();
|
||||
double right_brake = globals->get_controls()->get_brake_right();
|
||||
|
||||
if (ab_brake_engaged->getBoolValue()) {
|
||||
left_brake = ab_brake_left_pct->getDoubleValue();
|
||||
right_brake = ab_brake_right_pct->getDoubleValue();
|
||||
}
|
||||
|
||||
FCS->SetLBrake(FMAX(left_brake, parking_brake));
|
||||
FCS->SetRBrake(FMAX(right_brake, parking_brake));
|
||||
|
||||
|
||||
FCS->SetCBrake( 0.0 );
|
||||
// FCS->SetCBrake( globals->get_controls()->get_brake(2) );
|
||||
|
||||
|
|
|
@ -254,6 +254,10 @@ private:
|
|||
SGPropertyNode_ptr speedbrake_pos_pct;
|
||||
SGPropertyNode_ptr spoilers_pos_pct;
|
||||
|
||||
SGPropertyNode_ptr ab_brake_engaged;
|
||||
SGPropertyNode_ptr ab_brake_left_pct;
|
||||
SGPropertyNode_ptr ab_brake_right_pct;
|
||||
|
||||
SGPropertyNode_ptr gear_pos_pct;
|
||||
SGPropertyNode_ptr wing_fold_pos_pct;
|
||||
SGPropertyNode_ptr tailhook_pos_pct;
|
||||
|
|
Loading…
Add table
Reference in a new issue