Move aos/controls to frc971/control_loops
Also put what was aos/controls/control_loops.fbs in y2012/control_loops
because that's the only user.
Change-Id: I8f402b0708103077e135a41e55ef5e4f23681d87
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/y2014/control_loops/claw/BUILD b/y2014/control_loops/claw/BUILD
index f8865a5..a79dc78 100644
--- a/y2014/control_loops/claw/BUILD
+++ b/y2014/control_loops/claw/BUILD
@@ -75,8 +75,8 @@
":claw_position_fbs",
":claw_status_fbs",
"//aos:math",
- "//aos/controls:control_loop",
- "//aos/controls:polytope",
+ "//frc971/control_loops:control_loop",
+ "//frc971/control_loops:polytope",
"//frc971/control_loops:coerce_goal",
"//frc971/control_loops:hall_effect_tracker",
"//frc971/control_loops:state_feedback_loop",
@@ -97,7 +97,7 @@
":claw_output_fbs",
":claw_position_fbs",
":claw_status_fbs",
- "//aos/controls:control_loop_test",
+ "//frc971/control_loops:control_loop_test",
"//aos/testing:googletest",
"//frc971/control_loops:state_feedback_loop",
"//frc971/control_loops:team_number_test_environment",
diff --git a/y2014/control_loops/claw/claw.cc b/y2014/control_loops/claw/claw.cc
index 56ca6b0..4f0248c 100644
--- a/y2014/control_loops/claw/claw.cc
+++ b/y2014/control_loops/claw/claw.cc
@@ -2,9 +2,8 @@
#include <algorithm>
-#include "aos/logging/logging.h"
#include "aos/commonmath.h"
-
+#include "aos/logging/logging.h"
#include "y2014/constants.h"
#include "y2014/control_loops/claw/claw_motor_plant.h"
@@ -46,8 +45,8 @@
namespace claw {
using ::frc971::HallEffectTracker;
-using ::y2014::control_loops::claw::kDt;
using ::frc971::control_loops::DoCoerceGoal;
+using ::y2014::control_loops::claw::kDt;
static const double kZeroingVoltage = 4.0;
static const double kMaxVoltage = 12.0;
@@ -57,20 +56,18 @@
: StateFeedbackLoop<4, 2, 2>(::std::move(loop)),
uncapped_average_voltage_(0.0),
is_zeroing_(true),
- U_Poly_((Eigen::Matrix<double, 4, 2>() << 1, 0,
- -1, 0,
- 0, 1,
- 0, -1).finished(),
+ U_Poly_((Eigen::Matrix<double, 4, 2>() << 1, 0, -1, 0, 0, 1, 0, -1)
+ .finished(),
(Eigen::Matrix<double, 4, 1>() << kMaxVoltage, kMaxVoltage,
- kMaxVoltage, kMaxVoltage).finished()),
- U_Poly_zeroing_((Eigen::Matrix<double, 4, 2>() << 1, 0,
- -1, 0,
- 0, 1,
- 0, -1).finished(),
- (Eigen::Matrix<double, 4, 1>() <<
- kZeroingVoltage, kZeroingVoltage,
- kZeroingVoltage, kZeroingVoltage).finished()) {
- ::aos::controls::HPolytope<0>::Init();
+ kMaxVoltage, kMaxVoltage)
+ .finished()),
+ U_Poly_zeroing_(
+ (Eigen::Matrix<double, 4, 2>() << 1, 0, -1, 0, 0, 1, 0, -1)
+ .finished(),
+ (Eigen::Matrix<double, 4, 1>() << kZeroingVoltage, kZeroingVoltage,
+ kZeroingVoltage, kZeroingVoltage)
+ .finished()) {
+ ::frc971::controls::HPolytope<0>::Init();
}
// Caps the voltage prioritizing reducing velocity error over reducing
@@ -119,8 +116,8 @@
const Eigen::Matrix<double, 4, 2> pos_poly_H = poly.H() * position_K;
const Eigen::Matrix<double, 4, 1> pos_poly_k =
poly.k() - poly.H() * velocity_K * velocity_error;
- const ::aos::controls::HPolytope<2> pos_poly(pos_poly_H, pos_poly_k);
- const ::aos::controls::HVPolytope<2, 4, 4> hv_pos_poly(
+ const ::frc971::controls::HPolytope<2> pos_poly(pos_poly_H, pos_poly_k);
+ const ::frc971::controls::HVPolytope<2, 4, 4> hv_pos_poly(
pos_poly_H, pos_poly_k, pos_poly.Vertices());
Eigen::Matrix<double, 2, 1> adjusted_pos_error;
@@ -187,7 +184,8 @@
{
const auto values = constants::GetValues().claw;
if (top_known_) {
- if (X_hat(0, 0) + X_hat(1, 0) > values.upper_claw.upper_limit && U(1, 0) > 0) {
+ if (X_hat(0, 0) + X_hat(1, 0) > values.upper_claw.upper_limit &&
+ U(1, 0) > 0) {
AOS_LOG(WARNING, "upper claw too high and moving up\n");
mutable_U(1, 0) = 0;
} else if (X_hat(0, 0) + X_hat(1, 0) < values.upper_claw.lower_limit &&
@@ -337,7 +335,6 @@
}
}
-
void BottomZeroedStateFeedbackLoop::HandleCalibrationError(
const constants::Values::Claws::Claw &claw_values) {
double edge_encoder;
@@ -369,8 +366,8 @@
}
ClawMotor::ClawMotor(::aos::EventLoop *event_loop, const ::std::string &name)
- : aos::controls::ControlLoop<Goal, Position, Status, Output>(event_loop,
- name),
+ : frc971::controls::ControlLoop<Goal, Position, Status, Output>(event_loop,
+ name),
has_top_claw_goal_(false),
top_claw_goal_(0.0),
top_claw_(this),
@@ -692,9 +689,9 @@
bottom_claw_.HandleCalibrationError(values.claw.lower_claw);
top_claw_.HandleCalibrationError(values.claw.upper_claw);
} else if (top_claw_.zeroing_state() !=
- ZeroedStateFeedbackLoop::UNKNOWN_POSITION &&
+ ZeroedStateFeedbackLoop::UNKNOWN_POSITION &&
bottom_claw_.zeroing_state() !=
- ZeroedStateFeedbackLoop::UNKNOWN_POSITION) {
+ ZeroedStateFeedbackLoop::UNKNOWN_POSITION) {
// Time to fine tune the zero.
// Limit the goals here.
if (!enabled) {
@@ -920,8 +917,8 @@
bottom_claw_goal_ -= dx;
top_claw_goal_ -= dx;
Eigen::Matrix<double, 4, 1> R;
- R << bottom_claw_goal_, top_claw_goal_ - bottom_claw_goal_, claw_.R(2, 0),
- claw_.R(3, 0);
+ R << bottom_claw_goal_, top_claw_goal_ - bottom_claw_goal_,
+ claw_.R(2, 0), claw_.R(3, 0);
claw_.mutable_U() = claw_.controller().K() * (R - claw_.X_hat());
capped_goal_ = true;
AOS_LOG(DEBUG,
@@ -943,8 +940,8 @@
bottom_claw_goal_ -= dx;
top_claw_goal_ -= dx;
Eigen::Matrix<double, 4, 1> R;
- R << bottom_claw_goal_, top_claw_goal_ - bottom_claw_goal_, claw_.R(2, 0),
- claw_.R(3, 0);
+ R << bottom_claw_goal_, top_claw_goal_ - bottom_claw_goal_,
+ claw_.R(2, 0), claw_.R(3, 0);
claw_.mutable_U() = claw_.controller().K() * (R - claw_.X_hat());
capped_goal_ = true;
AOS_LOG(DEBUG, "Moving the goal by %f to prevent windup\n", dx);
@@ -954,16 +951,16 @@
if (output) {
if (goal) {
- //setup the intake
+ // setup the intake
output_struct.intake_voltage =
(goal->intake() > 12.0)
? 12
: (goal->intake() < -12.0) ? -12.0 : goal->intake();
output_struct.tusk_voltage = goal->centering();
output_struct.tusk_voltage =
- (goal->centering() > 12.0) ? 12 : (goal->centering() < -12.0)
- ? -12.0
- : goal->centering();
+ (goal->centering() > 12.0)
+ ? 12
+ : (goal->centering() < -12.0) ? -12.0 : goal->centering();
}
output_struct.top_claw_voltage = claw_.U(1, 0);
output_struct.bottom_claw_voltage = claw_.U(0, 0);
diff --git a/y2014/control_loops/claw/claw.h b/y2014/control_loops/claw/claw.h
index 5bcccc1..07a5d2a 100644
--- a/y2014/control_loops/claw/claw.h
+++ b/y2014/control_loops/claw/claw.h
@@ -3,8 +3,8 @@
#include <memory>
-#include "aos/controls/control_loop.h"
-#include "aos/controls/polytope.h"
+#include "frc971/control_loops/control_loop.h"
+#include "frc971/control_loops/polytope.h"
#include "frc971/control_loops/coerce_goal.h"
#include "frc971/control_loops/hall_effect_tracker.h"
#include "frc971/control_loops/state_feedback_loop.h"
@@ -49,7 +49,7 @@
bool top_known_ = false, bottom_known_ = false;
- const ::aos::controls::HPolytope<2> U_Poly_, U_Poly_zeroing_;
+ const ::frc971::controls::HPolytope<2> U_Poly_, U_Poly_zeroing_;
};
class ClawMotor;
@@ -88,7 +88,9 @@
double absolute_position() const { return encoder() + offset(); }
const ::frc971::HallEffectTracker &front() const { return front_; }
- const ::frc971::HallEffectTracker &calibration() const { return calibration_; }
+ const ::frc971::HallEffectTracker &calibration() const {
+ return calibration_;
+ }
const ::frc971::HallEffectTracker &back() const { return back_; }
bool any_hall_effect_changed() const {
@@ -143,8 +145,8 @@
double last_off_encoder_;
bool any_triggered_last_;
- const ::frc971::HallEffectTracker* posedge_filter_ = nullptr;
- const ::frc971::HallEffectTracker* negedge_filter_ = nullptr;
+ const ::frc971::HallEffectTracker *posedge_filter_ = nullptr;
+ const ::frc971::HallEffectTracker *negedge_filter_ = nullptr;
private:
// Does the edges of 1 sensor for GetPositionOfEdge.
@@ -187,7 +189,7 @@
};
class ClawMotor
- : public aos::controls::ControlLoop<Goal, Position, Status, Output> {
+ : public frc971::controls::ControlLoop<Goal, Position, Status, Output> {
public:
explicit ClawMotor(::aos::EventLoop *event_loop,
const ::std::string &name = "/claw");
diff --git a/y2014/control_loops/claw/claw_lib_test.cc b/y2014/control_loops/claw/claw_lib_test.cc
index 5222ad8..eb941a1 100644
--- a/y2014/control_loops/claw/claw_lib_test.cc
+++ b/y2014/control_loops/claw/claw_lib_test.cc
@@ -3,7 +3,7 @@
#include <chrono>
#include <memory>
-#include "aos/controls/control_loop_test.h"
+#include "frc971/control_loops/control_loop_test.h"
#include "frc971/control_loops/team_number_test_environment.h"
#include "gtest/gtest.h"
#include "y2014/constants.h"
@@ -19,15 +19,15 @@
namespace claw {
namespace testing {
-using ::frc971::HallEffectStructT;
using ::aos::monotonic_clock;
+using ::frc971::HallEffectStructT;
namespace chrono = ::std::chrono;
typedef enum {
- TOP_CLAW = 0,
- BOTTOM_CLAW,
+ TOP_CLAW = 0,
+ BOTTOM_CLAW,
- CLAW_COUNT
+ CLAW_COUNT
} ClawType;
// Class which simulates the wrist and sends out queue messages containing the
@@ -62,7 +62,8 @@
AOS_LOG(INFO, "Reinitializing to {top: %f, bottom: %f}\n",
initial_top_position, initial_bottom_position);
claw_plant_->mutable_X(0, 0) = initial_bottom_position;
- claw_plant_->mutable_X(1, 0) = initial_top_position - initial_bottom_position;
+ claw_plant_->mutable_X(1, 0) =
+ initial_top_position - initial_bottom_position;
claw_plant_->mutable_X(2, 0) = 0.0;
claw_plant_->mutable_X(3, 0) = 0.0;
claw_plant_->mutable_Y() = claw_plant_->C() * claw_plant_->X();
@@ -199,7 +200,8 @@
UpdateHallEffect(half_claw->position + initial_position,
last_position.position + initial_position,
initial_position, half_claw->front.get(),
- *last_position.front.get(), claw.front, claw_name, "front");
+ *last_position.front.get(), claw.front, claw_name,
+ "front");
UpdateHallEffect(half_claw->position + initial_position,
last_position.position + initial_position,
initial_position, half_claw->calibration.get(),
@@ -245,7 +247,7 @@
// Simulates the claw moving for one timestep.
void Simulate() {
- const constants::Values& v = constants::GetValues();
+ const constants::Values &v = constants::GetValues();
EXPECT_TRUE(claw_output_fetcher_.Fetch());
Eigen::Matrix<double, 2, 1> U;
@@ -286,10 +288,10 @@
PositionT last_position_;
};
-class ClawTest : public ::aos::testing::ControlLoopTest {
+class ClawTest : public ::frc971::testing::ControlLoopTest {
protected:
ClawTest()
- : ::aos::testing::ControlLoopTest(
+ : ::frc971::testing::ControlLoopTest(
aos::configuration::ReadConfig("y2014/config.json"),
chrono::microseconds(5000)),
test_event_loop_(MakeEventLoop("test")),
@@ -431,10 +433,9 @@
EXPECT_NEAR(7.5, top_goal, 1e-4);
}
-
class ZeroingClawTest
: public ClawTest,
- public ::testing::WithParamInterface< ::std::pair<double, double>> {};
+ public ::testing::WithParamInterface<::std::pair<double, double>> {};
// Tests that the wrist zeros correctly starting on the hall effect sensor.
TEST_P(ZeroingClawTest, ParameterizedZero) {
@@ -454,29 +455,19 @@
VerifyNearGoal();
}
-INSTANTIATE_TEST_SUITE_P(ZeroingClawTest, ZeroingClawTest,
- ::testing::Values(::std::make_pair(0.04, 0.02),
- ::std::make_pair(0.2, 0.1),
- ::std::make_pair(0.3, 0.2),
- ::std::make_pair(0.4, 0.3),
- ::std::make_pair(0.5, 0.4),
- ::std::make_pair(0.6, 0.5),
- ::std::make_pair(0.7, 0.6),
- ::std::make_pair(0.8, 0.7),
- ::std::make_pair(0.9, 0.8),
- ::std::make_pair(1.0, 0.9),
- ::std::make_pair(1.1, 1.0),
- ::std::make_pair(1.15, 1.05),
- ::std::make_pair(1.05, 0.95),
- ::std::make_pair(1.2, 1.1),
- ::std::make_pair(1.3, 1.2),
- ::std::make_pair(1.4, 1.3),
- ::std::make_pair(1.5, 1.4),
- ::std::make_pair(1.6, 1.5),
- ::std::make_pair(1.7, 1.6),
- ::std::make_pair(1.8, 1.7),
- ::std::make_pair(2.015, 2.01)
-));
+INSTANTIATE_TEST_SUITE_P(
+ ZeroingClawTest, ZeroingClawTest,
+ ::testing::Values(::std::make_pair(0.04, 0.02), ::std::make_pair(0.2, 0.1),
+ ::std::make_pair(0.3, 0.2), ::std::make_pair(0.4, 0.3),
+ ::std::make_pair(0.5, 0.4), ::std::make_pair(0.6, 0.5),
+ ::std::make_pair(0.7, 0.6), ::std::make_pair(0.8, 0.7),
+ ::std::make_pair(0.9, 0.8), ::std::make_pair(1.0, 0.9),
+ ::std::make_pair(1.1, 1.0), ::std::make_pair(1.15, 1.05),
+ ::std::make_pair(1.05, 0.95), ::std::make_pair(1.2, 1.1),
+ ::std::make_pair(1.3, 1.2), ::std::make_pair(1.4, 1.3),
+ ::std::make_pair(1.5, 1.4), ::std::make_pair(1.6, 1.5),
+ ::std::make_pair(1.7, 1.6), ::std::make_pair(1.8, 1.7),
+ ::std::make_pair(2.015, 2.01)));
/*
// Tests that loosing the encoder for a second triggers a re-zero.
@@ -559,7 +550,7 @@
monotonic_clock::time_point start_time, double offset) {
SetEnabled(true);
int capped_count = 0;
- const constants::Values& values = constants::GetValues();
+ const constants::Values &values = constants::GetValues();
bool kicked = false;
bool measured = false;
while (test_event_loop_->monotonic_now() <
diff --git a/y2014/control_loops/shooter/BUILD b/y2014/control_loops/shooter/BUILD
index 9f71e95..d67050d 100644
--- a/y2014/control_loops/shooter/BUILD
+++ b/y2014/control_loops/shooter/BUILD
@@ -78,7 +78,7 @@
":shooter_output_fbs",
":shooter_position_fbs",
":shooter_status_fbs",
- "//aos/controls:control_loop",
+ "//frc971/control_loops:control_loop",
"//frc971/control_loops:control_loops_fbs",
"//frc971/control_loops:state_feedback_loop",
"//y2014:constants",
@@ -98,7 +98,7 @@
":shooter_output_fbs",
":shooter_position_fbs",
":shooter_status_fbs",
- "//aos/controls:control_loop_test",
+ "//frc971/control_loops:control_loop_test",
"//aos/testing:googletest",
"//frc971/control_loops:state_feedback_loop",
"//frc971/control_loops:team_number_test_environment",
diff --git a/y2014/control_loops/shooter/shooter.cc b/y2014/control_loops/shooter/shooter.cc
index fb115c7..52f900a 100644
--- a/y2014/control_loops/shooter/shooter.cc
+++ b/y2014/control_loops/shooter/shooter.cc
@@ -3,8 +3,8 @@
#include <stdio.h>
#include <algorithm>
-#include <limits>
#include <chrono>
+#include <limits>
#include "aos/logging/logging.h"
#include "y2014/constants.h"
@@ -17,9 +17,9 @@
namespace chrono = ::std::chrono;
using ::aos::monotonic_clock;
-using ::y2014::control_loops::shooter::kSpringConstant;
-using ::y2014::control_loops::shooter::kMaxExtension;
using ::y2014::control_loops::shooter::kDt;
+using ::y2014::control_loops::shooter::kMaxExtension;
+using ::y2014::control_loops::shooter::kSpringConstant;
using ::y2014::control_loops::shooter::MakeShooterLoop;
void ZeroedStateFeedbackLoop::CapU() {
@@ -103,8 +103,8 @@
ShooterMotor::ShooterMotor(::aos::EventLoop *event_loop,
const ::std::string &name)
- : aos::controls::ControlLoop<Goal, Position, Status, Output>(event_loop,
- name),
+ : frc971::controls::ControlLoop<Goal, Position, Status, Output>(event_loop,
+ name),
shooter_(MakeShooterLoop()),
state_(STATE_INITIALIZE),
cycles_not_moved_(0),
@@ -138,7 +138,7 @@
}
new_pos = ::std::min(::std::max(new_pos, values.shooter.lower_limit),
- values.shooter.upper_limit);
+ values.shooter.upper_limit);
return new_pos;
}
@@ -162,9 +162,8 @@
if (position->pusher_proximal()->current()) {
--proximal_posedge_validation_cycles_left_;
if (proximal_posedge_validation_cycles_left_ == 0) {
- shooter_.SetCalibration(
- position->pusher_proximal()->posedge_value(),
- values.shooter.pusher_proximal.upper_angle);
+ shooter_.SetCalibration(position->pusher_proximal()->posedge_value(),
+ values.shooter.pusher_proximal.upper_angle);
AOS_LOG(DEBUG, "Setting calibration using proximal sensor\n");
zeroed_ = true;
@@ -183,9 +182,8 @@
if (position->pusher_distal()->current()) {
--distal_posedge_validation_cycles_left_;
if (distal_posedge_validation_cycles_left_ == 0) {
- shooter_.SetCalibration(
- position->pusher_distal()->posedge_value(),
- values.shooter.pusher_distal.upper_angle);
+ shooter_.SetCalibration(position->pusher_distal()->posedge_value(),
+ values.shooter.pusher_distal.upper_angle);
AOS_LOG(DEBUG, "Setting calibration using distal sensor\n");
zeroed_ = true;
@@ -197,13 +195,12 @@
}
// Positive is out, and positive power is out.
-void ShooterMotor::RunIteration(
- const Goal *goal,
- const Position *position,
- aos::Sender<Output>::Builder *output,
- aos::Sender<Status>::Builder *status) {
+void ShooterMotor::RunIteration(const Goal *goal, const Position *position,
+ aos::Sender<Output>::Builder *output,
+ aos::Sender<Status>::Builder *status) {
OutputT output_struct;
- const monotonic_clock::time_point monotonic_now = event_loop()->monotonic_now();
+ const monotonic_clock::time_point monotonic_now =
+ event_loop()->monotonic_now();
if (goal && ::std::isnan(goal->shot_power())) {
state_ = STATE_ESTOP;
AOS_LOG(ERROR, "Estopping because got a shot power of NAN.\n");
@@ -362,7 +359,7 @@
latch_piston_ = true;
}
if (output == nullptr) {
- load_timeout_ += ::aos::controls::kLoopFrequency;
+ load_timeout_ += ::frc971::controls::kLoopFrequency;
}
// Go to 0, which should be the latch position, or trigger a hall effect
// on the way. If we don't see edges where we are supposed to, the
@@ -391,8 +388,7 @@
shooter_.goal_position()) < 0.001) {
// We are at the goal, but not latched.
state_ = STATE_LOADING_PROBLEM;
- loading_problem_end_time_ =
- monotonic_now + kLoadProblemEndTimeout;
+ loading_problem_end_time_ = monotonic_now + kLoadProblemEndTimeout;
}
}
if (load_timeout_ < monotonic_now) {
diff --git a/y2014/control_loops/shooter/shooter.h b/y2014/control_loops/shooter/shooter.h
index 1e7d4aa..ec383ad 100644
--- a/y2014/control_loops/shooter/shooter.h
+++ b/y2014/control_loops/shooter/shooter.h
@@ -3,10 +3,9 @@
#include <memory>
-#include "aos/controls/control_loop.h"
-#include "frc971/control_loops/state_feedback_loop.h"
+#include "frc971/control_loops/control_loop.h"
#include "aos/time/time.h"
-
+#include "frc971/control_loops/state_feedback_loop.h"
#include "y2014/constants.h"
#include "y2014/control_loops/shooter/shooter_goal_generated.h"
#include "y2014/control_loops/shooter/shooter_motor_plant.h"
@@ -21,7 +20,7 @@
class ShooterTest_UnloadWindupPositive_Test;
class ShooterTest_UnloadWindupNegative_Test;
class ShooterTest_RezeroWhileUnloading_Test;
-};
+}; // namespace testing
// Note: Everything in this file assumes that there is a 1 cycle delay between
// power being requested and it showing up at the motor. It assumes that
@@ -131,7 +130,7 @@
::std::chrono::milliseconds(40);
class ShooterMotor
- : public aos::controls::ControlLoop<Goal, Position, Status, Output> {
+ : public frc971::controls::ControlLoop<Goal, Position, Status, Output> {
public:
explicit ShooterMotor(::aos::EventLoop *event_loop,
const ::std::string &name = "/shooter");
diff --git a/y2014/control_loops/shooter/shooter_lib_test.cc b/y2014/control_loops/shooter/shooter_lib_test.cc
index 0a7f4f6..d3217a6 100644
--- a/y2014/control_loops/shooter/shooter_lib_test.cc
+++ b/y2014/control_loops/shooter/shooter_lib_test.cc
@@ -3,8 +3,8 @@
#include <chrono>
#include <memory>
-#include "aos/controls/control_loop_test.h"
#include "aos/network/team_number.h"
+#include "frc971/control_loops/control_loop_test.h"
#include "frc971/control_loops/team_number_test_environment.h"
#include "gtest/gtest.h"
#include "y2014/constants.h"
@@ -23,9 +23,9 @@
namespace shooter {
namespace testing {
+using ::frc971::control_loops::testing::kTeamNumber;
using ::y2014::control_loops::shooter::kMaxExtension;
using ::y2014::control_loops::shooter::MakeRawShooterPlant;
-using ::frc971::control_loops::testing::kTeamNumber;
// Class which simulates the shooter and sends out queue messages containing the
// position.
@@ -133,8 +133,7 @@
void UpdateEffectEdge(
::frc971::PosedgeOnlyCountedHallEffectStructT *sensor,
const ::frc971::PosedgeOnlyCountedHallEffectStructT &last_sensor,
- const constants::Values::AnglePair &limits,
- float last_position) {
+ const constants::Values::AnglePair &limits, float last_position) {
sensor->posedge_count = last_sensor.posedge_count;
sensor->negedge_count = last_sensor.negedge_count;
@@ -288,7 +287,7 @@
last_voltage_ = shooter_output_fetcher_->voltage();
}
- private:
+ private:
::aos::EventLoop *event_loop_;
::aos::Sender<Position> shooter_position_sender_;
::aos::Fetcher<Output> shooter_output_fetcher_;
@@ -327,10 +326,10 @@
template <typename TestType>
class ShooterTestTemplated
- : public ::aos::testing::ControlLoopTestTemplated<TestType> {
+ : public ::frc971::testing::ControlLoopTestTemplated<TestType> {
protected:
ShooterTestTemplated()
- : ::aos::testing::ControlLoopTestTemplated<TestType>(
+ : ::frc971::testing::ControlLoopTestTemplated<TestType>(
aos::configuration::ReadConfig("y2014/config.json"),
// TODO(austin): I think this runs at 5 ms in real life.
chrono::microseconds(5000)),
@@ -554,7 +553,6 @@
EXPECT_EQ(ShooterMotor::STATE_READY, shooter_motor_.state());
}
-
TEST_F(ShooterTest, Unload) {
SetEnabled(true);
{
@@ -727,7 +725,6 @@
EXPECT_EQ(ShooterMotor::STATE_READY, shooter_motor_.state());
}
-
// Tests that the shooter zeros correctly and goes to a position.
TEST_F(ShooterTest, StartsOnProximal) {
SetEnabled(true);
@@ -760,8 +757,8 @@
bool plunger_back = ::std::get<2>(GetParam());
double start_pos = ::std::get<3>(GetParam());
// flag to initialize test
- //printf("@@@@ l= %d b= %d p= %d s= %.3f\n",
- // latch, brake, plunger_back, start_pos);
+ // printf("@@@@ l= %d b= %d p= %d s= %.3f\n",
+ // latch, brake, plunger_back, start_pos);
bool initialized = false;
Reinitialize(start_pos);
{