Go to Post However, as a philosopher, while you need math, you can probably talk your way out of it. - sciguy125 [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
  #9   Spotlight this post!  
Unread 24-11-2011, 22:06
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
Re: help with mecanum drive code

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).

And the jaguarDrive method:

Code:
public void jaguarDrive(double FL, double RL, double FR, double RR)
    {
        m_frontLeftMotor.set(FL);
        m_rearLeftMotor.set(RL);
        m_frontRightMotor.set(FR);
        m_rearRightMotor.set(RR);
    }
This is by far the simplest solution I've seen.
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)
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:30.

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