Housekeeping and gyro code optimizations.
- Optimized the gyro code for highest possible precision when
gauging shooter wheel velocity.
- Cleaned up some junk in various places.
NOTE: Stuff does not compile at the moment, I need to merge in
some of James' stuff for that.
diff --git a/bot3/control_loops/shooter/shooter.cc b/bot3/control_loops/shooter/shooter.cc
index fb78a10..f732b3d 100644
--- a/bot3/control_loops/shooter/shooter.cc
+++ b/bot3/control_loops/shooter/shooter.cc
@@ -13,7 +13,6 @@
: aos::control_loops::ControlLoop<control_loops::ShooterLoop>(my_shooter),
loop_(new StateFeedbackLoop<1, 1, 1>(MakeShooterLoop())),
last_velocity_goal_(0) {
- loop_->Reset();
}
/*static*/ const double ShooterMotor::dt = 0.01;
@@ -26,10 +25,9 @@
double velocity_goal = goal->velocity;
// Our position here is actually a velocity.
average_velocity_ =
- (position == NULL ? loop_->X_hat(0, 0) : position->position);
+ (position == NULL ? loop_->X_hat(0, 0) : position->velocity);
double output_voltage = 0.0;
-// TODO (danielp): This must be modified for our index.
/* if (index_loop.status.FetchLatest() || index_loop.status.get()) {
if (index_loop.status->is_shooting) {
if (velocity_goal != last_velocity_goal_ &&