mirror of
https://github.com/Team4388/Robot-Essentials.git
synced 2026-06-09 00:38:01 -06:00
Merge pull request #20 from Team4388/falcon-drive
Switch from TalonSRX to TalonFx Drive Train
This commit is contained in:
@@ -9,7 +9,7 @@ package frc4388.robot;
|
|||||||
|
|
||||||
import com.ctre.phoenix.motorcontrol.InvertType;
|
import com.ctre.phoenix.motorcontrol.InvertType;
|
||||||
import com.ctre.phoenix.motorcontrol.NeutralMode;
|
import com.ctre.phoenix.motorcontrol.NeutralMode;
|
||||||
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
|
||||||
import com.ctre.phoenix.sensors.PigeonIMU;
|
import com.ctre.phoenix.sensors.PigeonIMU;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj.Spark;
|
import edu.wpi.first.wpilibj.Spark;
|
||||||
@@ -37,10 +37,10 @@ public class RobotMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Drive Subsystem */
|
/* Drive Subsystem */
|
||||||
public final WPI_TalonSRX leftFrontMotor = new WPI_TalonSRX(DriveConstants.DRIVE_LEFT_FRONT_CAN_ID);
|
public final WPI_TalonFX leftFrontMotor = new WPI_TalonFX(DriveConstants.DRIVE_LEFT_FRONT_CAN_ID);
|
||||||
public final WPI_TalonSRX rightFrontMotor = new WPI_TalonSRX(DriveConstants.DRIVE_RIGHT_FRONT_CAN_ID);
|
public final WPI_TalonFX rightFrontMotor = new WPI_TalonFX(DriveConstants.DRIVE_RIGHT_FRONT_CAN_ID);
|
||||||
public final WPI_TalonSRX leftBackMotor = new WPI_TalonSRX(DriveConstants.DRIVE_LEFT_BACK_CAN_ID);
|
public final WPI_TalonFX leftBackMotor = new WPI_TalonFX(DriveConstants.DRIVE_LEFT_BACK_CAN_ID);
|
||||||
public final WPI_TalonSRX rightBackMotor = new WPI_TalonSRX(DriveConstants.DRIVE_RIGHT_BACK_CAN_ID);
|
public final WPI_TalonFX rightBackMotor = new WPI_TalonFX(DriveConstants.DRIVE_RIGHT_BACK_CAN_ID);
|
||||||
public final DifferentialDrive driveTrain = new DifferentialDrive(leftFrontMotor, rightFrontMotor);
|
public final DifferentialDrive driveTrain = new DifferentialDrive(leftFrontMotor, rightFrontMotor);
|
||||||
public final RobotGyro gyroDrive = new RobotGyro(new PigeonIMU(DriveConstants.DRIVE_PIGEON_ID));
|
public final RobotGyro gyroDrive = new RobotGyro(new PigeonIMU(DriveConstants.DRIVE_PIGEON_ID));
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
package frc4388.robot.subsystems;
|
package frc4388.robot.subsystems;
|
||||||
|
|
||||||
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||||
@@ -26,18 +26,18 @@ public class Drive extends SubsystemBase {
|
|||||||
|
|
||||||
private RobotTime m_robotTime = RobotTime.getInstance();
|
private RobotTime m_robotTime = RobotTime.getInstance();
|
||||||
|
|
||||||
private WPI_TalonSRX m_leftFrontMotor;
|
private WPI_TalonFX m_leftFrontMotor;
|
||||||
private WPI_TalonSRX m_rightFrontMotor;
|
private WPI_TalonFX m_rightFrontMotor;
|
||||||
private WPI_TalonSRX m_leftBackMotor;
|
private WPI_TalonFX m_leftBackMotor;
|
||||||
private WPI_TalonSRX m_rightBackMotor;
|
private WPI_TalonFX m_rightBackMotor;
|
||||||
private DifferentialDrive m_driveTrain;
|
private DifferentialDrive m_driveTrain;
|
||||||
private RobotGyro m_gyro;
|
private RobotGyro m_gyro;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add your docs here.
|
* Add your docs here.
|
||||||
*/
|
*/
|
||||||
public Drive(WPI_TalonSRX leftFrontMotor, WPI_TalonSRX rightFrontMotor, WPI_TalonSRX leftBackMotor,
|
public Drive(WPI_TalonFX leftFrontMotor, WPI_TalonFX rightFrontMotor, WPI_TalonFX leftBackMotor,
|
||||||
WPI_TalonSRX rightBackMotor, DifferentialDrive driveTrain, RobotGyro gyro) {
|
WPI_TalonFX rightBackMotor, DifferentialDrive driveTrain, RobotGyro gyro) {
|
||||||
|
|
||||||
m_leftFrontMotor = leftFrontMotor;
|
m_leftFrontMotor = leftFrontMotor;
|
||||||
m_rightFrontMotor = rightFrontMotor;
|
m_rightFrontMotor = rightFrontMotor;
|
||||||
|
|||||||
Reference in New Issue
Block a user