-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/20-arm-pivot-outline' into End-E…
…ffector
- Loading branch information
Showing
9 changed files
with
118 additions
and
22 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/main/java/frc/robot/constants/CAN.java → ...java/frc/robot/constants/ALPHABOTCAN.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package frc.robot.constants; | ||
|
||
public class V2CAN { | ||
public static final String rioCanbus = "rio"; | ||
public static String driveBaseCanbus = "drivebase"; | ||
|
||
public static final int pigeon = 9; | ||
|
||
public static final int frontLeftCanCoder = 10; | ||
public static final int frontRightCanCoder = 11; | ||
public static final int backLeftCanCoder = 12; | ||
public static final int backRightCanCoder = 13; | ||
|
||
public static final int frontLeftDriveMotor = 20; | ||
public static final int frontLeftTurnMotor = 21; | ||
public static final int frontRightDriveMotor = 22; | ||
public static final int frontRightTurnMotor = 23; | ||
public static final int backLeftDriveMotor = 24; | ||
public static final int backLeftTurnMotor = 25; | ||
public static final int backRightDriveMotor = 26; | ||
public static final int backRightTurnMotor = 27; | ||
|
||
public static final int hopperIntakeMotor1 = 30; | ||
public static final int hopperIntakeMotor2 = 31; | ||
|
||
public static final int endEffectorPivotMotor = 32; | ||
public static final int endEffectorOuttakeMotor = 35; | ||
public static final int endEffecotrPivotCanCoder = 36; | ||
|
||
public static final int elevatorMotor1 = 33; | ||
public static final int elevatorMotor2 = 34; | ||
|
||
public static final int groundRollerMotor = 40; | ||
public static final int groundPivotMotor = 41; | ||
public static final int groundPivotCanCoder = 42; | ||
|
||
public static final int cageGrabMotor = 50; | ||
public static final int cageArmMotor = 51; | ||
public static final int cageArmCanCoder = 52; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// 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 frc.robot.subsystems; | ||
|
||
import com.ctre.phoenix6.configs.TalonFXConfiguration; | ||
import com.ctre.phoenix6.controls.MotionMagicDutyCycle; | ||
import com.ctre.phoenix6.controls.MotionMagicTorqueCurrentFOC; | ||
import com.ctre.phoenix6.hardware.CANcoder; | ||
import com.ctre.phoenix6.hardware.TalonFX; | ||
import com.ctre.phoenix6.signals.NeutralModeValue; | ||
|
||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import frc.robot.constants.ENDEFFECTOR; | ||
import frc.robot.constants.V2CAN; | ||
|
||
public class EndEffectorWrist extends SubsystemBase { | ||
|
||
private final TalonFX m_pivotMotor = new TalonFX(V2CAN.endEffectorPivotMotor); | ||
private final CANcoder m_pivotEncoder = new CANcoder(V2CAN.endEffecotrPivotCanCoder); | ||
|
||
private final NeutralModeValue m_neutralMode = NeutralModeValue.Brake; | ||
|
||
private final MotionMagicTorqueCurrentFOC m_request = new MotionMagicTorqueCurrentFOC(0); | ||
// private doulbe m_desiredRotations = | ||
/** Creates a nepw EndEffectorWrist. */ | ||
|
||
public EndEffectorWrist() { | ||
TalonFXConfiguration configuration = new TalonFXConfiguration(); | ||
configuration.Slot0.kP = ENDEFFECTOR.kP; | ||
configuration.Slot0.kI = ENDEFFECTOR.kI; | ||
configuration.Slot0.kD = ENDEFFECTOR.kD; | ||
configuration.MotorOutput.NeutralMode = m_neutralMode; | ||
configuration.Feedback.RotorToSensorRatio = ENDEFFECTOR.endEffectorGearRatio; | ||
|
||
|
||
|
||
} | ||
|
||
@Override | ||
public void periodic() { | ||
// This method will be called once per scheduler run | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters