Go to Post Woody, If there is any chance your reading this ... you've changed my life. - Gope [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

 
Reply
Thread Tools Rate Thread Display Modes
  #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
  #2   Spotlight this post!  
Unread 16-02-2010, 15:55
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: My mecanum method wont strafe

There is a macanum drive method built into the RobotDrive class in WPILib. If you create a RobotDrive object with the port numbers for the 4 SpeedControllers, you can call the holonomicDrive method that takes a direction (X and Y value) and a rate of rotation. There are a number of teams that are using that code and it seems to be working for them.

If you would like to write it yourself, feel free to check out the source code for that class. The math is pretty well tested.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2010, 16:34
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
Re: My mecanum method wont strafe

the holoNomic Drive function wont let my robot go forwards
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2010, 17:13
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: My mecanum method wont strafe

Quote:
Originally Posted by Robototes2412 View Post
the holoNomic Drive function wont let my robot go forwards
It's designed for 4 macanum wheels toed in 45 degrees. Is that what you have?

Here are the comments for the holonomicDrive method:
Code:
    /**
     * Holonomic drive class for Mecanum wheeled robots.
     *
     * Experimental class for driving with Mecanum wheeled robots. There are 4 wheels
     * on the robot, arranged so that the front and back wheels are toed in 45 degrees.
     *
     * For holonomic drive with omni-wheels, the rotation value will need to be
     * offset based on the drive configuration.
     *
     * @param magnitude The speed that the robot should drive in a given direction.
     * @param direction The direction the robot should drive in degrees. The direction and maginitute are
     * independent of the rotation rate.
     * @param rotation The rate of rotation for the robot that is completely independent of
     * the magnitute or direction.
     */
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2010, 17:58
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
Re: My mecanum method wont strafe

We have the wheels as such (birds-eye view):
Code:
\/
/\
(from bottom)
Code:
/\
\/

Last edited by Robototes2412 : 16-02-2010 at 18:20. Reason: oops
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2010, 19:26
Daedalus Daedalus is offline
Registered User
no team
 
Join Date: Feb 2010
Rookie Year: 1999
Location: Alexandria
Posts: 1
Daedalus is an unknown quantity at this point
Re: My mecanum method wont strafe

Quote:
Originally Posted by Robototes2412 View Post
We have the wheels as such (birds-eye view):
Code:
\/
/\
(from bottom)
Code:
/\
\/
You need to switch your wheels. The bottom view should look like your top view currently does. That should fix your problem, the reason your robot will not work right now is because the force vectors are incorrect and will prevent your robot from moving.
Reply With Quote
  #7   Spotlight this post!  
Unread 17-02-2010, 02:51
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: My mecanum method wont strafe

Quote:
Originally Posted by Daedalus View Post
You need to switch your wheels. The bottom view should look like your top view currently does. That should fix your problem, the reason your robot will not work right now is because the force vectors are incorrect and will prevent your robot from moving.
Actually he has it correct and you are recommending that he make it wrong. The bottom should be a diamond.
Reply With Quote
  #8   Spotlight this post!  
Unread 17-02-2010, 13:18
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
Re: My mecanum method wont strafe

then we spent an hour switching the wheels for nothing?
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2010, 14:04
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: My mecanum method wont strafe

Quote:
Originally Posted by Robototes2412 View Post
then we spent an hour switching the wheels for nothing?
It would seem so. It appears that is the only post that user account has made. Perhaps if you had searched you would have seen this thread or this thread or this thread.

Searching is your friend... you don't have to wait for a reply and others don't have to keep answering the same questions.

-Joe
Reply With Quote
Reply


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 11:12.

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