RobotCasserole1736 / CasseroleLib

Common Libraries used year-to-year for FRC robot code
MIT License
6 stars 1 forks source link

Add joystick axis scaling library #17

Open gerth2 opened 7 years ago

gerth2 commented 7 years ago

We often desire to scale the driver's joystick input to a more appropriate driver command. This is to enhance the controlability of the robot. We should implement a library that transforms joystick values into appropriate driver commands. This will be a stateless transform of joystick value to driver command, with both the input and output in the range -1 to 1 inclusive.

Three primary issues should be overcome:

Some of the math and graphs for this work are laid out in this ChiefDelphi paper

At the end of the day, the library should be a single class with a public "scale" method that takes one input of type double (the joystick value) and returns a single value of type double (the transformed command). The three parameters (deadband, inverse deadband, and exponential power) should also be publicly available to set.