-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
driveDrive subsystem and navigationDrive subsystem and navigationgood first issueGood for newcomersGood for newcomers
Description
Currently, binding a controller to the drive's drive command takes the form of drive.drive(() -> speedsFromController(controller)). This is because drive is a function of supplied ChassisSpeeds. This flexible interface is a good design; however it is very granular and could be up to interpretation. So, a simpler method for binding a controller to a drive command may be warranted. Some examples for improvements:
- Create a
driveWithControlleralias that performs the binding within the method.
public Command driveWithController(CommandXboxController controller) {
return drive(() -> speedsFromController(controller));
}- Extract
speedsFromControllerand transform it to be aFunction<CommandXboxController, Supplier<ChassisSpeeds>>
drive.drive(ChassisSpeedsHelper.fromController(controller))Note that for 2, ChassisSpeedsHelper is a new class that assist with creating, transforming, and using ChassisSpeeds. There are multiple methods in Drive that have this responsibility; some can be moved to ChassisSpeedsHelper and some can't. It may be challenging to move some of these methods over, but all can be!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
driveDrive subsystem and navigationDrive subsystem and navigationgood first issueGood for newcomersGood for newcomers
Type
Projects
Status
Ideas