mirror of
https://github.com/Team4388/2025-Programer-Training.git
synced 2026-06-09 00:38:03 -06:00
Intake Code (not tested/no values)
This commit is contained in:
@@ -12,6 +12,7 @@ import edu.wpi.first.wpilibj.DriverStation;
|
|||||||
import edu.wpi.first.cameraserver.CameraServer;
|
import edu.wpi.first.cameraserver.CameraServer;
|
||||||
import edu.wpi.first.wpilibj.GenericHID;
|
import edu.wpi.first.wpilibj.GenericHID;
|
||||||
import frc4388.utility.controller.XboxController;
|
import frc4388.utility.controller.XboxController;
|
||||||
|
import frc4388.utility.controller.DeadbandedWhateverController;
|
||||||
import frc4388.utility.controller.DeadbandedXboxController;
|
import frc4388.utility.controller.DeadbandedXboxController;
|
||||||
import frc4388.robot.Constants.OIConstants;
|
import frc4388.robot.Constants.OIConstants;
|
||||||
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
||||||
@@ -59,7 +60,7 @@ public class RobotContainer {
|
|||||||
public final Shooter m_robotShooter = new Shooter(m_robotMap.leftShooter, m_robotMap.rightShooter);
|
public final Shooter m_robotShooter = new Shooter(m_robotMap.leftShooter, m_robotMap.rightShooter);
|
||||||
|
|
||||||
/* Controllers */
|
/* Controllers */
|
||||||
private final DeadbandedXboxController m_driverXbox = new DeadbandedXboxController(OIConstants.XBOX_DRIVER_ID);
|
private final DeadbandedXboxController m_driverXbox = new DeadbandedWhateverController(OIConstants.XBOX_DRIVER_ID);
|
||||||
private final DeadbandedXboxController m_operatorXbox = new DeadbandedXboxController(OIConstants.XBOX_OPERATOR_ID);
|
private final DeadbandedXboxController m_operatorXbox = new DeadbandedXboxController(OIConstants.XBOX_OPERATOR_ID);
|
||||||
private final DeadbandedXboxController m_autoRecorderXbox = new DeadbandedXboxController(OIConstants.XBOX_PROGRAMMER_ID);
|
private final DeadbandedXboxController m_autoRecorderXbox = new DeadbandedXboxController(OIConstants.XBOX_PROGRAMMER_ID);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (c) FIRST and other WPILib contributors.
|
||||||
|
// Open Source Software; you can modify and/or share it under the terms of
|
||||||
|
// the WPILib BSD license file in the root directory of this project.
|
||||||
|
|
||||||
|
package frc4388.robot.subsystems;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
|
||||||
|
public class Intake extends SubsystemBase {
|
||||||
|
/** Creates a new Intake. */
|
||||||
|
public Intake() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void periodic() {
|
||||||
|
// This method will be called once per scheduler run
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (c) FIRST and other WPILib contributors.
|
||||||
|
// Open Source Software; you can modify and/or share it under the terms of
|
||||||
|
// the WPILib BSD license file in the root directory of this project.
|
||||||
|
|
||||||
|
package frc4388.robot.subsystems;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
|
||||||
|
public class Microbot extends SubsystemBase {
|
||||||
|
/** Creates a new Microbot. */
|
||||||
|
public Microbot() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void periodic() {
|
||||||
|
// This method will be called once per scheduler run
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,8 +24,8 @@ public class Shooter extends SubsystemBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spin(double speed) {
|
public void spin(double speed) {
|
||||||
leftShooter.set(speed);
|
leftShooter.set(-speed);
|
||||||
rightShooter.set(speed);
|
rightShooter.set(-speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void spin() {
|
public void spin() {
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) FIRST and other WPILib contributors.
|
||||||
|
// Open Source Software; you can modify and/or share it under the terms of
|
||||||
|
// the WPILib BSD license file in the root directory of this project.
|
||||||
|
|
||||||
|
package frc4388.utility.controller;
|
||||||
|
|
||||||
|
import static frc4388.robot.Constants.OIConstants.LEFT_AXIS_DEADBAND;
|
||||||
|
|
||||||
|
import edu.wpi.first.math.geometry.Translation2d;
|
||||||
|
import edu.wpi.first.wpilibj.XboxController;
|
||||||
|
|
||||||
|
/** Add your docs here. */
|
||||||
|
public class DeadbandedWhateverController extends DeadbandedXboxController {
|
||||||
|
public DeadbandedWhateverController(int port) {
|
||||||
|
super(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public Translation2d getRight() { return skewToDeadzonedCircle(-getRawAxis(2), getRawAxis(3)); }
|
||||||
|
}
|
||||||
@@ -15,6 +15,8 @@ public class XboxController implements IHandController
|
|||||||
public static final int RIGHT_TRIGGER_AXIS = 3;
|
public static final int RIGHT_TRIGGER_AXIS = 3;
|
||||||
public static final int RIGHT_X_AXIS = 4;
|
public static final int RIGHT_X_AXIS = 4;
|
||||||
public static final int RIGHT_Y_AXIS = 5;
|
public static final int RIGHT_Y_AXIS = 5;
|
||||||
|
public static final int RIGHT_Z_AXIS = 2;
|
||||||
|
public static final int RIGHT_Z_ROTATION = 3;
|
||||||
public static final int LEFT_RIGHT_DPAD_AXIS = 6;
|
public static final int LEFT_RIGHT_DPAD_AXIS = 6;
|
||||||
public static final int TOP_BOTTOM_DPAD_AXIS = 6;
|
public static final int TOP_BOTTOM_DPAD_AXIS = 6;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user