Set dummy intake constants
Signed-off-by: Yash Chainani <yashchainani28@gmail.com>
Change-Id: I9729322dbc5bdc161550a34bfaf3a27714784a48
diff --git a/y2022/constants.cc b/y2022/constants.cc
index 98f6511..73e72f3 100644
--- a/y2022/constants.cc
+++ b/y2022/constants.cc
@@ -11,6 +11,7 @@
#include "aos/mutex/mutex.h"
#include "aos/network/team_number.h"
#include "glog/logging.h"
+#include "y2022/control_loops/superstructure/intake/integral_intake_plant.h"
namespace y2022 {
namespace constants {
@@ -26,6 +27,37 @@
const Values *DoGetValuesForTeam(uint16_t team) {
Values *const r = new Values();
+ // TODO(Yash): Set constants
+ // Intake constants.
+ auto *const intake = &r->intake;
+
+ intake->zeroing_voltage = 3.0;
+ intake->operating_voltage = 12.0;
+ intake->zeroing_profile_params = {0.5, 3.0};
+ intake->default_profile_params = {6.0, 30.0};
+ intake->range = Values::kIntakeRange();
+ intake->make_integral_loop =
+ control_loops::superstructure::intake::MakeIntegralIntakeLoop;
+
+ // The number of samples in the moving average filter.
+ intake->zeroing_constants.average_filter_size = Values::kZeroingSampleSize;
+ // The distance that the absolute encoder needs to complete a full rotation.
+ intake->zeroing_constants.one_revolution_distance =
+ M_PI * 2.0 * constants::Values::kIntakeEncoderRatio();
+
+ // Threshold for deciding if we are moving. moving_buffer_size samples need to
+ // be within this distance of each other before we use the middle one to zero.
+ intake->zeroing_constants.zeroing_threshold = 0.0005;
+ // Buffer size for deciding if we are moving.
+ intake->zeroing_constants.moving_buffer_size = 20;
+
+ // Value between 0 and 1 indicating what fraction of one_revolution_distance
+ // it is acceptable for the offset to move.
+ intake->zeroing_constants.allowable_encoder_error = 0.9;
+
+ // Measured absolute position of the encoder when at zero.
+ intake->zeroing_constants.measured_absolute_position = 0.0;
+
switch (team) {
// A set of constants for tests.
case 1: