Go to Post There's so much to say about a sponsor who gets involved and cares about your team over one who just signs a check. - galewind [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 Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 16-02-2010, 11:55
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
My mecanum method wont strafe

I wrote this after looking at some documentation someone wrote up.

Code:
    public void mechanumDrive(double v, double r, double s){
        /*
         * You all love Dr. Tran, so Try His mega-awesome MECANUM DRIVE!!!
        */
        double FLval; double FRval; double RLval; double RRval;
        FLval = v - r - s;
        FRval = v + r + s;
        RLval = v - r + s;
        RRval = v + r - s;

        FLjag.set(FLval);
        FRjag.set(FRval);
        LRjag.set(RLval);
        RRjag.set(RRval);
        
        /*if (leftStick.getRawButton(2)) {
            v = v * Math.sqrt(2.0);
            double dirInRad = (s + 45.0) * 3.14159 / 180.0;
            double cosD = Math.cos(dirInRad);
            double sinD = Math.sin(dirInRad);

            FLval = sinD * v - r;
            FRval = cosD * v + r;
            RLval = sinD * v + r;
            RRval = cosD * v - r;

            FLjag.set(FLval);
            FRjag.set(FRval);
            LRjag.set(RLval);
            RRjag.set(RRval);
            
        }*/
        
    }

    void rawStrafe(String direction, double speed) {
        direction.toLowerCase();
        if (direction.compareTo("left") == 0) {
            FLjag.set(-speed);
            FRjag.set(speed);
            RRjag.set(-speed);
            LRjag.set(speed);
        } else if (direction.compareTo("right") == 0) {
            FLjag.set(speed);
            FRjag.set(-speed);
            RRjag.set(speed);
            LRjag.set(-speed);
        }
    }
I cannot get either if these to strafe. what happens when I try is the wheels "stick" in place (thats about the best way I can describe it)

Last edited by Robototes2412 : 16-02-2010 at 11:57. Reason: cruft removal
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dashboard wont work... nadavsen2 C/C++ 2 22-09-2012 15:43
SIGNAL LIGHT WONT WORK kick3nitx360 Electrical 57 18-02-2010 22:36
Team 930's bump strafe Brewerboy82 Robot Showcase 23 08-02-2010 19:35
cRIO wont run software ThisAintJeff NI LabVIEW 4 02-02-2010 15:47
G4 wont turn on! MattK General Forum 14 26-08-2003 09:44


All times are GMT -5. The time now is 08:52.

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