View Single Post
  #2   Spotlight this post!  
Unread 28-01-2015, 19:58
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 140
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Main Robot Code NOT Working

Okay, two easy issues to fix.

1. Code taken from DriveTele.java
Code:
protected void execute() {
        Robot.base.mecanumDrive(
                (XBox.LEFTJOY_X+XBox.LEFTJOY_Y)/2,
                (XBox.LEFTJOY_Y-XBox.LEFTJOY_X)/2,
                -(XBox.LEFTJOY_Y-XBox.LEFTJOY_X)/2,
                -(XBox.LEFTJOY_X+XBox.LEFTJOY_Y)/2);
    }
Right here XBox.LEFTJOY_X is an enum. It will always be the same value (definition of an enum). It appears this enum represents the number of the left x axis. Instead you should access the actual value from the joystick with:
Code:
Robot.oi.joystick.getLeftJoyX();
2. Code taken from Chasis.java
Code:
public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        //setDefaultCommand(new DriveTele());
    }
You need to uncomment "setDefaultCommand(new DriveTele());" to tell the Chasis the run the DriveTele command and make your robot move.


Also you said that increment() and decrement() are dead, but they are just commented out...
Reply With Quote