View Single Post
  #5   Spotlight this post!  
Unread 03-12-2014, 15:15
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Running two commands at once, but both commands use the same motors.

Quote:
Originally Posted by jreneew2 View Post
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.


Reply With Quote