Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mode manager for easy toggle between competition and demo #58

Merged
merged 8 commits into from
Oct 30, 2024

Conversation

luanzeba
Copy link
Contributor

Adds a Robot mode manager to easily switch between demo and competition mode.
That mode should be accessible throughout the Robot code to define speeds, acceleration and other factors to make it safer to operate during demos.
This also makes the Robot mode setter accessible from the Elastic dashboard.
We've tested this code on the robot last Tuesday.

@@ -208,7 +209,7 @@ public static final class ElevatorConstants {
public static final double MAX_HEIGHT_METERS = Units.inchesToMeters(17);
public static final double STARTING_HEIGHT_METERS = Units.inchesToMeters(2);
public static final boolean SIMULATE_GRAVITY = true;
public static final int ELEVATOR_CURRENT_LIMIT = 30;
public static final int ELEVATOR_CURRENT_LIMIT = Robot.modeManager.getMode() == RobotMode.DEMO ? 15 : 30;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is something we were playing with to apply demo mode to the elevator acceleration but haven't tested yet. We're also not sure this is the best place to apply this logic

@luanzeba luanzeba marked this pull request as ready for review October 27, 2024 19:48
Copy link

@OmnistelvirDev OmnistelvirDev left a comment

Choose a reason for hiding this comment

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

looks good to me

src/main/java/frc/robot/Robot.java Show resolved Hide resolved
@RHR2713
Copy link
Contributor

RHR2713 commented Oct 30, 2024

tested on hardware 10/30

@RHR2713 RHR2713 merged commit ed8bcf3 into wcmp Oct 30, 2024
1 check failed
@RHR2713 RHR2713 deleted the add-mode-manager branch October 30, 2024 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants