Go to Post Wisdom shared is priceless, isn't it? And timeless. - JaneYoung [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 04-05-2016, 16:45
rlounds's Avatar
rlounds rlounds is offline
Registered Usr
AKA: Ryan Lounds
FRC #0865 (Warp7)
Team Role: Operator
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Toronto
Posts: 14
rlounds is a splendid one to beholdrlounds is a splendid one to beholdrlounds is a splendid one to beholdrlounds is a splendid one to beholdrlounds is a splendid one to beholdrlounds is a splendid one to beholdrlounds is a splendid one to behold
Question Mecanum Java Code

Hi, so on my teams demo robot we're using mecanum wheels, a 4 slot cRIO and some victor 884s and we cant seem to get it working right. I don't know that much about code so it'd be great if I could get some help.

The code can be found below, any suggestions/correction are very much appreciated.
Code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Victor;

public class RobotTemplate extends SimpleRobot {

    RobotDrive myDrive;
    Joystick driveStick;
    
    public void robotInit() {
        driveStick = new Joystick(1);
        Victor frontLeft = new Victor(1);
        Victor frontRight = new Victor(2);
        Victor rearLeft = new Victor(3);
        Victor rearRight = new Victor(4);
        myDrive = new RobotDrive(frontLeft, rearLeft, frontRight, rearRight);
        System.out.println("Sample Text");
    }
    
    public void autonomous() {
        
    }

    public void operatorControl() {
        while (isOperatorControl() && isEnabled()) {
            myDrive.mecanumDrive_Cartesian(driveStick.getX(), driveStick.getY(), driveStick.getTwist(), 0);
            Timer.delay(0.01);
      
        }
    }
    
    public void test() {
    
    }
}
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 09:37.

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