Finish moving //y2014/... into its own namespace
Stuff didn't compile in the half-switched state it was in before.
Change-Id: I00ec3c79a2682982b12d4e8c8e682cb8625eb06d
diff --git a/y2014/control_loops/shooter/replay_shooter.cc b/y2014/control_loops/shooter/replay_shooter.cc
index 20c953f..1263f8a 100644
--- a/y2014/control_loops/shooter/replay_shooter.cc
+++ b/y2014/control_loops/shooter/replay_shooter.cc
@@ -14,8 +14,8 @@
::aos::InitNRT();
- ::aos::controls::ControlLoopReplayer<::frc971::control_loops::ShooterQueue>
- replayer(&::frc971::control_loops::shooter_queue, "shooter");
+ ::aos::controls::ControlLoopReplayer<::y2014::control_loops::ShooterQueue>
+ replayer(&::y2014::control_loops::shooter_queue, "shooter");
for (int i = 1; i < argc; ++i) {
replayer.ProcessFile(argv[i]);
}
diff --git a/y2014/control_loops/shooter/shooter.cc b/y2014/control_loops/shooter/shooter.cc
index 39bf5c0..faeeaf0 100644
--- a/y2014/control_loops/shooter/shooter.cc
+++ b/y2014/control_loops/shooter/shooter.cc
@@ -44,7 +44,7 @@
LOG_STRUCT(
DEBUG, "shooter_output",
- ::frc971::control_loops::ShooterVoltageToLog(X_hat(2, 0), voltage_));
+ ::y2014::control_loops::ShooterVoltageToLog(X_hat(2, 0), voltage_));
last_voltage_ = voltage_;
capped_goal_ = false;
@@ -64,7 +64,7 @@
}
capped_goal_ = true;
LOG_STRUCT(DEBUG, "to prevent windup",
- ::frc971::control_loops::ShooterMovingGoal(dx));
+ ::y2014::control_loops::ShooterMovingGoal(dx));
} else if (uncapped_voltage() < -max_voltage_) {
double dx;
if (controller_index() == 0) {
@@ -78,7 +78,7 @@
}
capped_goal_ = true;
LOG_STRUCT(DEBUG, "to prevent windup",
- ::frc971::control_loops::ShooterMovingGoal(dx));
+ ::y2014::control_loops::ShooterMovingGoal(dx));
} else {
capped_goal_ = false;
}
@@ -105,13 +105,13 @@
mutable_R(2, 0) += -A(1, 0) / A(1, 2) * (doffset);
}
LOG_STRUCT(DEBUG, "sensor edge (fake?)",
- ::frc971::control_loops::ShooterChangeCalibration(
+ ::y2014::control_loops::ShooterChangeCalibration(
encoder_val, known_position, old_position, absolute_position(),
previous_offset, offset_));
}
-ShooterMotor::ShooterMotor(::frc971::control_loops::ShooterQueue *my_shooter)
- : aos::controls::ControlLoop<::frc971::control_loops::ShooterQueue>(
+ShooterMotor::ShooterMotor(::y2014::control_loops::ShooterQueue *my_shooter)
+ : aos::controls::ControlLoop<::y2014::control_loops::ShooterQueue>(
my_shooter),
shooter_(MakeShooterLoop()),
state_(STATE_INITIALIZE),
@@ -136,11 +136,11 @@
(kMaxExtension - values.shooter.upper_limit));
if (power < 0) {
LOG_STRUCT(WARNING, "negative power",
- ::frc971::control_loops::PowerAdjustment(power, 0));
+ ::y2014::control_loops::PowerAdjustment(power, 0));
power = 0;
} else if (power > maxpower) {
LOG_STRUCT(WARNING, "power too high",
- ::frc971::control_loops::PowerAdjustment(power, maxpower));
+ ::y2014::control_loops::PowerAdjustment(power, maxpower));
power = maxpower;
}
@@ -164,7 +164,7 @@
}
void ShooterMotor::CheckCalibrations(
- const ::frc971::control_loops::ShooterQueue::Position *position) {
+ const ::y2014::control_loops::ShooterQueue::Position *position) {
CHECK_NOTNULL(position);
const constants::Values &values = constants::GetValues();
@@ -213,10 +213,10 @@
// Positive is out, and positive power is out.
void ShooterMotor::RunIteration(
- const ::frc971::control_loops::ShooterQueue::Goal *goal,
- const ::frc971::control_loops::ShooterQueue::Position *position,
- ::frc971::control_loops::ShooterQueue::Output *output,
- ::frc971::control_loops::ShooterQueue::Status *status) {
+ const ::y2014::control_loops::ShooterQueue::Goal *goal,
+ const ::y2014::control_loops::ShooterQueue::Position *position,
+ ::y2014::control_loops::ShooterQueue::Output *output,
+ ::y2014::control_loops::ShooterQueue::Status *status) {
if (goal && ::std::isnan(goal->shot_power)) {
state_ = STATE_ESTOP;
LOG(ERROR, "Estopping because got a shot power of NAN.\n");
@@ -648,7 +648,7 @@
if (!shooter_loop_disable) {
LOG_STRUCT(DEBUG, "running the loop",
- ::frc971::control_loops::ShooterStatusToLog(
+ ::y2014::control_loops::ShooterStatusToLog(
shooter_.goal_position(), shooter_.absolute_position()));
if (!cap_goal) {
shooter_.set_max_voltage(12.0);
@@ -675,7 +675,7 @@
if (position) {
LOG_STRUCT(DEBUG, "internal state",
- ::frc971::control_loops::ShooterStateToLog(
+ ::y2014::control_loops::ShooterStateToLog(
shooter_.absolute_position(), shooter_.absolute_velocity(),
state_, position->latch, position->pusher_proximal.current,
position->pusher_distal.current, position->plunger,
diff --git a/y2014/control_loops/shooter/shooter.h b/y2014/control_loops/shooter/shooter.h
index 107fc65..cccb953 100644
--- a/y2014/control_loops/shooter/shooter.h
+++ b/y2014/control_loops/shooter/shooter.h
@@ -122,10 +122,10 @@
const Time kPrepareFireEndTime = Time::InMS(40);
class ShooterMotor
- : public aos::controls::ControlLoop<::frc971::control_loops::ShooterQueue> {
+ : public aos::controls::ControlLoop<::y2014::control_loops::ShooterQueue> {
public:
- explicit ShooterMotor(::frc971::control_loops::ShooterQueue *my_shooter =
- &::frc971::control_loops::shooter_queue);
+ explicit ShooterMotor(::y2014::control_loops::ShooterQueue *my_shooter =
+ &::y2014::control_loops::shooter_queue);
// True if the goal was moved to avoid goal windup.
bool capped_goal() const { return shooter_.capped_goal(); }
@@ -133,7 +133,7 @@
double PowerToPosition(double power);
double PositionToPower(double position);
void CheckCalibrations(
- const ::frc971::control_loops::ShooterQueue::Position *position);
+ const ::y2014::control_loops::ShooterQueue::Position *position);
typedef enum {
STATE_INITIALIZE = 0,
@@ -154,10 +154,10 @@
protected:
virtual void RunIteration(
- const ::frc971::control_loops::ShooterQueue::Goal *goal,
- const ::frc971::control_loops::ShooterQueue::Position *position,
- ::frc971::control_loops::ShooterQueue::Output *output,
- ::frc971::control_loops::ShooterQueue::Status *status);
+ const ::y2014::control_loops::ShooterQueue::Goal *goal,
+ const ::y2014::control_loops::ShooterQueue::Position *position,
+ ::y2014::control_loops::ShooterQueue::Output *output,
+ ::y2014::control_loops::ShooterQueue::Status *status);
private:
// We have to override this to keep the pistons in the correct positions.
@@ -179,7 +179,7 @@
load_timeout_ = Time::Now() + kLoadTimeout;
}
- ::frc971::control_loops::ShooterQueue::Position last_position_;
+ ::y2014::control_loops::ShooterQueue::Position last_position_;
ZeroedStateFeedbackLoop shooter_;
diff --git a/y2014/control_loops/shooter/shooter.q b/y2014/control_loops/shooter/shooter.q
index eaaaa2e..ab8f590 100644
--- a/y2014/control_loops/shooter/shooter.q
+++ b/y2014/control_loops/shooter/shooter.q
@@ -1,4 +1,4 @@
-package frc971.control_loops;
+package y2014.control_loops;
import "aos/common/controls/control_loops.q";
import "frc971/control_loops/control_loops.q";
@@ -31,9 +31,9 @@
// plunger is all the way back and latched.
bool plunger;
// Gets triggered when the pusher is all the way back.
- PosedgeOnlyCountedHallEffectStruct pusher_distal;
+ .frc971.PosedgeOnlyCountedHallEffectStruct pusher_distal;
// Triggers just before pusher_distal.
- PosedgeOnlyCountedHallEffectStruct pusher_proximal;
+ .frc971.PosedgeOnlyCountedHallEffectStruct pusher_proximal;
// Triggers when the latch engages.
bool latch;
};
diff --git a/y2014/control_loops/shooter/shooter_lib_test.cc b/y2014/control_loops/shooter/shooter_lib_test.cc
index e22ee7a..ce279bb 100644
--- a/y2014/control_loops/shooter/shooter_lib_test.cc
+++ b/y2014/control_loops/shooter/shooter_lib_test.cc
@@ -86,7 +86,7 @@
// Sets the values of the physical sensors that can be directly observed
// (encoder, hall effect).
void SetPhysicalSensors(
- ::frc971::control_loops::ShooterQueue::Position *position) {
+ ::y2014::control_loops::ShooterQueue::Position *position) {
const constants::Values &values = constants::GetValues();
position->position = GetPosition();
@@ -119,7 +119,7 @@
::frc971::PosedgeOnlyCountedHallEffectStruct *sensor,
const ::frc971::PosedgeOnlyCountedHallEffectStruct &last_sensor,
const constants::Values::AnglePair &limits,
- const ::frc971::control_loops::ShooterQueue::Position &last_position) {
+ const ::y2014::control_loops::ShooterQueue::Position &last_position) {
sensor->posedge_count = last_sensor.posedge_count;
sensor->negedge_count = last_sensor.negedge_count;
@@ -154,7 +154,7 @@
void SendPositionMessage(bool use_passed, bool plunger_in,
bool latch_in, bool brake_in) {
const constants::Values &values = constants::GetValues();
- ::aos::ScopedMessagePtr<::frc971::control_loops::ShooterQueue::Position>
+ ::aos::ScopedMessagePtr<::y2014::control_loops::ShooterQueue::Position>
position = shooter_queue_.position.MakeMessage();
if (use_passed) {
@@ -283,11 +283,11 @@
int brake_delay_count_;
private:
- ::frc971::control_loops::ShooterQueue shooter_queue_;
+ ::y2014::control_loops::ShooterQueue shooter_queue_;
double initial_position_;
double last_voltage_;
- ::frc971::control_loops::ShooterQueue::Position last_position_message_;
+ ::y2014::control_loops::ShooterQueue::Position last_position_message_;
double last_plant_position_;
};
@@ -297,7 +297,7 @@
// Create a new instance of the test queue so that it invalidates the queue
// that it points to. Otherwise, we will have a pointer to shared memory that
// is no longer valid.
- ::frc971::control_loops::ShooterQueue shooter_queue_;
+ ::y2014::control_loops::ShooterQueue shooter_queue_;
// Create a loop and simulation plant.
ShooterMotor shooter_motor_;