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();
59 // accessors, mostly for SGRawValueMethods use
60 void setArmed(bool aArmed);
61 bool getArmed() const { return _armed; }
63 void setRTO(bool aRTO);
64 bool getRTO() const { return _rto; }
66 void setStep(int aStep);
67 int getStep() const { return _step; }
69 bool getEngaged() const { return _engaged;}
70 double getTargetDecel() const { return _targetDecel; }
71 double getActualDecel() const { return _actualDecel; }
74 double _lastGroundspeedKts;
76 bool _rto; // true if in Rejected TakeOff mode
78 bool _rtoArmed; ///< true if we have met arming criteria for RTO mode
79 bool _engaged; ///< true if auto-braking is currently active
80 double _targetDecel; // target deceleration ft-sec^2
81 double _actualDecel; // measured current deceleration in ft-sec^2
82 double _fcsBrakeControl;
84 double _leftBrakeInput; // summed pilot and co-pilot left brake input
85 double _rightBrakeInput; // summed pilot and co-pilot right brake input
86 double _leftBrakeOutput;
87 double _rightBrakeOutput;
89 SGPropertyNode_ptr _root;
90 SGPropertyNode* _brakeInputs[4];
91 SGPropertyNode_ptr _weightOnWheelsNode;
92 SGPropertyNode_ptr _engineControlsNode;
93 SGPropertyNode_ptr _groundspeedNode;
97 double _configMaxDecel; ///< deceleration (in ft-sec^2) corresponding to step=numSteps
98 double _configRTODecel; ///< deceleration (in ft-sec^2) to use in RTO mode
99 double _configRTOSpeed; ///< speed (in kts) for RTO mode to arm
102 #endif // of FG_INSTR_AUTOBRAKE_HXX