I’ve always wondered how this would work in frc, and have tried it before, but I got weird issues where motors would turn when they’re not supposed to. Would anyone be open to share how they’ve done it or how they’d do it?
By racing game xbox controller controls I mean having the right trigger forward, left trigger reverse, and the left analogue stick (left and right) turning the robot.
There are a number of threads on the topic. 'Round these parts I’ve heard it called GTA drive or video game drive. As with basically any tank drive control system setup, it has its positives and negatives and it really comes down to driver preference.
228 did this during the 2017 season and it worked perfectly. It was probably the most intuitive controls setup I’ve worked with. It was particularly helpful for this year because the robot doesn’t have a dedicated “front” or “back” - by removing the “up / down” directional aspect of the throttle control, it made it more intuitive to drive “backwards” - you just hit one trigger to move the ball intake side of the robot, the other to move the gear intake side.
The easiest way to write it in code, is to sum the negative of one trigger’s value with the positive of the other, and then pass the result as the first argument of WPILib’s ArcadeDrive method. The second argument should be the value of your steering joystick. You have to pass values into the method for this to work, not the joysticks themselves.
For slightly better results, try squaring the input on the triggers (before negating!) for a more useful response curve.