Quote:
Originally Posted by jreneew2
Does Mechdrive_Cartesian take care of that automatically?
|
Three things:
1) I assume you have a mecanum drivetrain? (there is no "h" in "mecanum")
2) If you want to drive in a straight line in any particular direction, and simultaneously rotate the bot to a desired angle, you can do that using mecanumDrive_Cartesian. Feed your gyro to the gyroAngle parameter; supply the x and y components of the desired straight-line field-centric motion to the x and y parameters; and feed the output of a closed-loop controller to the rotation parameter. The input to the controller will be your desired angle (setpoint) and your gyro reading (process variable).
and finally, and perhaps most importantly:
3) Mechanical workmanship is of paramount importance. Make sure your drivetrain is built and aligned correctly before attempting #2 above. If you're not sure what "built and aligned correctly" means in the context of mecanum drive, I encourage you to ask before proceeding.