Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   help with mecanum drive code (http://www.chiefdelphi.com/forums/showthread.php?t=97989)

Ether 25-11-2011 00:14

Re: help with mecanum drive code
 
Quote:

Originally Posted by Djur (Post 1086512)
This is our team's custom mecanum code:

Code:

jaguarDrive((jX+jY)/2, (jY-jX)/2, -(jY-jX)/2, -(jX+jY)/2);
jX and jY are just the X and Y coordinates our joysticks read (-1 through 1).


This is by far the simplest solution I've seen.

Simplicity comes at a price:

If jX is zero, your forward command to the wheels is limited to +/-0.5.

If jY is zero, your strafe command to the wheels is limited to +/-0.5

Only when |jX|=|jY|=1 will you ever be commanding full power.


Quote:

Originally Posted by Djur (Post 1086519)
That's very interesting, although I see no point at which a robot would need to do that except for showing off.

Most folks like to be able to turn while driving, rather than have to stop and rotate-in-place.





austin1743 08-02-2012 14:35

Re: help with mecanum drive code
 
well we have tried out code and it works but wants to go to the left the entire time as if it is in constant strafing mode. Also we have the joystick set-up in the code so when it goes forward to go forward but it goes backwards when we press forward.

I have tried changing the drive to being negative but this doesn't change anything. any suggestions?

Ether 08-02-2012 14:49

Re: help with mecanum drive code
 
Quote:

Originally Posted by austin1743 (Post 1122445)
well we have tried out code and it works but wants to go to the left the entire time as if it is in constant strafing mode. Also we have the joystick set-up in the code so when it goes forward to go forward but it goes backwards when we press forward.

I have tried changing the drive to being negative but this doesn't change anything. any suggestions?

Do you have the mec wheels mounted properly*? If so, continue:

Put the robot up on blocks.

Make an empty table on a clean sheet of paper and fill it in as you run these tests:

Give a pure forward command, and for each wheel record the direction it is spinning.

Give a pure reverse command, and for each wheel record the direction it is spinning.

Give a pure strafe_right command, and for each wheel record the direction it is spinning.

Give a pure strafe_left command, and for each wheel record the direction it is spinning.

Give a pure rotate_right command, and for each wheel record the direction it is spinning.

Give a pure rotate_left command, and for each wheel record the direction it is spinning.

Post the test results here.


* viewed from the top, rollers should form an "X" pattern, not an "O".


austin1743 08-02-2012 18:40

Re: help with mecanum drive code
 
yes we have the x made by the mecanum wheels. i will post the results up tomorrow when i go back in, thanks.

also in the code itself we have leftFrontspeed, rightFrontspeed do we need the back wheels set-up in the class the same way?


All times are GMT -5. The time now is 11:30.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi