I’m working on some arcade single stick control for our chassis. I see a problem is the turning is weird. It seems like one side is getting more power than the other, which actually may be the user control. I tried modifying the code to create some kind of ‘dead band’ for both x and y axes. It looks like this:
driveLeftChassisSide(((fabs(vexRT[Ch3]) >= 30) ? (vexRT[Ch3]) : (0)) + ((fabs(vexRT[Ch4]) >= 30) ? (vexRT[Ch4]) : (0)));
driveRightChassisSide(((fabs(vexRT[Ch3]) >= 30) ? (vexRT[Ch3]) : (0)) - ((fabs(vexRT[Ch4]) >= 30) ? (vexRT[Ch4]) : (0)));
Basically, if my driver wants to turn to the right, they move the joystick to the right (no duh, captain obvious). Let’s say the value all the way to the right is +127 (for the x value) and +15 (for the y value). The code says if the joystick value is under a minimum (in this case 30), then set the value to 0. This gives a value of +127 to the left side and -127 to the right side to create a nice pivot. I made this because my driver can’t perfectly line the joystick to an x or y value of exactly 0. I don’t have a robot to test this on, so could this work? Thank you in advance.
(Sorry for the parentheses overload)