Go to Post When I mentor other people in programming... they either get pointers or they don't. - JamesTerm [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 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
  #2   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
  #3   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: 588
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
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 10:40.

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