@@ -32,20 +32,6 @@ void TurretSubsystem::initialize()
3232
3333void TurretSubsystem::refresh ()
3434{
35- // yaw.setOutput(0.5f);
36- // pitch.motor.setDesiredOutput(M3508.maxOutput * 0.5);
37- // who needs hardware checks?
38- // setAmputated(!hardwareOk());
39-
40- #if defined(TARGET_HERO)
41- Remote* remote = &drivers->remote ;
42- float h = remote->getChannel (Remote::Channel::LEFT_HORIZONTAL);
43- float v = remote->getChannel (Remote::Channel::LEFT_VERTICAL);
44- yaw.setOutput (h);
45- pitch.motor .setDesiredOutput (GM6020.maxOutput * v);
46- return ;
47- #endif
48-
4935 yaw.updateMotorAngle ();
5036 pitch.updateMotorAngle ();
5137
@@ -54,7 +40,11 @@ void TurretSubsystem::refresh()
5440
5541 if (!isCalibrated && yawEncoder.isOnline ())
5642 {
43+ #if defined(TARGET_HERO)
44+ baseYaw = -yaw.getAngle ();
45+ #else
5746 baseYaw = yawEncoder.getAngle () - YAW_OFFSET - yaw.getAngle ();
47+ #endif
5848 isCalibrated = true ;
5949
6050 setTargetWorldAngles (getCurrentLocalYaw () + getChassisYaw (), getCurrentLocalPitch ());
@@ -94,7 +84,7 @@ void TurretSubsystem::setTargetWorldAngles(float yaw, float pitch)
9484 targetWorldPitch = modm::min (modm::max (pitch, PITCH_MIN), PITCH_MAX);
9585}
9686
97- float TurretSubsystem::getChassisYaw () { return modm::toRadian ( drivers->bmi088 .getYaw () ); }
87+ float TurretSubsystem::getChassisYaw () { return drivers->bmi088 .getYaw (); }
9888
9989float TurretSubsystem::getTargetLocalYaw () { return targetWorldYaw - getChassisYaw (); }
10090
0 commit comments