1 // autobrake.hxx - generic, configurable autobrake system
3 // Written by James Turner, started September 2009.
5 // Copyright (C) 2009 Curtis L. Olson
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef FG_INSTR_AUTOBRAKE_HXX
24 #define FG_INSTR_AUTOBRAKE_HXX
26 #include <simgear/props/props.hxx>
27 #include <simgear/structure/subsystem_mgr.hxx>
31 class FGAutoBrake : public SGSubsystem
35 virtual ~FGAutoBrake();
38 virtual void postinit ();
40 virtual void unbind ();
41 virtual void update (double dt);
48 void updateEngaged(double dt);
51 bool shouldEngageRTO();
54 * Helper to determine if all throttles are at idle
55 * (or have reverse thrust engaged)
57 bool throttlesAtIdle() const;
60 * Helper to determine if we're airbone, i.e weight off all wheels
62 bool airborne() const;
64 // accessors, mostly for SGRawValueMethods use
65 void setArmed(bool aArmed);
66 bool getArmed() const { return _armed; }
68 void setRTO(bool aRTO);
69 bool getRTO() const { return _rto; }
71 void setStep(int aStep);
72 int getStep() const { return _step; }
74 bool getEngaged() const { return _engaged;}
75 double getTargetDecel() const { return _targetDecel; }
76 double getActualDecel() const { return _actualDecel; }
79 double _lastGroundspeedKts;
81 bool _rto; // true if in Rejected TakeOff mode
83 bool _rtoArmed; ///< true if we have met arming criteria for RTO mode
84 bool _engaged; ///< true if auto-braking is currently active
85 double _targetDecel; // target deceleration ft-sec^2
86 double _actualDecel; // measured current deceleration in ft-sec^2
87 double _fcsBrakeControl;
89 double _leftBrakeInput; // summed pilot and co-pilot left brake input
90 double _rightBrakeInput; // summed pilot and co-pilot right brake input
91 double _leftBrakeOutput;
92 double _rightBrakeOutput;
94 SGPropertyNode_ptr _root;
95 SGPropertyNode_ptr _brakeInputs[4];
96 SGPropertyNode_ptr _weightOnWheelsNode;
97 SGPropertyNode_ptr _engineControlsNode;
98 SGPropertyNode_ptr _groundspeedNode;
102 int _configDisengageStep;
103 double _configMaxDecel; ///< deceleration (in ft-sec^2) corresponding to step=numSteps
104 double _configRTODecel; ///< deceleration (in ft-sec^2) to use in RTO mode
105 double _configRTOSpeed; ///< speed (in kts) for RTO mode to arm
108 #endif // of FG_INSTR_AUTOBRAKE_HXX