Go to Post I wish I had two extra hands, so I could give those gearboxes four thumbs up! - Billfred [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
  #13   Spotlight this post!  
Unread 02-17-2015, 11:33 AM
cstelter cstelter is offline
Programming Mentor
AKA: Craig Stelter
FRC #3018 (Nordic Storm)
Team Role: Mentor
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Mankato, MN
Posts: 77
cstelter will become famous soon enough
Re: Build Errors

Only thing that jumped out at me is you're instantiating both xbox controller and Joystick on port 1. That doesn't seem right, but likely won't lead to the problem.

Try commenting all but the drivetrain and incrementally adding in items

i.e. start with:

Code:
package org.usfirst.frc.team5676.robot;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import org.usfirst.frc.team5676.robot.XboxController; 
import edu.wpi.first.wpilibj.Compressor;	
import org.usfirst.frc.team5676.robot.XboxController.Axis;
import org.usfirst.frc.team5676.robot.XboxController.buttons;
import org.usfirst.frc.team5676.robot.XboxController.triggers;


public class Robot extends IterativeRobot {
   
	RobotDrive myDrive; 
	Joystick driveStick; 
	//static XboxController gameStick = new XboxController(1);
	//DoubleSolenoid Piston; 
	
	//static Axis LeftStick=Global.driver.LeftStick;
	//static Axis RightStick=Global.driver.RightStick;
	//static triggers Triggers = Global.driver.Triggers;
	//static buttons DriverButtons = Global.driver.Buttons;
	//static buttons OperatorButtons = Global.operator.Buttons;
	//static int OperatorDpad = -1;
	
    public void robotInit() {
    	myDrive = new RobotDrive (1, 2, 3, 4);
    	driveStick = new Joystick(1); 
    }

    
    public void autonomousPeriodic() {

    }

    public void operatorControl() { 
    	while (isOperatorControl() && isEnabled()) { 
    		myDrive.arcadeDrive(driveStick);
    		Timer.delay(0.01);
    	}
    }
    public void teleopPeriodic() {
        
    }
/*    
    public void moveArm()
	{	 Piston = new DoubleSolenoid(0,1 );
		
		if(gameStick.button[0].get() == true) {
			
			Piston.set(DoubleSolenoid.Value.kForward);	
		
			System.out.println("'A' button is pressed: Piston moves forward");
		}
	  else if(gameStick.button[1].get() ==true)
		{
			Piston.set(DoubleSolenoid.Value.kReverse); 
	
			System.out.println("'B' button is pressed: Piston moves backward");
		}
		else
		{
			Piston.set(DoubleSolenoid.Value.kOff);		
		}
	}
    
    public void FrontArm()
   	{	 Piston = new DoubleSolenoid(2,3 );
   			
   		if(gameStick.button[2].get() == true) {
   			
   			Piston.set(DoubleSolenoid.Value.kForward);	
   			System.out.println("'X' button is pressed: Piston moves forward");
   		}
   	  else if(gameStick.button[3].get() ==true)
   		{
   			Piston.set(DoubleSolenoid.Value.kReverse); 
   			System.out.println("'Y' button is pressed: Piston moves backward");
   		}
   		else
   		{
   			Piston.set(DoubleSolenoid.Value.kOff);	
   		}
   	}

    
    public void pickerArm()
	{	 Piston = new DoubleSolenoid(4,5 );
		
		if(gameStick.button[4].get() == true) {
			
			Piston.set(DoubleSolenoid.Value.kForward);	
		
			System.out.println("LB' button is pressed: Piston moves forward");
		}
	  else if(gameStick.button[5].get() ==true)
		{
			Piston.set(DoubleSolenoid.Value.kReverse); 
			
			System.out.println("'RB' button is pressed: Piston moves backward");
		}
		else
		{
			Piston.set(DoubleSolenoid.Value.kOff);
		}
	}
    */
  
    public void testPeriodic() {
    
    }
    
}
Hmm... as I was making suggested comments, I noticed that you are using iterative Robot, but relying on operatorControl() to actually drive. I'm not sure if/how operatorControl() is used in IterativeRobot. Normally one would put that code in teleopPeriodic and not implement operatorControl()

Code:
   /*
    public void operatorControl() { 
    	while (isOperatorControl() && isEnabled()) { 
    		myDrive.arcadeDrive(driveStick);
    		Timer.delay(0.01);
    	}
    }
   */
    public void teleopPeriodic() {
          myDrive.arcadeDrive(driveStick); 
    }
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:45 AM.

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