robot-2023/src/main/java/frc/robot/subsystems/BasePilotable.java

35 lines
1.4 KiB
Java
Raw Normal View History

2023-02-06 19:02:17 -05:00
// 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;
2023-02-06 19:37:01 -05:00
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup;
2023-02-06 19:02:17 -05:00
import edu.wpi.first.wpilibj2.command.SubsystemBase;
2023-02-06 19:37:01 -05:00
import frc.robot.Constants;
2023-02-06 19:02:17 -05:00
public class BasePilotable extends SubsystemBase {
2023-02-06 19:37:01 -05:00
final CANSparkMax avantdroit = new CANSparkMax(Constants.avantdroit, MotorType.kBrushless);
final CANSparkMax avantgauche = new CANSparkMax(Constants.avantgauche, MotorType.kBrushless);
final CANSparkMax arrieredroit = new CANSparkMax(Constants.arrieredroit, MotorType.kBrushless);
final CANSparkMax arrieregauche = new CANSparkMax(Constants.arrieregauche, MotorType.kBrushless);
final MotorControllerGroup droit = new MotorControllerGroup(avantdroit, arrieredroit);
final MotorControllerGroup gauche = new MotorControllerGroup(avantgauche, arrieregauche);
final DifferentialDrive drive = new DifferentialDrive(gauche, droit);
2023-02-06 19:02:17 -05:00
/** Creates a new BasePilotable. */
2023-02-06 19:37:01 -05:00
public BasePilotable() {
droit.setInverted(true);
}
2023-02-06 19:02:17 -05:00
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}