Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Add driver toggleable slow-mode #26

Open
will-hou opened this issue Feb 17, 2020 · 3 comments
Open

Add driver toggleable slow-mode #26

will-hou opened this issue Feb 17, 2020 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@will-hou
Copy link
Member

Two parts:

  • It would be good to have a customizable driveSpeedScalar to modify the speed of the drivetrain with on Shuffleboard. Currently it's just a boolean that halves the drivespeed when true. This can just be done by modifying (and renaming) the existing TableEntry here and setting the initialValue to a Double instead of a Boolean. You'd also have to multiply the driver-inputted throttle value by it here
  • During a match, the driver would not have time to go into shuffleboard and type in a drivespeed scalar to enter slowmode. There should be a button that sets the drivespeed scalar to a predefined value in code (0.5 or something should be good). A function in the OI.kt file should be created that sets the value of driveSpeedScalar to a predefined value in drivetrainPreferences that's triggered by the pressing of the X button on the primary controller. The function should also set the speed scalar back to 1.0 when the button is pressed again. See here for an example of how to set the value of a TableEntry
@will-hou will-hou added enhancement New feature or request help wanted Extra attention is needed labels Feb 17, 2020
@andrewda
Copy link
Member

andrewda commented Feb 17, 2020

For reference, here's how we handled that last year:

https://github.com/SouthEugeneRoboticsTeam/DeepSpace-2019/blob/development/src/main/kotlin/org/sert2521/deepspace/drivetrain/DrivetrainCommands.kt#L42-L62 (the trigger on the XBox controller allowed variable downscaling while held in).

@will-hou
Copy link
Member Author

will-hou commented Feb 18, 2020

Oh hm I didn't realize that we already had a driveSpeedScalar in the code. Would it be better to modify that or a TableEntry? Values in the Preferences table persist after rebooting right? I'm worried that we'll accidentally forget to change the value back to 1.0 before the match and we go 🐢🐢. Have we run into that before or is that not really a problem?

@andrewda
Copy link
Member

@will-hou yeah we ran into that once or twice last year. I think eventually we just set the scalar to 1 on boot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants