mirror of
https://github.com/Team4388/2023WayOfTheRobot.git
synced 2026-06-09 08:38:02 -06:00
cone high done kinda
This commit is contained in:
@@ -158,16 +158,17 @@ public class RobotContainer {
|
||||
);
|
||||
|
||||
private SequentialCommandGroup placeConeHigh = new SequentialCommandGroup(
|
||||
new PivotCommand(m_robotArm, 0),
|
||||
new TeleCommand(m_robotArm, 0),
|
||||
toggleClaw.asProxy(),
|
||||
armToHome.asProxy()
|
||||
new PivotCommand(m_robotArm, 178),
|
||||
new WaitCommand(0.3),
|
||||
new TeleCommand(m_robotArm, 56000)
|
||||
// toggleClaw.asProxy(),
|
||||
// armToHome.asProxy()
|
||||
);
|
||||
|
||||
private SequentialCommandGroup placeConeMid = new SequentialCommandGroup(
|
||||
new PivotCommand(m_robotArm, 189),
|
||||
new PivotCommand(m_robotArm, 188),
|
||||
new WaitCommand(0.3),
|
||||
new TeleCommand(m_robotArm, 34000)
|
||||
new TeleCommand(m_robotArm, 29500)
|
||||
// toggleClaw.asProxy(),
|
||||
// armToHome.asProxy()
|
||||
);
|
||||
@@ -179,7 +180,6 @@ public class RobotContainer {
|
||||
armToHome.asProxy()
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* The container for the robot. Contains subsystems, OI devices, and commands.
|
||||
*/
|
||||
@@ -304,6 +304,8 @@ public class RobotContainer {
|
||||
// toggle claw
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.X_BUTTON) // final
|
||||
.onTrue(toggleClaw.asProxy());
|
||||
// new JoystickButton(getDeadbandedOperatorController(), XboxController.X_BUTTON) // final
|
||||
// .onTrue(new InstantCommand(() -> m_robotClaw.setAngle(45), m_robotClaw));
|
||||
|
||||
// kill soft limits
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON) // final
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
|
||||
import com.ctre.phoenix.sensors.CANCoder;
|
||||
import com.ctre.phoenix.sensors.WPI_Pigeon2;
|
||||
import com.revrobotics.CANSparkMax;
|
||||
import com.revrobotics.CANSparkMax.IdleMode;
|
||||
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj.PWM;
|
||||
@@ -176,4 +177,5 @@ public class RobotMap {
|
||||
Servo leftClaw = new Servo(0);
|
||||
Servo rightClaw = new Servo(1);
|
||||
CANSparkMax spinnyspin = new CANSparkMax(18, MotorType.kBrushless);
|
||||
spinnyspin.setIdleMode(IdleMode.kBrake);
|
||||
}
|
||||
@@ -35,6 +35,11 @@ public class Claw extends SubsystemBase {
|
||||
// setClaw(false);
|
||||
}
|
||||
|
||||
public void setAngle(double angle) {
|
||||
m_leftMotor.setAngle(angle);
|
||||
m_leftMotor.setAngle(180 - angle);
|
||||
}
|
||||
|
||||
public void setClaw(boolean open) {
|
||||
// Open claw
|
||||
m_open = open;
|
||||
@@ -43,8 +48,10 @@ public class Claw extends SubsystemBase {
|
||||
|
||||
// m_leftMotor.setBounds(4000, 20000, 2000, 0, 0);
|
||||
|
||||
m_leftMotor.setAngle(m_open ? 0 : 180);
|
||||
m_rightMotor.setAngle(m_open ? 180 : 0);
|
||||
// m_leftMotor.setAngle(m_open ? 0 : 180);
|
||||
// m_rightMotor.setAngle(m_open ? 180 : 0);
|
||||
m_leftMotor.setAngle(m_open ? 90 : 180);
|
||||
m_rightMotor.setAngle(m_open ? 90 : 0);
|
||||
|
||||
// m_leftMotor.setRaw(m_open ? 0 : 4000);
|
||||
// m_rightMotor.setRaw(m_open ? 4000 : 0);
|
||||
|
||||
Reference in New Issue
Block a user