RobotCasserole1736 / RobotCasserole2019

Software for Robot Casserole's 2019 FIRST Deep Space competition season
MIT License
5 stars 0 forks source link

Parkerify driver controls #128

Closed gerth2 closed 5 years ago

gerth2 commented 5 years ago

Parker likes to drive the robot like a video game. He will "tap" the joystick controls to full range when he wants to move the robot. These impulse disturbances tend to cause jerky motion and tippiness in the robot. The robot is designed to work with partial-range inputs, not full-on/full-off commands.

We can help.

Add a function to "smooth out" the driver motor commands by adding a 15-point averaging filter to the fwd/rev and rotate commands.

Note we only want to do this inside DriverController.java - we don't want to impact the behavior of auto align or anything like that. Just add some smoothing to the robot commands. It's likely this will slow down the robot (as it now takes ~300ms for the driver command to ramp to full speed). We will have to try this out during first practice day, and remove if it's impeding performance.

gerth2 commented 5 years ago

Additional logic: If the sign of the input (pos, neg, or zero) is different than the previous loop, clear-out the filter buffer. This should cause direction-change commands to be much "snappier". while still smoothign out the pulsing.