Deflector Changes
This commit is contained in:
parent
a4253cfd35
commit
5e46a6c376
|
|
@ -95,9 +95,10 @@ public final class Constants {
|
|||
public static final Angle LIMIT_ELEVATION_POS = edu.wpi.first.units.Units.Degrees.of(90);
|
||||
public static final Angle LIMIT_ELEVATION_NEG = edu.wpi.first.units.Units.Degrees.of(0);
|
||||
public static final Angle DEFLECTOR_STORED_ANGLE = edu.wpi.first.units.Units.Degrees.of(0);
|
||||
public static final Angle DEFLECTOR_SET_ANGLE1 = edu.wpi.first.units.Units.Degrees.of(20);
|
||||
public static final Angle DEFLECTOR_SET_ANGLE2 = edu.wpi.first.units.Units.Degrees.of(40);
|
||||
public static final Angle DEFLECTOR_SET_ANGLE3 = edu.wpi.first.units.Units.Degrees.of(60);
|
||||
public static final Angle DEFLECTOR_SET_ANGLE1 = edu.wpi.first.units.Units.Degrees.of(100);
|
||||
public static final Angle DEFLECTOR_SET_ANGLE2 = edu.wpi.first.units.Units.Degrees.of(200);
|
||||
public static final Angle DEFLECTOR_SET_ANGLE3 = edu.wpi.first.units.Units.Degrees.of(300);
|
||||
public static final double DEFLECTOR_SERVO_RATIO = 1.0;
|
||||
}
|
||||
|
||||
public static class HopperConstants {
|
||||
|
|
|
|||
|
|
@ -23,16 +23,13 @@ public class ManualHopperCommand extends Command {
|
|||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {
|
||||
if(m_xboxController.getRightBumper())
|
||||
{
|
||||
m_subsystem.spin(Constants.HopperConstants.SPINDEXER_MOTOR_SPEED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(m_xboxController.getLeftTriggerAxis()>.5 && m_xboxController.getRightTriggerAxis()>.5)
|
||||
if(m_xboxController.getLeftTriggerAxis()>.5 && m_xboxController.getRightTriggerAxis()>.2)
|
||||
{
|
||||
m_subsystem.feed();
|
||||
}
|
||||
|
|
@ -40,6 +37,14 @@ public class ManualHopperCommand extends Command {
|
|||
{
|
||||
m_subsystem.stop();
|
||||
}
|
||||
if(m_xboxController.getRightBumper())
|
||||
{
|
||||
m_subsystem.spin(Constants.HopperConstants.SPINDEXER_MOTOR_SPEED);
|
||||
}
|
||||
if(m_xboxController.getLeftBumper())
|
||||
{
|
||||
m_subsystem.spin(0);
|
||||
}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
|
|
|
|||
|
|
@ -24,21 +24,21 @@ public class ManualShootCommand extends Command {
|
|||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if(m_controller.getRightTriggerAxis()>.4)
|
||||
{
|
||||
m_subsystem.setLauncher(.6);
|
||||
m_controller.setRumble(RumbleType.kBothRumble, .33);
|
||||
}
|
||||
else if(m_controller.getRightTriggerAxis()>.6)
|
||||
{
|
||||
m_subsystem.setLauncher(.8);
|
||||
m_controller.setRumble(RumbleType.kBothRumble, .67);
|
||||
}
|
||||
else if(m_controller.getRightTriggerAxis()>.8)
|
||||
if(m_controller.getRightTriggerAxis()>.8)
|
||||
{
|
||||
m_subsystem.setLauncher(1);
|
||||
m_controller.setRumble(RumbleType.kBothRumble, 1);
|
||||
}
|
||||
else if(m_controller.getRightTriggerAxis()>.5)
|
||||
{
|
||||
m_subsystem.setLauncher(.7);
|
||||
m_controller.setRumble(RumbleType.kBothRumble, .67);
|
||||
}
|
||||
else if(m_controller.getRightTriggerAxis()>.2)
|
||||
{
|
||||
m_subsystem.setLauncher(.5);
|
||||
m_controller.setRumble(RumbleType.kBothRumble, .33);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_subsystem.setLauncher(0);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ public class TurretSubsystem extends TestableSubsystem {
|
|||
if(Constants.ShooterConstants.HOOD_SERVO_INVERTED){
|
||||
elev=Units.Degrees.of(300).minus(elev);
|
||||
}
|
||||
elev=elev.div(1.5);
|
||||
elev=elev.div(Constants.ShooterConstants.DEFLECTOR_SERVO_RATIO);
|
||||
hood.setAngle(elev.in(Units.Degrees));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue