Go to Post I'm so conflicted right now. On one hand, you made the same page as a celebrity. On the other hand.... Justin Bieber. - Akash Rastogi [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
View Poll Results: Swerve or Mecanum? Which does your team prefer?
Mecanum 26 24.53%
Swerve 49 46.23%
Neither, they are too complex and 4wd or 6wd will do the job 31 29.25%
Voters: 106. You may not vote on this poll

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #44   Spotlight this post!  
Unread 13-04-2010, 13:15
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,065
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Mecanum or Swerve?

Quote:
Originally Posted by Laaba 80 View Post
I admit that I have never programmed a mecanum drive, but I dont see it being easy to program. Sure, maybe the basic movements are simple, however I have seen few mechanum drive robots that are controlled effectively. This tells me that either the drivers dont know how to reap the benefits of a mecanum drive, or that the drive code is not up to par.

I programmed an omni drive robot in 08, and by no means was it easy, and it was nowhere near as controllable as I hoped.
Shedding some light on programming of mecanums. 2337's uses a simple version of linear interpolation. The 4 cardinal directions were declared in an array. We then look up which two to use based on which angle we want to move at and interpolate between the two. Pseudo-code below:

Code:
//Define the motors for the cardinal directions
cardDir = [[1,1,1,1],[1,-1,1,-1],[-1,-1,-1,-1],[-1,1,-1,1]];

//Angle is the angle we want to move at. 
a = angle/90;
b = a+1;
t = (angle-(a*90))/90;

//Lerp the thing
motors = cardDir[a] + t*cardDir(b); //Yes, I know b is completely unnecessary but it helped with readability imho 

//Scale it by the velocity

motors *= magitude
Turning is done by specifying a rate of turn and then multiplying the left motors by that percent and the right motors by the negative of the percent. (This part could be backwards, I can't recall)

This was written after we looked at the ugly mess of sines and cosines that did the same thing. We may have more than the 4 cardinal directions and may divide by less than 90 but I can't recall.

Not hard and allows for field centric controls given a good way of determining orientation.

EDIT: Yes, I left out the fact that you need to add the matrices but really it isn't hard.
__________________




.

Last edited by Andrew Schreiber : 13-04-2010 at 13:20.
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Swerve Drive DuskProgrammer Programming 7 16-01-2010 09:29
Swerve vs. Mech? yoshibrock Technical Discussion 24 15-01-2010 13:34
Swerve drive 4, 2+2? kirtar Technical Discussion 18 02-04-2008 06:58
Swerve Drivetrain Pelicano234 Technical Discussion 18 13-05-2007 12:55
Swerve Drive Jeff Waegelin Technical Discussion 14 17-09-2001 08:06


All times are GMT -5. The time now is 14:20.

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