Quote:
Originally Posted by dbeckwith
that actually brings up another problem though, which I've been wondering about for a while: how do you get a robot with Mecanum drive to drive completely straight while turning at a constant rate (as in, the overall motion of the robot is in a straight line, but it is constantly rotating)?
|
If you have a gyro, so that you know the heading of the robot, you can transform the driver's commands into "field-centric" commands
1. So, for example, pushing forward on the joystick would mean "translate straight downfield, regardless of your current heading". So the robot could be rotating continuously as it travels a straight line.
In actual practice, it doesn't work perfectly, because of sensor accuracy and mechanical imperfections (pesky friction and free play etc), but with a well-designed robot built with fine craftsmanship, you can get pretty close.
1The equations to do this can be found here; or you can use the gyro input to the mecanum drive provided in WPILib