Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3dec6a7
path changes
Mar 1, 2025
2af2c92
broken
JAMthepersonj Mar 13, 2025
1a7a3f7
Merge branch 'main' of https://github.com/FRC4048/FRC2025_Java into n…
JAMthepersonj Mar 13, 2025
88683d0
merge errors
JAMthepersonj Mar 13, 2025
c421942
update
JAMthepersonj Mar 14, 2025
13931bf
update
JAMthepersonj Mar 14, 2025
566751c
UPDATE
JAMthepersonj Mar 14, 2025
c8dd298
updated to use lamda
JAMthepersonj Mar 14, 2025
5afb845
added two square collison?
JAMthepersonj Mar 15, 2025
5e42285
update
JAMthepersonj Mar 15, 2025
2796432
update
JAMthepersonj Mar 15, 2025
895ea49
update
JAMthepersonj Mar 15, 2025
f0df905
Fixed a few things
neo-Aditya Mar 16, 2025
7b5eabb
removed unnecesary symbol
neo-Aditya Mar 16, 2025
099f5d9
renamed method to be clearer
neo-Aditya Mar 17, 2025
aa7a13e
renamed variable
neo-Aditya Mar 17, 2025
55bb754
Removed unused classes
neo-Aditya Mar 19, 2025
0dd4b00
idk why these didn't commit aswell
neo-Aditya Mar 19, 2025
5a323c5
IT WORKKKKKSKSKSKKSKSKS
JAMthepersonj Mar 19, 2025
48be9f2
Merge branch 'first_phase_rumble' of https://github.com/FRC4048/FRC20…
JAMthepersonj Mar 19, 2025
f6751f3
error con merge
JAMthepersonj Mar 19, 2025
34dd4dc
stuff
JAMthepersonj Mar 19, 2025
39516a7
added toggle for rumble
JAMthepersonj Mar 20, 2025
d45b9f5
updated With noah changes
JAMthepersonj Mar 20, 2025
434b21f
name
JAMthepersonj Mar 20, 2025
bea9836
add enum
JAMthepersonj Mar 20, 2025
57790b7
added max rumble
JAMthepersonj Mar 20, 2025
a0ea03a
added changes
JAMthepersonj Mar 20, 2025
6a5381b
names
JAMthepersonj Mar 20, 2025
456a951
Updated#1
JAMthepersonj Mar 21, 2025
d48d435
added fieldZoneUtils
JAMthepersonj Mar 21, 2025
8791600
Merge branch 'main' of https://github.com/FRC4048/FRC2025_Java into f…
JAMthepersonj Mar 21, 2025
19b62bc
added erro message / backup if we do not have an alliance color
JAMthepersonj Mar 22, 2025
80ee41c
lint
JAMthepersonj Mar 22, 2025
7c629c7
update
JAMthepersonj Mar 23, 2025
b8adff8
Merge branch 'main' of https://github.com/FRC4048/FRC2025_Java into f…
JAMthepersonj Mar 23, 2025
7b78d2e
Actually used the command in robot container :cry:
JAMthepersonj Mar 23, 2025
83195a2
Merge branch 'main' of https://github.com/FRC4048/FRC2025_Java into f…
JAMthepersonj Mar 23, 2025
ef05224
Merge branch 'main' of https://github.com/FRC4048/FRC2025_Java into f…
JAMthepersonj Mar 24, 2025
23c54b5
Changed name of second GetY
JAMthepersonj Mar 24, 2025
823c9c1
added rumble toggle
JAMthepersonj Mar 25, 2025
025601f
changed
JAMthepersonj Mar 25, 2025
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
7 changes: 7 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import edu.wpi.first.wpilibj2.command.button.Trigger;
import frc.robot.apriltags.ApriltagInputs;
import frc.robot.apriltags.MockApriltag;
import frc.robot.apriltags.TCPApriltag;
import frc.robot.autochooser.AutoAction;
import frc.robot.autochooser.FieldLocation;
import frc.robot.autochooser.chooser.AutoChooser2025;
import frc.robot.autochooser.event.RealAutoEventProvider;
import frc.robot.commands.RumbleController;
import frc.robot.commands.byebye.ByeByeToFwrLimit;
import frc.robot.commands.byebye.ByeByeToRevLimit;
import frc.robot.commands.climber.ClimbToLimit;
Expand Down Expand Up @@ -75,6 +77,7 @@
import frc.robot.subsystems.swervev3.io.steer.SimSteerMotorIO;
import frc.robot.utils.BlinkinPattern;
import frc.robot.utils.ModulePosition;
import frc.robot.utils.RobotMode;
import frc.robot.utils.logging.LoggableIO;
import frc.robot.utils.motor.Gain;
import frc.robot.utils.motor.PID;
Expand Down Expand Up @@ -211,6 +214,10 @@ private void pathPlannerCommands() {
}

