Go to Post I think it's great the way people involved in FIRST always try so hard not to argue. It's a good sign that all the talk of Gracious Professionalism is working. - BaldwinNYRookie [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 16-02-2015, 13:15
SirGibbs SirGibbs is offline
Registered User
FRC #5676 (Hornets)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2015
Location: USA
Posts: 11
SirGibbs is an unknown quantity at this point
Build Errors

Hey guys,
after multiple errors with eclipse and my code, I got it finally but when I try to deploy the code now, I get this error:
Code:
ERROR Unhandled exception instantiating robot org.usfirst.frc.team5676.robot.Robot java.lang.IllegalStateException: Network tables has already been initialized at [edu.wpi.first.wpilibj.networktables.NetworkTable.checkInit(NetworkTable.java:45), edu.wpi.first.wpilibj.networktables.NetworkTable.setServerMode(NetworkTable.java:68), edu.wpi.first.wpilibj.RobotBase.<init>(RobotBase.java:58), edu.wpi.first.wpilibj.IterativeRobot.<init>(IterativeRobot.java:55), org.usfirst.frc.team5676.robot.Robot.<init>(Robot.java:16), sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method), sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62), sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45), java.lang.reflect.Constructor.newInstance(Constructor.java:408), java.lang.Class.newInstance(Class.java:433), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:197)]
I just dont know what I would need to change to make it running... here is my code:

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() {
    
    }
    
}
Thank you in advance for any help or suggestions.
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 22:23.

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