Go to Post I just got pwned by Dave...how awesome is that?! - Tetraman [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
  #16   Spotlight this post!  
Unread 23-01-2010, 13:30
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: Programming Mecanum

Quote:
Originally Posted by Daniel Jones View Post
The holonomic drive function will work with either mecanum or with a 4-wheel omni drive if the wheels are oriented 90 degrees from eachother, arranged like this:
/\
\/
on your diagram above for holonomic drive, when using mecanum wheels does it matter which way they are oriented?

.
Reply With Quote
  #17   Spotlight this post!  
Unread 27-01-2010, 18:41
Zrob Zrob is offline
Registered User
FRC #1631
 
Join Date: Sep 2008
Location: Henderson
Posts: 5
Zrob is an unknown quantity at this point
Re: Programming Mecanum

Ah, yes it works pretty well, except there's you gotta use

Code:
drive.holonomicDrive(leftStick.getMagnitude(), leftStick.getDirectionDegrees(), rightStick.getX());
holonomicDrive takes magnitude first, then direction.

One thing though: There's these weird delays, which I'm attempting to fix.
Reply With Quote
  #18   Spotlight this post!  
Unread 29-01-2010, 01:38
Imadapocalypse's Avatar
Imadapocalypse Imadapocalypse is offline
The Walking Contradiction
AKA: Bryce Ribucan
FRC #2443 (Blue Thunder)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Hawaii
Posts: 40
Imadapocalypse is an unknown quantity at this point
Send a message via AIM to Imadapocalypse
Re: Programming Mecanum

Okay at this moment our programmers are working on trying to figure out the holonomic drive method. The motors are connected to the correct PWMs and we've been using the exact code given here in the forum but through our misfortune we have came up with the notion that the holonomic drive class has errors. Depending on what we do to our code the wheels will run in opposite directions, forward, or rotate; but never reverse.

We think it has something to do with the order of the parameters. Our programming works better if we put rotation where magnitude goes and vice versa. Direction is still much of a mystery.

As you can probably surmise from this entry our troupe of programmers are confused at this point. Right now our mentor is planning to copy the holonomic drive class in order to play with it to see if that yields any positive results.
__________________
The needs of the many out-weigh the needs of the few and the one

Reply With Quote
  #19   Spotlight this post!  
Unread 29-01-2010, 13:20
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Programming Mecanum

Do you need to set the motors on one side inverted? When we first just tried we noticed the wheels on one side were reversed and we needed to add:

setInvertedMotor(RobotDrive.MotorType motor, boolean isInverted)
Reply With Quote
  #20   Spotlight this post!  
Unread 15-02-2010, 21:43
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: Programming Mecanum

Can someone please post the java scource code for the holonomicDrive Function?
Reply With Quote
  #21   Spotlight this post!  
Unread 16-02-2010, 17:10
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: Programming Mecanum

Quote:
Originally Posted by Robototes2412 View Post
Can someone please post the java scource code for the holonomicDrive Function?
The code is posted below, but anyone with Java can simply look at the source code by opening the project that comes with the distribution:
Code:
    public void holonomicDrive(double magnitude, double direction, double rotation) {
        double frontLeftSpeed, rearLeftSpeed, frontRightSpeed, rearRightSpeed;
        magnitude = limit(magnitude);
        double cosD = Math.cos((direction + 45.0) * 3.14159 / 180.0);
        double sinD = Math.cos((direction - 45.0) * 3.14159 / 180.0);
        frontLeftSpeed = limit((sinD * magnitude + rotation));
        rearLeftSpeed = limit((cosD * magnitude + rotation));
        frontRightSpeed = limit((cosD * magnitude - rotation));
        rearRightSpeed = limit((sinD * magnitude - rotation));

        m_frontLeftMotor.set(frontLeftSpeed * m_invertedMotors[MotorType.kFrontLeft_val]);
        m_frontRightMotor.set(frontRightSpeed * m_invertedMotors[MotorType.kFrontRight_val]);
        m_rearLeftMotor.set(rearLeftSpeed * m_invertedMotors[MotorType.kRearLeft_val]);
        m_rearRightMotor.set(rearRightSpeed * m_invertedMotors[MotorType.kRearRight_val]);
    }
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #22   Spotlight this post!  
Unread 17-02-2010, 16:11
PapaRobocat PapaRobocat is offline
Registered User
FRC #2161
 
Join Date: Jan 2009
Location: Long Island NY
Posts: 5
PapaRobocat is an unknown quantity at this point
Re: Programming Mecanum

How do we program these wheels when they do not drive straight? In stupid terms cause I do not understand all the programming lingo.
Reply With Quote
  #23   Spotlight this post!  
Unread 04-04-2010, 23:00
jase728 jase728 is offline
Registered User
AKA: Jase728
FRC #3210 (Falcons)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Hillsboro
Posts: 11
jase728 is an unknown quantity at this point
Re: Programming Mecanum

A good idea is to set up each motion (eg front or strafe) separately
then get the axis from your joystick this will get the magnitude
you will have to figure out the math
__________________
"In theory there is reality, but in reality there is no theory" - Erich Keane (FRC 2010 Build Season - Team 3210)
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
Mecanum Programming Help Mars Programming 8 27-02-2008 15:41
Bizarre Mecanum Programming Bug manderson5192 Programming 10 08-02-2008 22:11
Mecanum drivetrain programming problems Mr. Freeman Programming 4 21-03-2007 17:11
mecanum programming mrmummert Programming 27 28-01-2007 13:45
programming motors with programming kit BorisTheBlade FIRST Tech Challenge 4 01-11-2005 19:03


All times are GMT -5. The time now is 12:21.

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