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
6 changes: 4 additions & 2 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import frc.robot.sim.SimWorld;
import frc.robot.subsystems.algaePivot.AlgaePivotInterface;
import frc.robot.subsystems.algaePivot.AlgaePivotSubsystem;
import frc.robot.subsystems.algaePivot.PhysicalAlgaePivot;
import frc.robot.subsystems.algaePivot.PhysicalAlgaePivot
import frc.robot.subsystems.algaePivot.SimulatedAlgaePivot;
import frc.robot.subsystems.coralIntake.CoralIntakeInterface;
import frc.robot.subsystems.coralIntake.CoralIntakeSubsystem;
Expand Down Expand Up @@ -196,9 +196,11 @@ private void configureOperatorController() {
.x()
.whileTrue(new SetElevatorPosition(elevatorSubsystem, ElevatorConstants.INTAKE_SETPOINT));
operatorController.rightBumper().whileTrue(new EjectCoral(coralIntakeSubsystem));

operatorController
.a()
.whileTrue(new SetElevatorPosition(elevatorSubsystem, ElevatorConstants.LEVEL_FEEDER));
operatorController
.rightBumper()
.whileTrue(new ManualElevator(elevatorSubsystem, () -> operatorController.getLeftY()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
/* 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 SetElevatorPosition extends Command {
ElevatorSubsystem elevatorSubsystem;

double position;

/** Creates a new SetElevatorPosition. */
/**
* Creates a new SetElevatorPosition.
*
* @param elevatorSubsystem The subsystem used by this command.
* @param position The position to set the elevator to in meters.
*/
public SetElevatorPosition(ElevatorSubsystem elevatorSubsystem, double position) {
this.elevatorSubsystem = elevatorSubsystem;
this.position = position;
Expand Down
41 changes: 41 additions & 0 deletions src/main/java/frc/robot/commands/elevator/ZeroElevator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// 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.elevator;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.elevator.ElevatorConstants;
import frc.robot.subsystems.elevator.ElevatorSubsystem;

/* 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 ZeroElevator extends Command {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If u r doing this in ur elevator safety pr u dont need it here.

/** Creates a new ZeroElevator. */
ElevatorSubsystem elevatorSubsystem;

public ZeroElevator(ElevatorSubsystem elevatorSubsystem) {
// Use addRequirements() here to declare subsystem dependencies.
this.elevatorSubsystem = elevatorSubsystem;
addRequirements(elevatorSubsystem);
}

// Called when the command is initially scheduled.
@Override
public void initialize() {}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
elevatorSubsystem.setElevatorPosition(ElevatorConstants.MIN_HEIGHT); // zeroes it
}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {}

// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public class ElevatorConstants {
public static final double REVERSE_LIMIT = 0.10;
public static final boolean REVRESE_LIMIT_ENABLE = false;

// Setpoints
public static final double INTAKE_SETPOINT = -1.25;
// Elevator setpoints
public static final double LEVEL_1 = 59;
public static final double LEVEL_2 = 118;
public static final double LEVEL_3 = 177;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's l4

public static final double LEVEL_FEEDER = -1.25;
}
11 changes: 6 additions & 5 deletions vendordeps/AdvantageKit.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "AdvantageKit.json",
"name": "AdvantageKit",
"version": "4.0.0",
"version": "4.1.0",
"uuid": "d820cc26-74e3-11ec-90d6-0242ac120003",
"frcYear": "2025",
"mavenUrls": [
Expand All @@ -12,21 +12,22 @@
{
"groupId": "org.littletonrobotics.akit",
"artifactId": "akit-java",
"version": "4.0.0"
"version": "4.1.0"
}
],
"jniDependencies": [
{
"groupId": "org.littletonrobotics.akit",
"artifactId": "akit-wpilibio",
"version": "4.0.0",
"version": "4.1.0",
"skipInvalidPlatforms": false,
"isJar": false,
"validPlatforms": [
"linuxathena",
"windowsx86-64",
"linuxx86-64",
"osxuniversal"
"linuxarm64",
"osxuniversal",
"windowsx86-64"
]
}
],
Expand Down