Addressed shooter comments from Brian which were missed.
Change-Id: Ib5928b7906825c4bb29321e8892bcc49e8df78f6
diff --git a/y2017/control_loops/superstructure/shooter/BUILD b/y2017/control_loops/superstructure/shooter/BUILD
index e689237..a57a1a3 100644
--- a/y2017/control_loops/superstructure/shooter/BUILD
+++ b/y2017/control_loops/superstructure/shooter/BUILD
@@ -1,7 +1,5 @@
package(default_visibility = ['//visibility:public'])
-load('/aos/build/queues', 'queue_library')
-
genrule(
name = 'genrule_shooter',
cmd = '$(location //y2017/control_loops/python:shooter) $(OUTS)',
@@ -44,6 +42,7 @@
deps = [
':shooter_plants',
'//aos/common/controls:control_loop',
+ '//third_party/eigen',
'//y2017/control_loops/superstructure:superstructure_queue',
],
)
diff --git a/y2017/control_loops/superstructure/shooter/shooter.cc b/y2017/control_loops/superstructure/shooter/shooter.cc
index c73a008..d30a45c 100644
--- a/y2017/control_loops/superstructure/shooter/shooter.cc
+++ b/y2017/control_loops/superstructure/shooter/shooter.cc
@@ -41,7 +41,10 @@
history_[history_position_] = current_position;
history_position_ = (history_position_ + 1) % kHistoryLength;
- dt_velocity_ = (current_position - last_position_) / 0.005;
+ dt_velocity_ = (current_position - last_position_) /
+ chrono::duration_cast<chrono::duration<double>>(
+ ::aos::controls::kLoopFrequency)
+ .count();
last_position_ = current_position;
}
@@ -104,7 +107,7 @@
status->avg_angular_velocity = average_angular_velocity_;
status->angular_velocity = X_hat_current_(1, 0);
- status->ready = std::abs(error_) < kTolerance && loop_->next_R(1, 0) > 1.0;
+ status->ready = ready_;
status->voltage_error = X_hat_current_(2, 0);
status->position_error = position_error_;
diff --git a/y2017/control_loops/superstructure/shooter/shooter.h b/y2017/control_loops/superstructure/shooter/shooter.h
index 7f11267..41e24c0 100644
--- a/y2017/control_loops/superstructure/shooter/shooter.h
+++ b/y2017/control_loops/superstructure/shooter/shooter.h
@@ -1,11 +1,13 @@
#ifndef Y2017_CONTROL_LOOPS_SHOOTER_SHOOTER_H_
#define Y2017_CONTROL_LOOPS_SHOOTER_SHOOTER_H_
+#include <array>
#include <memory>
#include "aos/common/controls/control_loop.h"
#include "aos/common/time.h"
#include "frc971/control_loops/state_feedback_loop.h"
+#include "third_party/eigen/Eigen/Dense"
#include "y2017/control_loops/superstructure/shooter/shooter_integral_plant.h"
#include "y2017/control_loops/superstructure/superstructure.q.h"