Quiet down profiled subsystem
Change-Id: I1a723aa561e1329535e3567bb2be38f5a7cb2bc3
diff --git a/y2017/control_loops/superstructure/hood/hood.cc b/y2017/control_loops/superstructure/hood/hood.cc
index 3dcd806..4f1a4eb 100644
--- a/y2017/control_loops/superstructure/hood/hood.cc
+++ b/y2017/control_loops/superstructure/hood/hood.cc
@@ -29,7 +29,8 @@
0.5, 10.0) {}
void IndexPulseProfiledSubsystem::CapGoal(const char *name,
- Eigen::Matrix<double, 3, 1> *goal) {
+ Eigen::Matrix<double, 3, 1> *goal,
+ bool print) {
if (zeroed()) {
::frc971::control_loops::SingleDOFProfiledSubsystem<
::frc971::zeroing::PulseIndexZeroingEstimator>::CapGoal(name, goal);
@@ -40,13 +41,17 @@
// enough to find them (and the index pulse which might be right next to
// one).
if ((*goal)(0, 0) > kMaxRange) {
- AOS_LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(0, 0),
- kMaxRange);
+ if (print) {
+ AOS_LOG(WARNING, "Goal %s above limit, %f > %f\n", name, (*goal)(0, 0),
+ kMaxRange);
+ }
(*goal)(0, 0) = kMaxRange;
}
if ((*goal)(0, 0) < -kMaxRange) {
- AOS_LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(0, 0),
- kMaxRange);
+ if (print) {
+ AOS_LOG(WARNING, "Goal %s below limit, %f < %f\n", name, (*goal)(0, 0),
+ kMaxRange);
+ }
(*goal)(0, 0) = -kMaxRange;
}
}
diff --git a/y2017/control_loops/superstructure/hood/hood.h b/y2017/control_loops/superstructure/hood/hood.h
index 7778152..8284e6e 100644
--- a/y2017/control_loops/superstructure/hood/hood.h
+++ b/y2017/control_loops/superstructure/hood/hood.h
@@ -21,7 +21,8 @@
IndexPulseProfiledSubsystem();
private:
- void CapGoal(const char *name, Eigen::Matrix<double, 3, 1> *goal) override;
+ void CapGoal(const char *name, Eigen::Matrix<double, 3, 1> *goal,
+ bool print) override;
};
class Hood {