Go to Post ...sitting immediately behind Chief Delphi is a bad idea. I like the team and all, but they've given me a massive headache...They've got too much spirit. - IMDWalrus [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 10 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #14   Spotlight this post!  
Unread 24-11-2011, 23:03
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: help with mecanum drive code

Quote:
Originally Posted by Djur View Post
Ah. Then I should just add that by setting FL, RL, FR, RR to the same value will make the robot turn. Positive values turn the robot clockwise, negative values turn it counterclockwise (assuming the motors are hooked up correctly).

Very simple example use for turning:
Code:
boolean turnRightAtFullSpeed = true;
if(turnRightAtFullSpeed)
jaguarDrive(1, 1, 1, 1);
If you want full 3 degree of freedom control (rotate while translating), you should either use the provided WPI library codes for mecanum, or do something like this:

Code:
"y" is the forward command

"x" is the strafe right command

"z" is the rotate clockwise command


Step1:

Compute the 4 wheel speeds:

FL = y + x + z

FR = y - x - z

RL = y - x + z

RR = y + x - z


Step2:

Find the max absolute value of the above four commands, 
and if it is greater than 1, 
divide all four commands by that max absolute value.

Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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