mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-09 00:38:03 -06:00
Fix with angular
This commit is contained in:
@@ -8,6 +8,8 @@ import org.littletonrobotics.junction.AutoLog;
|
|||||||
|
|
||||||
import edu.wpi.first.units.measure.Acceleration;
|
import edu.wpi.first.units.measure.Acceleration;
|
||||||
import edu.wpi.first.units.measure.Angle;
|
import edu.wpi.first.units.measure.Angle;
|
||||||
|
import edu.wpi.first.units.measure.AngularAcceleration;
|
||||||
|
import edu.wpi.first.units.measure.AngularVelocity;
|
||||||
import edu.wpi.first.units.measure.Current;
|
import edu.wpi.first.units.measure.Current;
|
||||||
import edu.wpi.first.units.measure.Velocity;
|
import edu.wpi.first.units.measure.Velocity;
|
||||||
|
|
||||||
@@ -19,10 +21,8 @@ public interface IntakeIO {
|
|||||||
Angle armTargetAngle = Rotations.of(0);
|
Angle armTargetAngle = Rotations.of(0);
|
||||||
Current armMotorCurrent = Amps.of(0);
|
Current armMotorCurrent = Amps.of(0);
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
AngularVelocity armMotorVelocity;
|
||||||
Velocity armMotorVelocity;
|
AngularAcceleration armMotorAcceleration;
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
Acceleration armMotorAcceleration;
|
|
||||||
|
|
||||||
// Angle shooterPitch = Rotations.of(0);
|
// Angle shooterPitch = Rotations.of(0);
|
||||||
// Angle shooterTargetPitch = Rotations.of(0);
|
// Angle shooterTargetPitch = Rotations.of(0);
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ public class IntakeReal implements IntakeIO {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@Override
|
@Override
|
||||||
public void updateInputs(IntakeState state) {
|
public void updateInputs(IntakeState state) {
|
||||||
state.armAngle = m_armMotor.getPosition().getValue().div(IntakeConstants.ARM_MOTOR_GEAR_RATIO);
|
state.armAngle = m_armMotor.getPosition().getValue().div(IntakeConstants.ARM_MOTOR_GEAR_RATIO);
|
||||||
@@ -137,8 +136,8 @@ public class IntakeReal implements IntakeIO {
|
|||||||
state.rollerMotorCurrent = m_rollerMotor.getStatorCurrent().getValue();
|
state.rollerMotorCurrent = m_rollerMotor.getStatorCurrent().getValue();
|
||||||
state.retractedLimit = !m_armLimitSwitch.get();
|
state.retractedLimit = !m_armLimitSwitch.get();
|
||||||
|
|
||||||
// state.armMotorVelocity = (Velocity) m_armMotor.getVelocity();
|
state.armMotorVelocity = m_armMotor.getVelocity().getValue();
|
||||||
// state.armMotorAcceleration = (Acceleration) m_armMotor.getAcceleration();
|
state.armMotorAcceleration = m_armMotor.getAcceleration().getValue();
|
||||||
|
|
||||||
if(state.retractedLimit) {
|
if(state.retractedLimit) {
|
||||||
// Set the arm motor to be zero if the limit switch is pressed
|
// Set the arm motor to be zero if the limit switch is pressed
|
||||||
|
|||||||
Reference in New Issue
Block a user