Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 1 | #ifndef FRC971_CONTROL_LOOPS_PROFILED_SUBSYSTEM_H_ |
| 2 | #define FRC971_CONTROL_LOOPS_PROFILED_SUBSYSTEM_H_ |
| 3 | |
| 4 | #include <array> |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 5 | #include <chrono> |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 6 | #include <memory> |
| 7 | #include <utility> |
| 8 | |
| 9 | #include "Eigen/Dense" |
| 10 | |
| 11 | #include "aos/common/controls/control_loop.h" |
| 12 | #include "aos/common/util/trapezoid_profile.h" |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 13 | #include "frc971/control_loops/control_loops.q.h" |
| 14 | #include "frc971/control_loops/profiled_subsystem.q.h" |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 15 | #include "frc971/control_loops/simple_capped_state_feedback_loop.h" |
| 16 | #include "frc971/control_loops/state_feedback_loop.h" |
| 17 | #include "frc971/zeroing/zeroing.h" |
Austin Schuh | 00be3a8 | 2017-02-05 19:01:40 -0800 | [diff] [blame^] | 18 | #include "frc971/constants.h" |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 19 | |
| 20 | namespace frc971 { |
| 21 | namespace control_loops { |
| 22 | |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 23 | // TODO(Brian): Use a tuple instead of an array to support heterogeneous zeroing |
| 24 | // styles. |
| 25 | template <int number_of_states, int number_of_axes, |
| 26 | class ZeroingEstimator = |
| 27 | ::frc971::zeroing::PotAndIndexPulseZeroingEstimator> |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 28 | class ProfiledSubsystem { |
| 29 | public: |
| 30 | ProfiledSubsystem( |
| 31 | ::std::unique_ptr<::frc971::control_loops::SimpleCappedStateFeedbackLoop< |
Tyler Chatow | f8f0311 | 2017-02-05 14:31:34 -0800 | [diff] [blame] | 32 | number_of_states, number_of_axes, number_of_axes>> loop, |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 33 | ::std::array<ZeroingEstimator, number_of_axes> &&estimators) |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 34 | : loop_(::std::move(loop)), estimators_(::std::move(estimators)) { |
| 35 | zeroed_.fill(false); |
| 36 | unprofiled_goal_.setZero(); |
| 37 | } |
| 38 | |
| 39 | // Returns whether an error has occured |
| 40 | bool error() const { |
| 41 | for (const auto &estimator : estimators_) { |
| 42 | if (estimator.error()) { |
| 43 | return true; |
| 44 | } |
| 45 | } |
| 46 | return false; |
| 47 | } |
| 48 | |
| 49 | void Reset() { |
| 50 | zeroed_.fill(false); |
| 51 | for (auto &estimator : estimators_) { |
| 52 | estimator.Reset(); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // Returns the controller. |
Tyler Chatow | f8f0311 | 2017-02-05 14:31:34 -0800 | [diff] [blame] | 57 | const StateFeedbackLoop<number_of_states, number_of_axes, number_of_axes> & |
| 58 | controller() const { |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 59 | return *loop_; |
| 60 | } |
| 61 | |
| 62 | int controller_index() const { return loop_->controller_index(); } |
| 63 | |
| 64 | // Returns whether the estimators have been initialized and zeroed. |
| 65 | bool initialized() const { return initialized_; } |
| 66 | |
| 67 | bool zeroed() const { |
| 68 | for (int i = 0; i < number_of_axes; ++i) { |
| 69 | if (!zeroed_[i]) { |
| 70 | return false; |
| 71 | } |
| 72 | } |
| 73 | return true; |
| 74 | } |
| 75 | |
| 76 | bool zeroed(int index) const { return zeroed_[index]; }; |
| 77 | |
| 78 | // Returns the filtered goal. |
| 79 | const Eigen::Matrix<double, number_of_states, 1> &goal() const { |
| 80 | return loop_->R(); |
| 81 | } |
| 82 | double goal(int row, int col) const { return loop_->R(row, col); } |
| 83 | |
| 84 | // Returns the unprofiled goal. |
| 85 | const Eigen::Matrix<double, number_of_states, 1> &unprofiled_goal() const { |
| 86 | return unprofiled_goal_; |
| 87 | } |
| 88 | double unprofiled_goal(int row, int col) const { |
| 89 | return unprofiled_goal_(row, col); |
| 90 | } |
| 91 | |
| 92 | // Returns the current state estimate. |
| 93 | const Eigen::Matrix<double, number_of_states, 1> &X_hat() const { |
| 94 | return loop_->X_hat(); |
| 95 | } |
| 96 | double X_hat(int row, int col) const { return loop_->X_hat(row, col); } |
| 97 | |
| 98 | // Returns the current internal estimator state for logging. |
| 99 | ::frc971::EstimatorState EstimatorState(int index) { |
| 100 | ::frc971::EstimatorState estimator_state; |
| 101 | ::frc971::zeroing::PopulateEstimatorState(estimators_[index], |
| 102 | &estimator_state); |
| 103 | |
| 104 | return estimator_state; |
| 105 | } |
| 106 | |
| 107 | // Sets the maximum voltage that will be commanded by the loop. |
| 108 | void set_max_voltage(::std::array<double, number_of_axes> voltages) { |
| 109 | for (int i = 0; i < number_of_axes; ++i) { |
| 110 | loop_->set_max_voltage(i, voltages[i]); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | protected: |
| 115 | void set_zeroed(int index, bool val) { zeroed_[index] = val; } |
| 116 | |
| 117 | // TODO(austin): It's a bold assumption to assume that we will have the same |
| 118 | // number of sensors as axes. So far, that's been fine. |
| 119 | ::std::unique_ptr<::frc971::control_loops::SimpleCappedStateFeedbackLoop< |
Tyler Chatow | f8f0311 | 2017-02-05 14:31:34 -0800 | [diff] [blame] | 120 | number_of_states, number_of_axes, number_of_axes>> loop_; |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 121 | |
| 122 | // The goal that the profile tries to reach. |
| 123 | Eigen::Matrix<double, number_of_states, 1> unprofiled_goal_; |
| 124 | |
| 125 | bool initialized_ = false; |
| 126 | |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 127 | ::std::array<ZeroingEstimator, number_of_axes> estimators_; |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 128 | |
| 129 | private: |
| 130 | ::std::array<bool, number_of_axes> zeroed_; |
| 131 | }; |
| 132 | |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 133 | template <class ZeroingEstimator = |
| 134 | ::frc971::zeroing::PotAndIndexPulseZeroingEstimator> |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 135 | class SingleDOFProfiledSubsystem |
| 136 | : public ::frc971::control_loops::ProfiledSubsystem<3, 1> { |
| 137 | public: |
| 138 | SingleDOFProfiledSubsystem( |
| 139 | ::std::unique_ptr<SimpleCappedStateFeedbackLoop<3, 1, 1>> loop, |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 140 | const typename ZeroingEstimator::ZeroingConstants &zeroing_constants, |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 141 | const ::frc971::constants::Range &range, double default_angular_velocity, |
| 142 | double default_angular_acceleration); |
| 143 | |
| 144 | // Updates our estimator with the latest position. |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 145 | void Correct(typename ZeroingEstimator::Position position); |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 146 | // Runs the controller and profile generator for a cycle. |
| 147 | void Update(bool disabled); |
| 148 | |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 149 | // Fills out the ProfiledJointStatus structure with the current state. |
| 150 | void PopulateStatus(ProfiledJointStatus *status); |
| 151 | |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 152 | // Forces the current goal to the provided goal, bypassing the profiler. |
| 153 | void ForceGoal(double goal); |
| 154 | // Sets the unprofiled goal. The profiler will generate a profile to go to |
| 155 | // this goal. |
| 156 | void set_unprofiled_goal(double unprofiled_goal); |
| 157 | // Limits our profiles to a max velocity and acceleration for proper motion. |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 158 | void AdjustProfile(const ::frc971::ProfileParameters &profile_parameters); |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 159 | void AdjustProfile(double max_angular_velocity, |
| 160 | double max_angular_acceleration); |
| 161 | |
| 162 | // Returns true if we have exceeded any hard limits. |
| 163 | bool CheckHardLimits(); |
| 164 | |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 165 | // Returns the requested voltage. |
| 166 | double voltage() const { return loop_->U(0, 0); } |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 167 | |
| 168 | // Returns the current position. |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 169 | double position() const { return Y_(0, 0); } |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 170 | |
| 171 | // For testing: |
| 172 | // Triggers an estimator error. |
| 173 | void TriggerEstimatorError() { estimators_[0].TriggerError(); } |
| 174 | |
Austin Schuh | 00be3a8 | 2017-02-05 19:01:40 -0800 | [diff] [blame^] | 175 | const ::frc971::constants::Range &range() const { return range_; } |
| 176 | |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 177 | private: |
| 178 | // Limits the provided goal to the soft limits. Prints "name" when it fails |
| 179 | // to aid debugging. |
| 180 | void CapGoal(const char *name, Eigen::Matrix<double, 3, 1> *goal); |
| 181 | |
| 182 | void UpdateOffset(double offset); |
| 183 | |
| 184 | aos::util::TrapezoidProfile profile_; |
| 185 | |
| 186 | // Current measurement. |
| 187 | Eigen::Matrix<double, 1, 1> Y_; |
| 188 | // Current offset. Y_ = offset_ + raw_sensor; |
| 189 | Eigen::Matrix<double, 1, 1> offset_; |
| 190 | |
| 191 | const ::frc971::constants::Range range_; |
| 192 | |
| 193 | const double default_velocity_; |
| 194 | const double default_acceleration_; |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 195 | |
| 196 | double last_position_ = 0; |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 197 | }; |
| 198 | |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 199 | namespace internal { |
| 200 | |
| 201 | double UseUnlessZero(double target_value, double default_value); |
| 202 | |
| 203 | } // namespace internal |
| 204 | |
| 205 | template <class ZeroingEstimator> |
| 206 | SingleDOFProfiledSubsystem<ZeroingEstimator>::SingleDOFProfiledSubsystem( |
| 207 | ::std::unique_ptr<SimpleCappedStateFeedbackLoop<3, 1, 1>> loop, |
| 208 | const typename ZeroingEstimator::ZeroingConstants &zeroing_constants, |
| 209 | const ::frc971::constants::Range &range, double default_velocity, |
| 210 | double default_acceleration) |
| 211 | : ProfiledSubsystem(::std::move(loop), {{zeroing_constants}}), |
| 212 | profile_(::aos::controls::kLoopFrequency), |
| 213 | range_(range), |
| 214 | default_velocity_(default_velocity), |
| 215 | default_acceleration_(default_acceleration) { |
| 216 | Y_.setZero(); |
| 217 | offset_.setZero(); |
| 218 | AdjustProfile(0.0, 0.0); |
| 219 | } |
| 220 | |
| 221 | template <class ZeroingEstimator> |
| 222 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::UpdateOffset(double offset) { |
| 223 | const double doffset = offset - offset_(0, 0); |
| 224 | LOG(INFO, "Adjusting offset from %f to %f\n", offset_(0, 0), offset); |
| 225 | |
| 226 | loop_->mutable_X_hat()(0, 0) += doffset; |
| 227 | Y_(0, 0) += doffset; |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 228 | last_position_ += doffset; |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 229 | loop_->mutable_R(0, 0) += doffset; |
| 230 | |
| 231 | profile_.MoveGoal(doffset); |
| 232 | offset_(0, 0) = offset; |
| 233 | |
| 234 | CapGoal("R", &loop_->mutable_R()); |
| 235 | } |
| 236 | |
| 237 | template <class ZeroingEstimator> |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 238 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::PopulateStatus( |
| 239 | ProfiledJointStatus *status) { |
| 240 | status->zeroed = zeroed(); |
Austin Schuh | 00be3a8 | 2017-02-05 19:01:40 -0800 | [diff] [blame^] | 241 | status->state = -1; |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 242 | // We don't know, so default to the bad case. |
| 243 | status->estopped = true; |
| 244 | |
| 245 | status->position = X_hat(0, 0); |
| 246 | status->velocity = X_hat(1, 0); |
| 247 | status->goal_position = goal(0, 0); |
| 248 | status->goal_velocity = goal(1, 0); |
| 249 | status->unprofiled_goal_position = unprofiled_goal(0, 0); |
| 250 | status->unprofiled_goal_velocity = unprofiled_goal(1, 0); |
| 251 | status->voltage_error = X_hat(2, 0); |
| 252 | status->calculated_velocity = |
| 253 | (position() - last_position_) / |
| 254 | ::std::chrono::duration_cast<::std::chrono::duration<double>>( |
| 255 | ::aos::controls::kLoopFrequency) |
| 256 | .count(); |
| 257 | |
| 258 | status->estimator_state = EstimatorState(0); |
| 259 | |
| 260 | Eigen::Matrix<double, 3, 1> error = controller().error(); |
| 261 | status->position_power = controller().K(0, 0) * error(0, 0); |
| 262 | status->velocity_power = controller().K(0, 1) * error(1, 0); |
| 263 | } |
| 264 | |
| 265 | template <class ZeroingEstimator> |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 266 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::Correct( |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 267 | typename ZeroingEstimator::Position new_position) { |
| 268 | estimators_[0].UpdateEstimate(new_position); |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 269 | |
| 270 | if (estimators_[0].error()) { |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 271 | LOG(ERROR, "zeroing error\n"); |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 272 | return; |
| 273 | } |
| 274 | |
| 275 | if (!initialized_) { |
| 276 | if (estimators_[0].offset_ready()) { |
| 277 | UpdateOffset(estimators_[0].offset()); |
| 278 | initialized_ = true; |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | if (!zeroed(0) && estimators_[0].zeroed()) { |
| 283 | UpdateOffset(estimators_[0].offset()); |
| 284 | set_zeroed(0, true); |
| 285 | } |
| 286 | |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 287 | last_position_ = position(); |
| 288 | Y_ << new_position.encoder; |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 289 | Y_ += offset_; |
| 290 | loop_->Correct(Y_); |
| 291 | } |
| 292 | |
| 293 | template <class ZeroingEstimator> |
| 294 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::CapGoal( |
| 295 | const char *name, Eigen::Matrix<double, 3, 1> *goal) { |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 296 | // Limit the goal to min/max allowable positions. |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 297 | if ((*goal)(0, 0) > range_.upper) { |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 298 | LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(0, 0), |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 299 | range_.upper); |
| 300 | (*goal)(0, 0) = range_.upper; |
| 301 | } |
| 302 | if ((*goal)(0, 0) < range_.lower) { |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 303 | LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(0, 0), |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 304 | range_.lower); |
| 305 | (*goal)(0, 0) = range_.lower; |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | template <class ZeroingEstimator> |
| 310 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::ForceGoal(double goal) { |
| 311 | set_unprofiled_goal(goal); |
| 312 | loop_->mutable_R() = unprofiled_goal_; |
| 313 | loop_->mutable_next_R() = loop_->R(); |
| 314 | |
| 315 | profile_.MoveCurrentState(loop_->R().block<2, 1>(0, 0)); |
| 316 | } |
| 317 | |
| 318 | template <class ZeroingEstimator> |
| 319 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::set_unprofiled_goal( |
| 320 | double unprofiled_goal) { |
| 321 | unprofiled_goal_(0, 0) = unprofiled_goal; |
| 322 | unprofiled_goal_(1, 0) = 0.0; |
| 323 | unprofiled_goal_(2, 0) = 0.0; |
| 324 | CapGoal("unprofiled R", &unprofiled_goal_); |
| 325 | } |
| 326 | |
| 327 | template <class ZeroingEstimator> |
| 328 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::Update(bool disable) { |
| 329 | if (!disable) { |
| 330 | ::Eigen::Matrix<double, 2, 1> goal_state = |
| 331 | profile_.Update(unprofiled_goal_(0, 0), unprofiled_goal_(1, 0)); |
| 332 | |
| 333 | loop_->mutable_next_R(0, 0) = goal_state(0, 0); |
| 334 | loop_->mutable_next_R(1, 0) = goal_state(1, 0); |
| 335 | loop_->mutable_next_R(2, 0) = 0.0; |
| 336 | CapGoal("next R", &loop_->mutable_next_R()); |
| 337 | } |
| 338 | |
| 339 | loop_->Update(disable); |
| 340 | |
| 341 | if (!disable && loop_->U(0, 0) != loop_->U_uncapped(0, 0)) { |
| 342 | profile_.MoveCurrentState(loop_->R().block<2, 1>(0, 0)); |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | template <class ZeroingEstimator> |
| 347 | bool SingleDOFProfiledSubsystem<ZeroingEstimator>::CheckHardLimits() { |
| 348 | // Returns whether hard limits have been exceeded. |
| 349 | |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 350 | if (position() > range_.upper_hard || position() < range_.lower_hard) { |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 351 | LOG(ERROR, |
| 352 | "SingleDOFProfiledSubsystem at %f out of bounds [%f, %f], ESTOPing\n", |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 353 | position(), range_.lower_hard, range_.upper_hard); |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 354 | return true; |
| 355 | } |
| 356 | |
| 357 | return false; |
| 358 | } |
| 359 | |
| 360 | template <class ZeroingEstimator> |
| 361 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::AdjustProfile( |
Austin Schuh | 3634ed3 | 2017-02-05 16:28:49 -0800 | [diff] [blame] | 362 | const ::frc971::ProfileParameters &profile_parameters) { |
| 363 | AdjustProfile(profile_parameters.max_velocity, |
| 364 | profile_parameters.max_acceleration); |
| 365 | } |
| 366 | |
| 367 | template <class ZeroingEstimator> |
| 368 | void SingleDOFProfiledSubsystem<ZeroingEstimator>::AdjustProfile( |
Brian Silverman | ab0b677 | 2017-02-05 16:16:21 -0800 | [diff] [blame] | 369 | double max_angular_velocity, double max_angular_acceleration) { |
| 370 | profile_.set_maximum_velocity( |
| 371 | internal::UseUnlessZero(max_angular_velocity, default_velocity_)); |
| 372 | profile_.set_maximum_acceleration( |
| 373 | internal::UseUnlessZero(max_angular_acceleration, default_acceleration_)); |
| 374 | } |
| 375 | |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 376 | } // namespace control_loops |
| 377 | } // namespace frc971 |
| 378 | |
| 379 | #endif // FRC971_CONTROL_LOOPS_PROFILED_SUBSYSTEM_H_ |