Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 51 additions & 28 deletions src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,55 @@
// Contains all ports on our robot

public class RobotMap {
public static class mapControllers {
public static final int DRIVER_USB = 0;
}

public static class mapDrivetrain {
public static final String CAN_BUS_NAME = "Swerve";
public static final int PIGEON_CAN = 0;

// Module 0
public static final int FRONT_LEFT_DRIVE_CAN = 0;
public static final int FRONT_LEFT_STEER_CAN = 1;
public static final int FRONT_LEFT_ABSOLUTE_ENCODER_CAN = 0;

// Module 1
public static final int FRONT_RIGHT_DRIVE_CAN = 2;
public static final int FRONT_RIGHT_STEER_CAN = 3;
public static final int FRONT_RIGHT_ABSOLUTE_ENCODER_CAN = 1;

// Module 2
public static final int BACK_LEFT_DRIVE_CAN = 4;
public static final int BACK_LEFT_STEER_CAN = 5;
public static final int BACK_LEFT_ABSOLUTE_ENCODER_CAN = 2;

// Module 3
public static final int BACK_RIGHT_DRIVE_CAN = 6;
public static final int BACK_RIGHT_STEER_CAN = 7;
public static final int BACK_RIGHT_ABSOLUTE_ENCODER_CAN = 3;
}
public static class mapControllers {
public static final int DRIVER_USB = 0;
}

public static class mapDrivetrain {
public static final String CAN_BUS_NAME = "Swerve";
public static final int PIGEON_CAN = 0;

// Module 0
public static final int FRONT_LEFT_DRIVE_CAN = 0;
public static final int FRONT_LEFT_STEER_CAN = 1;
public static final int FRONT_LEFT_ABSOLUTE_ENCODER_CAN = 0;

// Module 1
public static final int FRONT_RIGHT_DRIVE_CAN = 2;
public static final int FRONT_RIGHT_STEER_CAN = 3;
public static final int FRONT_RIGHT_ABSOLUTE_ENCODER_CAN = 1;

// Module 2
public static final int BACK_LEFT_DRIVE_CAN = 4;
public static final int BACK_LEFT_STEER_CAN = 5;
public static final int BACK_LEFT_ABSOLUTE_ENCODER_CAN = 2;

// Module 3
public static final int BACK_RIGHT_DRIVE_CAN = 6;
public static final int BACK_RIGHT_STEER_CAN = 7;
public static final int BACK_RIGHT_ABSOLUTE_ENCODER_CAN = 3;
}

// Intake ID 11-20
public static class mapIntake {
// coral intake motors and pivot
public static final int INTAKE_PIVOT_CAN = 11;
public static final int CORAL_LEFT_CAN = 12;
public static final int CORAL_RIGHT_CAN = 13;
// Algae intake motor
public static final int INTAKE_ALGAE_CAN = 14;
}

// Elevator ID 21-30
public static class mapElevator {
public static final int ELEVATOR_LEFT_CAN = 21;
public static final int ELEVATOR_RIGHT_CAN = 22;
public static final int ELEVATOR_RIGHT_PIVOT_CAN = 23;
public static final int ELEVATOR_LEFT_PIVOT_CAN = 24;
}

// Climber ID 31-40
public static class mapClimber {
public static final int CLIMBER_LEFT_CAN = 31;
}
}
26 changes: 26 additions & 0 deletions src/main/java/frc/robot/subsystems/Climber.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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.hardware.TalonFX;

import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.RobotMap.mapClimber;

public class Climber extends SubsystemBase {
TalonFX climberLeftMotor;

/** Creates a new Climber. */
public Climber() {
climberLeftMotor = new TalonFX(mapClimber.CLIMBER_LEFT_CAN); // Climber left motor, using CAN ID 31 as per RobotMap
// Set default motor configurations if needed
// e.g., climberLeftMotor.configFactoryDefault();
}

@Override
public void periodic() {
// This method will be called once per scheduler run
}
}
34 changes: 34 additions & 0 deletions src/main/java/frc/robot/subsystems/Elevator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 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.hardware.TalonFX;

import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.RobotMap.mapElevator;

public class Elevator extends SubsystemBase {
TalonFX elevatorLeftMotor;
TalonFX elevatorRightMotor;
TalonFX elevatorLeftPivotMotor;
TalonFX elevatorRightPivotMotor;

/** Creates a new Elevator. */
public Elevator() {

elevatorLeftMotor = new TalonFX(mapElevator.ELEVATOR_LEFT_CAN); // Elevator left motor
elevatorRightMotor = new TalonFX(mapElevator.ELEVATOR_RIGHT_CAN); // Elevator right motor
elevatorLeftPivotMotor = new TalonFX(mapElevator.ELEVATOR_LEFT_PIVOT_CAN); // Elevator left pivot motor
elevatorRightPivotMotor = new TalonFX(mapElevator.ELEVATOR_RIGHT_PIVOT_CAN); // Elevator right pivot motor

// Set default motor configurations if needed
// e.g., elevatorLeftMotor.configFactoryDefault();
}

@Override
public void periodic() {
// This method will be called once per scheduler run
}
}
33 changes: 33 additions & 0 deletions src/main/java/frc/robot/subsystems/Intake.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// 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.hardware.TalonFX;

import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.RobotMap.mapIntake;

public class Intake extends SubsystemBase {
TalonFX intakePivotMotor;
TalonFX coralLeftMotor;
TalonFX coralRightMotor;
TalonFX algaeIntakeMotor;

/** Creates a new Intake. */
public Intake() {
intakePivotMotor = new TalonFX(mapIntake.INTAKE_PIVOT_CAN); // Intake pivot motor
coralLeftMotor = new TalonFX(mapIntake.CORAL_LEFT_CAN); // Coral left intake motor
coralRightMotor = new TalonFX(mapIntake.CORAL_RIGHT_CAN); // Coral right intake motor
algaeIntakeMotor = new TalonFX(mapIntake.INTAKE_ALGAE_CAN); // Algae intake motor

// Set default motor configurations if needed
// e.g., intakePivotMotor.configFactoryDefault();
}

@Override
public void periodic() {
// This method will be called once per scheduler run
}
}