Go to Post In all seriousness, here's a thought for everyone: Don't worry about what you can't control. - Rich Kressly [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: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 16-02-2011, 18:16
Omgsar's Avatar
Omgsar Omgsar is offline
Registered User
AKA: Evan Gray
FRC #2745 (S.A.R.)
Team Role: Programmer
 
Join Date: Apr 2009
Rookie Year: 2008
Location: San Antonio
Posts: 7
Omgsar is an unknown quantity at this point
Unhappy Holonomic Drive System Issues, Robot Drives Diagonally...

Our robot is acting a bit wonky. We have a holonomic drive system made with the omni wheels, and mechanically everything seems sound. So, all that is left is the code. Here is our code:
Code:
  public void operatorControl() {

        System.out.println("operatorControl");
        initAll(); //init all variables
        while (true && isOperatorControl() && isEnabled()) {
            getReadings(); //Get the readings for the drive
            spikeTrigger(); //Get the readings for the actuator on the arm and map them, comment out to debug
            driveRobot.mecanumDrive_Polar(leftMagnitude, leftDirection, rotationRate);
 

            Timer.delay(0.01);
        }
That code is just for our drive. Here is where we declare things and such:
Code:
  private void getReadings() {


        leftMagnitude = leftStick.getMagnitude();
        leftDirection = leftStick.getDirectionDegrees();
        rotationRate = rightStick.getAxis(Joystick.AxisType.kX);
        Timer.delay(0.01);

    }
Here are some more:
Code:
 Joystick leftStick = new Joystick(1);
    Joystick rightStick = new Joystick(2);
    Jaguar jagFrontLeft = new Jaguar(1);
    Jaguar jagFrontRight = new Jaguar(2);
    Jaguar jagBackLeft = new Jaguar(3);
    Jaguar jagBackRight = new Jaguar(4);
    Victor victorLeft = new Victor(5);
    Victor victorRight = new Victor(6);
   Relay spike1 = new Relay(7);
    Relay spike2 = new Relay(8);
    RobotDrive driveRobot = new RobotDrive(jagFrontLeft, jagBackLeft, jagFrontRight, jagBackRight);
    Gyro roboGyro = new Gyro(2);
    double leftMagnitude = 0;
    double leftDirection = 0;
    double rotationRate = 0;
Can anyone here spot anything that seems off to you? I have never programmed a holonomic drive, nor was I really prepared, but I wanted to give it a try. Any help would be appreciated.

Attached is a diagram of what our robot tends to do. The green arrow is the direction that it is supposed to travel, and the red arrow is the direction that it actually travels.

We are using the Logitech Attack3 Joysticks, and yes I have tried to read most of the documentation that is already present on this forum. Specifically the posts by "Ether," those posts really helped... The problem exists in the fact that I don't really understand the calculations and diagrams presented in them.

Thanks in advance.

2745


OH! and all of our PWM cables are plugged in properly/in the right slot
Attached Thumbnails
Click image for larger version

Name:	lolbot.png
Views:	23
Size:	5.9 KB
ID:	10143  
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 08:32.

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