Quote:
Originally Posted by Jared341
In general, our implementation only uses the gyro if we detect that the driver is trying to go straight (the X axis of single stick drive is near 0) - when turning, we leave everything up to the driver. Other than that, pretty much the same.
|
OK, it looks to me like that's quite a bit different from what I was trying to achieve.
What I posted is intended to make an essentially field-centric driver interface to a skid-steer vehicle: the driver "points" the joystick in a given (field-centric) direction with a given magnitude, and the robot turns and goes in that direction at the commanded speed,
viz:
- you push the joystick straight forward and the robot turns and heads straight downfield
- you pull the joystick straight back and the robot turns around and heads back toward you
- you push the joystick to your right and the robot turns and goes straight across the field from left to right
- you push the joystick to your left and the robot turns and goes straight across the field from right to left
- ... or any angle in-between
Optionally (by adding two more lines of code as shown) the robot could limit the required turning to 90 degrees or less by reversing direction. So if the robot was going straight downfield, for example, and the driver then pulled the joystick straight back, instead of turning around the robot would simply reverse direction by reversing the wheel speeds... but if the driver pushed the joystick to the right the robot would still turn and drive to the driver's right (regardless of the robot's orientation at the time).
Whether or not this mode of driver interface would be helpful depends on the game being played and the driver's experience and skill. Using this interface does not, of course, preclude having a robot-centric (or any other) interface available at the press of a button, so it could be used selectively.