private void configureBindings() {
if (Constants.RUMBLE_CONTROLLER) {
new Trigger(() -> Robot.getMode() == RobotMode.TELEOP)
.onTrue(new RumbleController(drivetrain::getPose, controller));
}
lightStrip.setDefaultCommand(
new SetLedFromElevatorPosition(elevatorSubsystem::getStoredReefPosition, lightStrip));
drivetrain.setDefaultCommand(
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/frc/robot/commands/RumbleController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// 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.commands;

import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.wpilibj.GenericHID.RumbleType;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.utils.FieldZoneUtils;
import frc.robot.utils.logging.commands.LoggableCommand;
import java.util.function.Supplier;

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class RumbleController extends LoggableCommand {

private final Supplier<Pose2d> robotPose;
private final CommandXboxController controller;

public RumbleController(Supplier<Pose2d> robotPose, CommandXboxController controller) {
this.robotPose = robotPose;
this.controller = controller;
}

@Override
public void initialize() {}

@Override
public void execute() {
if (FieldZoneUtils.isInOppositeBarge(robotPose.get().getX(), robotPose.get().getY())) {
controller.setRumble(RumbleType.kBothRumble, 1);
} else controller.setRumble(RumbleType.kBothRumble, 0);
}

@Override
public void end(boolean interrupted) {}

@Override
public boolean isFinished() {
return false;
}
}
29 changes: 16 additions & 13 deletions src/main/java/frc/robot/commands/climber/StopClimber.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
import frc.robot.utils.logging.commands.LoggableCommand;

public class StopClimber extends LoggableCommand {
private ClimberSubsystem climber;
public StopClimber(ClimberSubsystem climber) {
this.climber = climber;
addRequirements(climber);
}
@Override
public void initialize() {
climber.stopClimber();
}
@Override
public boolean isFinished() {
return true;
}
private ClimberSubsystem climber;

public StopClimber(ClimberSubsystem climber) {
this.climber = climber;
addRequirements(climber);
}

@Override
public void initialize() {
climber.stopClimber();
}

@Override
public boolean isFinished() {
return true;
}
}
9 changes: 4 additions & 5 deletions src/main/java/frc/robot/commands/sequences/CancelAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
import frc.robot.subsystems.algaebyebyetilt.AlgaeByeByeTiltSubsystem;
import frc.robot.subsystems.climber.ClimberSubsystem;
import frc.robot.subsystems.elevator.ElevatorSubsystem;
import frc.robot.subsystems.swervev3.SwerveDrivetrain;
import frc.robot.utils.logging.commands.LoggableSequentialCommandGroup;

/** Add your docs here. */
public class CancelAll extends LoggableSequentialCommandGroup {

public CancelAll(
AlgaeByeByeTiltSubsystem algaeByeByeTiltSubsystem,
AlgaeByeByeRollerSubsystem algaebyebyeroller,
ElevatorSubsystem elevatorSubsystem,
ClimberSubsystem climberSubsystem) {
AlgaeByeByeTiltSubsystem algaeByeByeTiltSubsystem,
AlgaeByeByeRollerSubsystem algaebyebyeroller,
ElevatorSubsystem elevatorSubsystem,
ClimberSubsystem climberSubsystem) {
super(
new StopClimber(climberSubsystem),
new ByeByeAllDone(algaeByeByeTiltSubsystem, algaebyebyeroller, elevatorSubsystem),
Expand Down
1 change: 1 addition & 0 deletions src/main/java/frc/robot/constants/GameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ public enum Mode {
public static final boolean HI_HI_SIMULATE_GRAVITY = false;
public static final int MAX_VALID_TICKS_INTAKE = 15; // TODO: Change Later
public static final int MAX_VALID_TICKS_ELEVATOR = 10; // TODO: Change Later
public static final boolean RUMBLE_CONTROLLER = true;

public static final double ROBOT_MASS = 58.967; // In Kg, change later
public static final double ROBOT_BUMPER_WIDTH = 0.914;
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/frc/robot/utils/Barge.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// 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.utils;

import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStation.Alliance;
import frc.robot.Robot;

/** Add your docs here. */
public enum Barge {
RIGHT_LOWER(8.9246, 0),
RIGHT_HIGHER(8.9246, 4),
LEFT_LOWER(7.56, 0),
LEFT_HIGHER(7.56, 4);

private final double x;
private final double y;

Barge(double x, double y) {
this.x = x;
this.y = y;
}

public double getX() {
return x;
}

public double getY(DriverStation.Alliance AllianceColor) {
return AllianceColor.equals(Alliance.Blue) ? y : y + 4;
}

public double getY() {
return Robot.getAllianceColor().isPresent()
? Robot.getAllianceColor().get().equals(Alliance.Blue) ? y : y + 4
: -1;
}
}
24 changes: 24 additions & 0 deletions src/main/java/frc/robot/utils/FieldZoneUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 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.utils;

import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStation.Alliance;
import frc.robot.Robot;
import java.util.Optional;

/** Add your docs here. */
public class FieldZoneUtils {

public static boolean isInOppositeBarge(double x, double y) {
Optional<DriverStation.Alliance> al = Robot.getAllianceColor();
if ((x < Barge.RIGHT_HIGHER.getX()) && (x > Barge.LEFT_LOWER.getX()) && (al.isPresent())) {
return al.get().equals(Alliance.Red)
? (y < Barge.RIGHT_HIGHER.getY())
: (y > Barge.RIGHT_HIGHER.getY());
}
return false;
}
}