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/claw/claw.cc b/y2014/control_loops/claw/claw.cc
index 040cef3..4f71410 100644
--- a/y2014/control_loops/claw/claw.cc
+++ b/y2014/control_loops/claw/claw.cc
@@ -50,7 +50,7 @@
using ::frc971::HallEffectTracker;
using ::y2014::control_loops::claw::kDt;
using ::frc971::control_loops::DoCoerceGoal;
-using ::frc971::control_loops::ClawPositionToLog;
+using ::y2014::control_loops::ClawPositionToLog;
static const double kZeroingVoltage = 4.0;
static const double kMaxVoltage = 12.0;
@@ -220,7 +220,7 @@
last_encoder_(0.0) {}
void ZeroedStateFeedbackLoop::SetPositionValues(
- const ::frc971::control_loops::HalfClawPosition &claw) {
+ const ::y2014::control_loops::HalfClawPosition &claw) {
front_.Update(claw.front);
calibration_.Update(claw.calibration);
back_.Update(claw.back);
@@ -295,7 +295,7 @@
}
void ZeroedStateFeedbackLoop::Reset(
- const ::frc971::control_loops::HalfClawPosition &claw) {
+ const ::y2014::control_loops::HalfClawPosition &claw) {
set_zeroing_state(ZeroedStateFeedbackLoop::UNKNOWN_POSITION);
front_.Reset(claw.front);
@@ -371,8 +371,8 @@
return false;
}
-ClawMotor::ClawMotor(::frc971::control_loops::ClawQueue *my_claw)
- : aos::controls::ControlLoop<::frc971::control_loops::ClawQueue>(my_claw),
+ClawMotor::ClawMotor(::y2014::control_loops::ClawQueue *my_claw)
+ : aos::controls::ControlLoop<::y2014::control_loops::ClawQueue>(my_claw),
has_top_claw_goal_(false),
top_claw_goal_(0.0),
top_claw_(this),
@@ -617,10 +617,10 @@
// Positive angle is up, and positive power is up.
void ClawMotor::RunIteration(
- const ::frc971::control_loops::ClawQueue::Goal *goal,
- const ::frc971::control_loops::ClawQueue::Position *position,
- ::frc971::control_loops::ClawQueue::Output *output,
- ::frc971::control_loops::ClawQueue::Status *status) {
+ const ::y2014::control_loops::ClawQueue::Goal *goal,
+ const ::y2014::control_loops::ClawQueue::Position *position,
+ ::y2014::control_loops::ClawQueue::Output *output,
+ ::y2014::control_loops::ClawQueue::Status *status) {
// Disable the motors now so that all early returns will return with the
// motors disabled.
if (output) {
diff --git a/y2014/control_loops/claw/claw.h b/y2014/control_loops/claw/claw.h
index 86875bb..88f038f 100644
--- a/y2014/control_loops/claw/claw.h
+++ b/y2014/control_loops/claw/claw.h
@@ -77,9 +77,9 @@
}
JointZeroingState zeroing_state() const { return zeroing_state_; }
- void SetPositionValues(const ::frc971::control_loops::HalfClawPosition &claw);
+ void SetPositionValues(const ::y2014::control_loops::HalfClawPosition &claw);
- void Reset(const ::frc971::control_loops::HalfClawPosition &claw);
+ void Reset(const ::y2014::control_loops::HalfClawPosition &claw);
double absolute_position() const { return encoder() + offset(); }
@@ -183,10 +183,10 @@
};
class ClawMotor
- : public aos::controls::ControlLoop<::frc971::control_loops::ClawQueue> {
+ : public aos::controls::ControlLoop<::y2014::control_loops::ClawQueue> {
public:
- explicit ClawMotor(::frc971::control_loops::ClawQueue *my_claw =
- &::frc971::control_loops::claw_queue);
+ explicit ClawMotor(::y2014::control_loops::ClawQueue *my_claw =
+ &::y2014::control_loops::claw_queue);
// True if the state machine is ready.
bool capped_goal() const { return capped_goal_; }
@@ -217,10 +217,10 @@
protected:
virtual void RunIteration(
- const ::frc971::control_loops::ClawQueue::Goal *goal,
- const ::frc971::control_loops::ClawQueue::Position *position,
- ::frc971::control_loops::ClawQueue::Output *output,
- ::frc971::control_loops::ClawQueue::Status *status);
+ const ::y2014::control_loops::ClawQueue::Goal *goal,
+ const ::y2014::control_loops::ClawQueue::Position *position,
+ ::y2014::control_loops::ClawQueue::Output *output,
+ ::y2014::control_loops::ClawQueue::Status *status);
double top_absolute_position() const {
return claw_.X_hat(1, 0) + claw_.X_hat(0, 0);
diff --git a/y2014/control_loops/claw/claw.q b/y2014/control_loops/claw/claw.q
index a116970..1afdd85 100644
--- a/y2014/control_loops/claw/claw.q
+++ b/y2014/control_loops/claw/claw.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";
@@ -8,11 +8,11 @@
double position;
// The hall effect sensor at the front limit.
- HallEffectStruct front;
+ .frc971.HallEffectStruct front;
// The hall effect sensor in the middle to use for real calibration.
- HallEffectStruct calibration;
+ .frc971.HallEffectStruct calibration;
// The hall effect at the back limit.
- HallEffectStruct back;
+ .frc971.HallEffectStruct back;
};
// All angles here are 0 vertical, positive "up" (aka backwards).
diff --git a/y2014/control_loops/claw/claw_calibration.cc b/y2014/control_loops/claw/claw_calibration.cc
index 01d57a4..0dc3c06 100644
--- a/y2014/control_loops/claw/claw_calibration.cc
+++ b/y2014/control_loops/claw/claw_calibration.cc
@@ -24,7 +24,7 @@
}
bool DoGetPositionOfEdge(
- const ::frc971::control_loops::HalfClawPosition &claw_position,
+ const ::y2014::control_loops::HalfClawPosition &claw_position,
const HallEffectStruct &hall_effect, Claws::AnglePair *limits) {
bool print = false;
@@ -112,14 +112,14 @@
public:
ClawSensors(
const double start_position,
- const ::frc971::control_loops::HalfClawPosition &initial_claw_position)
+ const ::y2014::control_loops::HalfClawPosition &initial_claw_position)
: start_position_(start_position),
front_(start_position, initial_claw_position.front),
calibration_(start_position, initial_claw_position.calibration),
back_(start_position, initial_claw_position.back) {}
bool GetPositionOfEdge(
- const ::frc971::control_loops::HalfClawPosition &claw_position,
+ const ::y2014::control_loops::HalfClawPosition &claw_position,
Claws::Claw *claw) {
bool print = false;
if (front_.DoGetPositionOfEdge(claw_position,
@@ -155,17 +155,17 @@
};
int Main() {
- ::frc971::control_loops::claw_queue.position.FetchNextBlocking();
+ ::y2014::control_loops::claw_queue.position.FetchNextBlocking();
const double top_start_position =
- ::frc971::control_loops::claw_queue.position->top.position;
+ ::y2014::control_loops::claw_queue.position->top.position;
const double bottom_start_position =
- ::frc971::control_loops::claw_queue.position->bottom.position;
+ ::y2014::control_loops::claw_queue.position->bottom.position;
ClawSensors top(top_start_position,
- ::frc971::control_loops::claw_queue.position->top);
+ ::y2014::control_loops::claw_queue.position->top);
ClawSensors bottom(bottom_start_position,
- ::frc971::control_loops::claw_queue.position->bottom);
+ ::y2014::control_loops::claw_queue.position->bottom);
Claws limits;
@@ -219,28 +219,28 @@
limits.start_fine_tune_pos = -0.2;
limits.max_zeroing_voltage = 4.0;
- ::frc971::control_loops::ClawQueue::Position last_position =
- *::frc971::control_loops::claw_queue.position;
+ ::y2014::control_loops::ClawQueue::Position last_position =
+ *::y2014::control_loops::claw_queue.position;
while (true) {
- ::frc971::control_loops::claw_queue.position.FetchNextBlocking();
+ ::y2014::control_loops::claw_queue.position.FetchNextBlocking();
bool print = false;
- if (top.GetPositionOfEdge(::frc971::control_loops::claw_queue.position->top,
+ if (top.GetPositionOfEdge(::y2014::control_loops::claw_queue.position->top,
&limits.upper_claw)) {
print = true;
printf("Got an edge on the upper claw\n");
}
if (bottom.GetPositionOfEdge(
- ::frc971::control_loops::claw_queue.position->bottom,
+ ::y2014::control_loops::claw_queue.position->bottom,
&limits.lower_claw)) {
print = true;
printf("Got an edge on the lower claw\n");
}
const double top_position =
- ::frc971::control_loops::claw_queue.position->top.position -
+ ::y2014::control_loops::claw_queue.position->top.position -
top_start_position;
const double bottom_position =
- ::frc971::control_loops::claw_queue.position->bottom.position -
+ ::y2014::control_loops::claw_queue.position->bottom.position -
bottom_start_position;
const double separation = top_position - bottom_position;
if (separation > limits.claw_max_separation) {
@@ -302,7 +302,7 @@
printf("}\n");
}
- last_position = *::frc971::control_loops::claw_queue.position;
+ last_position = *::y2014::control_loops::claw_queue.position;
}
return 0;
}
diff --git a/y2014/control_loops/claw/claw_lib_test.cc b/y2014/control_loops/claw/claw_lib_test.cc
index 85cb679..afce10e 100644
--- a/y2014/control_loops/claw/claw_lib_test.cc
+++ b/y2014/control_loops/claw/claw_lib_test.cc
@@ -19,7 +19,7 @@
using ::y2014::control_loops::claw::MakeClawPlant;
using ::frc971::HallEffectStruct;
-using ::frc971::control_loops::HalfClawPosition;
+using ::y2014::control_loops::HalfClawPosition;
typedef enum {
TOP_CLAW = 0,
@@ -111,7 +111,7 @@
// Sets the values of the physical sensors that can be directly observed
// (encoder, hall effect).
void SetPhysicalSensors(
- ::frc971::control_loops::ClawQueue::Position *position) {
+ ::y2014::control_loops::ClawQueue::Position *position) {
position->top.position = GetPosition(TOP_CLAW);
position->bottom.position = GetPosition(BOTTOM_CLAW);
@@ -186,7 +186,7 @@
// Sends out the position queue messages.
void SendPositionMessage() {
- ::aos::ScopedMessagePtr<::frc971::control_loops::ClawQueue::Position>
+ ::aos::ScopedMessagePtr<::y2014::control_loops::ClawQueue::Position>
position = claw_queue.position.MakeMessage();
// Initialize all the counters to their previous values.
@@ -239,10 +239,10 @@
initial_position_[type] = initial_position;
}
- ::frc971::control_loops::ClawQueue claw_queue;
+ ::y2014::control_loops::ClawQueue claw_queue;
double initial_position_[CLAW_COUNT];
- ::frc971::control_loops::ClawQueue::Position last_position_;
+ ::y2014::control_loops::ClawQueue::Position last_position_;
};
@@ -251,7 +251,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::ClawQueue claw_queue;
+ ::y2014::control_loops::ClawQueue claw_queue;
// Create a loop and simulation plant.
ClawMotor claw_motor_;
diff --git a/y2014/control_loops/claw/replay_claw.cc b/y2014/control_loops/claw/replay_claw.cc
index 70d881c..15cc9d9 100644
--- a/y2014/control_loops/claw/replay_claw.cc
+++ b/y2014/control_loops/claw/replay_claw.cc
@@ -14,8 +14,8 @@
::aos::InitNRT();
- ::aos::controls::ControlLoopReplayer<::frc971::control_loops::ClawQueue>
- replayer(&::frc971::control_loops::claw_queue, "claw");
+ ::aos::controls::ControlLoopReplayer<::y2014::control_loops::ClawQueue>
+ replayer(&::y2014::control_loops::claw_queue, "claw");
for (int i = 1; i < argc; ++i) {
replayer.ProcessFile(argv[i]);
}
diff --git a/y2014/control_loops/drivetrain/drivetrain.cc b/y2014/control_loops/drivetrain/drivetrain.cc
index 23b03f3..98974a5 100644
--- a/y2014/control_loops/drivetrain/drivetrain.cc
+++ b/y2014/control_loops/drivetrain/drivetrain.cc
@@ -30,18 +30,18 @@
namespace drivetrain {
DrivetrainLoop::DrivetrainLoop(
- ::frc971::control_loops::DrivetrainQueue *my_drivetrain)
- : aos::controls::ControlLoop<::frc971::control_loops::DrivetrainQueue>(
+ ::y2014::control_loops::DrivetrainQueue *my_drivetrain)
+ : aos::controls::ControlLoop<::y2014::control_loops::DrivetrainQueue>(
my_drivetrain),
kf_(::y2014::control_loops::drivetrain::MakeKFDrivetrainLoop()) {
::aos::controls::HPolytope<0>::Init();
}
void DrivetrainLoop::RunIteration(
- const ::frc971::control_loops::DrivetrainQueue::Goal *goal,
- const ::frc971::control_loops::DrivetrainQueue::Position *position,
- ::frc971::control_loops::DrivetrainQueue::Output *output,
- ::frc971::control_loops::DrivetrainQueue::Status *status) {
+ const ::y2014::control_loops::DrivetrainQueue::Goal *goal,
+ const ::y2014::control_loops::DrivetrainQueue::Position *position,
+ ::y2014::control_loops::DrivetrainQueue::Output *output,
+ ::y2014::control_loops::DrivetrainQueue::Status *status) {
bool bad_pos = false;
if (position == nullptr) {
LOG_INTERVAL(no_position_);
diff --git a/y2014/control_loops/drivetrain/drivetrain.h b/y2014/control_loops/drivetrain/drivetrain.h
index 5b8da12..7ecc09f 100644
--- a/y2014/control_loops/drivetrain/drivetrain.h
+++ b/y2014/control_loops/drivetrain/drivetrain.h
@@ -15,22 +15,22 @@
namespace control_loops {
namespace drivetrain {
-class DrivetrainLoop
- : public aos::controls::ControlLoop<::frc971::control_loops::DrivetrainQueue> {
+class DrivetrainLoop : public aos::controls::ControlLoop<
+ ::y2014::control_loops::DrivetrainQueue> {
public:
// Constructs a control loop which can take a Drivetrain or defaults to the
- // drivetrain at frc971::control_loops::drivetrain
+ // drivetrain at y2014::control_loops::drivetrain
explicit DrivetrainLoop(
- ::frc971::control_loops::DrivetrainQueue *my_drivetrain =
- &::frc971::control_loops::drivetrain_queue);
+ ::y2014::control_loops::DrivetrainQueue *my_drivetrain =
+ &::y2014::control_loops::drivetrain_queue);
protected:
// Executes one cycle of the control loop.
virtual void RunIteration(
- const ::frc971::control_loops::DrivetrainQueue::Goal *goal,
- const ::frc971::control_loops::DrivetrainQueue::Position *position,
- ::frc971::control_loops::DrivetrainQueue::Output *output,
- ::frc971::control_loops::DrivetrainQueue::Status *status);
+ const ::y2014::control_loops::DrivetrainQueue::Goal *goal,
+ const ::y2014::control_loops::DrivetrainQueue::Position *position,
+ ::y2014::control_loops::DrivetrainQueue::Output *output,
+ ::y2014::control_loops::DrivetrainQueue::Status *status);
typedef ::aos::util::SimpleLogInterval SimpleLogInterval;
SimpleLogInterval no_position_ = SimpleLogInterval(
diff --git a/y2014/control_loops/drivetrain/drivetrain.q b/y2014/control_loops/drivetrain/drivetrain.q
index 585b8ed..86b8b04 100644
--- a/y2014/control_loops/drivetrain/drivetrain.q
+++ b/y2014/control_loops/drivetrain/drivetrain.q
@@ -1,4 +1,4 @@
-package frc971.control_loops;
+package y2014.control_loops;
import "aos/common/controls/control_loops.q";
diff --git a/y2014/control_loops/drivetrain/drivetrain_lib_test.cc b/y2014/control_loops/drivetrain/drivetrain_lib_test.cc
index f455b57..9fdfbd8 100644
--- a/y2014/control_loops/drivetrain/drivetrain_lib_test.cc
+++ b/y2014/control_loops/drivetrain/drivetrain_lib_test.cc
@@ -79,7 +79,7 @@
const double left_encoder = GetLeftPosition();
const double right_encoder = GetRightPosition();
- ::aos::ScopedMessagePtr<::frc971::control_loops::DrivetrainQueue::Position>
+ ::aos::ScopedMessagePtr<::y2014::control_loops::DrivetrainQueue::Position>
position = my_drivetrain_queue_.position.MakeMessage();
position->left_encoder = left_encoder;
position->right_encoder = right_encoder;
@@ -98,7 +98,7 @@
::std::unique_ptr<StateFeedbackPlant<4, 2, 2>> drivetrain_plant_;
private:
- ::frc971::control_loops::DrivetrainQueue my_drivetrain_queue_;
+ ::y2014::control_loops::DrivetrainQueue my_drivetrain_queue_;
double last_left_position_;
double last_right_position_;
};
@@ -108,7 +108,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::DrivetrainQueue my_drivetrain_queue_;
+ ::y2014::control_loops::DrivetrainQueue my_drivetrain_queue_;
// Create a loop and simulation plant.
DrivetrainLoop drivetrain_motor_;
diff --git a/y2014/control_loops/drivetrain/polydrivetrain.cc b/y2014/control_loops/drivetrain/polydrivetrain.cc
index 795ad04..a49fa22 100644
--- a/y2014/control_loops/drivetrain/polydrivetrain.cc
+++ b/y2014/control_loops/drivetrain/polydrivetrain.cc
@@ -19,8 +19,8 @@
namespace control_loops {
namespace drivetrain {
-using ::frc971::control_loops::GearLogging;
-using ::frc971::control_loops::CIMLogging;
+using ::y2014::control_loops::GearLogging;
+using ::y2014::control_loops::CIMLogging;
using ::frc971::control_loops::CoerceGoal;
PolyDrivetrain::PolyDrivetrain()
@@ -158,7 +158,7 @@
}
}
void PolyDrivetrain::SetPosition(
- const ::frc971::control_loops::DrivetrainQueue::Position *position) {
+ const ::y2014::control_loops::DrivetrainQueue::Position *position) {
const auto &values = constants::GetValues();
if (position == NULL) {
++stale_count_;
@@ -402,7 +402,7 @@
}
void PolyDrivetrain::SendMotors(
- ::frc971::control_loops::DrivetrainQueue::Output *output) {
+ ::y2014::control_loops::DrivetrainQueue::Output *output) {
if (output != NULL) {
output->left_voltage = loop_->U(0, 0);
output->right_voltage = loop_->U(1, 0);
diff --git a/y2014/control_loops/drivetrain/polydrivetrain.h b/y2014/control_loops/drivetrain/polydrivetrain.h
index 999509e..864eec8 100644
--- a/y2014/control_loops/drivetrain/polydrivetrain.h
+++ b/y2014/control_loops/drivetrain/polydrivetrain.h
@@ -47,7 +47,7 @@
void SetGoal(double wheel, double throttle, bool quickturn, bool highgear);
void SetPosition(
- const ::frc971::control_loops::DrivetrainQueue::Position *position);
+ const ::y2014::control_loops::DrivetrainQueue::Position *position);
double FilterVelocity(double throttle);
@@ -55,7 +55,7 @@
void Update();
- void SendMotors(::frc971::control_loops::DrivetrainQueue::Output *output);
+ void SendMotors(::y2014::control_loops::DrivetrainQueue::Output *output);
private:
const ::aos::controls::HPolytope<2> U_Poly_;
@@ -70,8 +70,8 @@
double position_time_delta_;
Gear left_gear_;
Gear right_gear_;
- ::frc971::control_loops::DrivetrainQueue::Position last_position_;
- ::frc971::control_loops::DrivetrainQueue::Position position_;
+ ::y2014::control_loops::DrivetrainQueue::Position last_position_;
+ ::y2014::control_loops::DrivetrainQueue::Position position_;
int counter_;
};
diff --git a/y2014/control_loops/drivetrain/replay_drivetrain.cc b/y2014/control_loops/drivetrain/replay_drivetrain.cc
index 091d992..346ca69 100644
--- a/y2014/control_loops/drivetrain/replay_drivetrain.cc
+++ b/y2014/control_loops/drivetrain/replay_drivetrain.cc
@@ -15,8 +15,8 @@
::aos::InitNRT();
- ::aos::controls::ControlLoopReplayer<::frc971::control_loops::DrivetrainQueue>
- replayer(&::frc971::control_loops::drivetrain_queue, "drivetrain");
+ ::aos::controls::ControlLoopReplayer<::y2014::control_loops::DrivetrainQueue>
+ replayer(&::y2014::control_loops::drivetrain_queue, "drivetrain");
replayer.AddDirectQueueSender("wpilib_interface.Gyro", "sending",
::frc971::sensors::gyro_reading);
diff --git a/y2014/control_loops/drivetrain/ssdrivetrain.cc b/y2014/control_loops/drivetrain/ssdrivetrain.cc
index 3c2a962..9576bcd 100644
--- a/y2014/control_loops/drivetrain/ssdrivetrain.cc
+++ b/y2014/control_loops/drivetrain/ssdrivetrain.cc
@@ -172,7 +172,7 @@
}
void DrivetrainMotorsSS::SendMotors(
- ::frc971::control_loops::DrivetrainQueue::Output *output) const {
+ ::y2014::control_loops::DrivetrainQueue::Output *output) const {
if (output) {
output->left_voltage = loop_->U(0, 0);
output->right_voltage = loop_->U(1, 0);
diff --git a/y2014/control_loops/drivetrain/ssdrivetrain.h b/y2014/control_loops/drivetrain/ssdrivetrain.h
index 5945f96..1964ac5 100644
--- a/y2014/control_loops/drivetrain/ssdrivetrain.h
+++ b/y2014/control_loops/drivetrain/ssdrivetrain.h
@@ -63,7 +63,7 @@
}
void SendMotors(
- ::frc971::control_loops::DrivetrainQueue::Output *output) const;
+ ::y2014::control_loops::DrivetrainQueue::Output *output) const;
const LimitedDrivetrainLoop &loop() const { return *loop_; }
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_;