Merge "Autogen rule written for 'claw' module."
diff --git a/aos/common/controls/control_loop_test.cc b/aos/common/controls/control_loop_test.cc
index ecaafab..44af93a 100644
--- a/aos/common/controls/control_loop_test.cc
+++ b/aos/common/controls/control_loop_test.cc
@@ -51,8 +51,8 @@
new_state->voltage_3v3 = 3.3;
new_state->voltage_5v = 5.0;
- new_state->voltage_roborio_in = 12.4;
- new_state->voltage_battery = 12.4;
+ new_state->voltage_roborio_in = battery_voltage_;
+ new_state->voltage_battery = battery_voltage_;
new_state.Send();
}
diff --git a/aos/common/controls/control_loop_test.h b/aos/common/controls/control_loop_test.h
index 4ab4774..14fdd60 100644
--- a/aos/common/controls/control_loop_test.h
+++ b/aos/common/controls/control_loop_test.h
@@ -41,6 +41,11 @@
++reader_pid_;
}
+ // Sets the battery voltage in robot_state.
+ void set_battery_voltage(double battery_voltage) {
+ battery_voltage_ = battery_voltage;
+ }
+
private:
static constexpr ::aos::time::Time kTimeTick = ::aos::time::Time::InUS(5000);
static constexpr ::aos::time::Time kDSPacketTime =
@@ -48,6 +53,7 @@
uint16_t team_id_ = 971;
int32_t reader_pid_ = 1;
+ double battery_voltage_ = 12.4;
::aos::time::Time last_ds_time_ = ::aos::time::Time::InSeconds(0);
::aos::time::Time current_time_ = ::aos::time::Time::InSeconds(0);
diff --git a/y2016/constants.h b/y2016/constants.h
index 98d38c7..d9ae7c4 100644
--- a/y2016/constants.h
+++ b/y2016/constants.h
@@ -35,7 +35,7 @@
static constexpr double kIntakeEncoderRatio =
16.0 / 48.0 * 18.0 / 72.0 * 14.0 / 64.0;
static constexpr double kShoulderEncoderRatio =
- 16.0 / 58.0 * 18.0 / 72.0 * 14.0 / 64.0;
+ 12.0 / 42.0 * 18.0 / 72.0 * 14.0 / 64.0;
static constexpr double kWristEncoderRatio =
16.0 / 48.0 * 18.0 / 64.0 * 14.0 / 54.0;
diff --git a/y2016/control_loops/python/intake.py b/y2016/control_loops/python/intake.py
index 1fcf393..63cc0f4 100755
--- a/y2016/control_loops/python/intake.py
+++ b/y2016/control_loops/python/intake.py
@@ -40,10 +40,9 @@
# Gear ratio
self.G = (56.0 / 12.0) * (54.0 / 14.0) * (64.0 / 18.0) * (48.0 / 16.0)
- # Measured in CAD
- # self.J = 0.9
- # With extra mass to compensate for friction.
- self.J = 1.2
+ # Moment of inertia, measured in CAD.
+ # Extra mass to compensate for friction is added on.
+ self.J = 0.34 + 0.1
# Control loop time step
self.dt = 0.005
diff --git a/y2016/control_loops/python/shoulder.py b/y2016/control_loops/python/shoulder.py
index 9b70dbd..07a67f6 100755
--- a/y2016/control_loops/python/shoulder.py
+++ b/y2016/control_loops/python/shoulder.py
@@ -37,7 +37,7 @@
# Torque constant
self.Kt = self.stall_torque / self.stall_current
# Gear ratio
- self.G = (56.0 / 12.0) * (64.0 / 14.0) * (72.0 / 18.0) * (58.0 / 16.0)
+ self.G = (56.0 / 12.0) * (64.0 / 14.0) * (72.0 / 18.0) * (42.0 / 12.0)
self.J = 3.0