Go to Post What is this sleep you all speak of...if it wasn't in the KOP than it is not allowed to be used :D - Wayne Doenges [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-02-2015, 17:58
BrighidKHeh's Avatar
BrighidKHeh BrighidKHeh is offline
Registered User
FRC #3871 (Trojan Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Worthington, MN
Posts: 37
BrighidKHeh is an unknown quantity at this point
Exclamation No Code in Driver Station!

I run the code perfectly in Eclipse. There are no errors or warning in the code. When I run the code, the buildpath says "Remote command failed with exit status 1". The code still builds successfully even with this error. When I get to the Driver Station, I have no Robot Code. I receive the following error:

ERROR Unhandled exception instantiating robot org.usfirst.frc.team3871.robot.Robotjava.lang.Clas sNotFoundException: org.usfirst.frc.team3871.robot.Robot at [java.net.URL.ClassLoader$1.run(URLClassLoader.java :372), java.net.URL.ClassLoader$1.run(URLClassLoader.java :361), java.security.AccessController.doPriveleged(Native Method), java.net.URLClassLoader.findClass(URLClassLoader.j ava:360),java.lang.ClassLoader.loadClass(ClassLoad er.java:424), sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308), java.lang.ClassLoader.loadClass(ClassLoader.java:3 57), java.lang.Class.forName0(NativeMethod), java.lang.forName(Class.java:259), edu.wpi.first.wpilibi.RobotBase.main(RobotBase.jav a:197)]

I have tried renaming the packages, I have tried scanning the code, and I even fixed an issue in the build path.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2015, 18:08
gbear605's Avatar
gbear605 gbear605 is offline
Scarebear
FRC #1768 (Nashoba Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: United States
Posts: 35
gbear605 is an unknown quantity at this point
Re: No Code in Driver Station!

Our team had the same error when our package structure was named incorrectly. If it's not currently the case, replace the lines
Code:
package=SOMETHING
robot.class=SOMETHING
with
Code:
package=org.usfirst.frc.team3871.robot
robot.class=${package}.Robot
This is in build.properties.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2015, 18:45
BrighidKHeh's Avatar
BrighidKHeh BrighidKHeh is offline
Registered User
FRC #3871 (Trojan Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Worthington, MN
Posts: 37
BrighidKHeh is an unknown quantity at this point
Re: No Code in Driver Station!

Everything is already correct in build.properties
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2015, 19:36
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 93
JacobD is an unknown quantity at this point
Re: No Code in Driver Station!

The best thing to do is start with a very barebones version of code. Make sure that works. Then, add each part to your code in and test it after each addition. Otherwise, could you post some code so we can help you?
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2015, 20:06
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: No Code in Driver Station!

Are you sure your robot class is actually called "Robot" in the "org.usfirst.frc.team3871.robot" package?
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2015, 20:50
BrighidKHeh's Avatar
BrighidKHeh BrighidKHeh is offline
Registered User
FRC #3871 (Trojan Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Worthington, MN
Posts: 37
BrighidKHeh is an unknown quantity at this point
Re: No Code in Driver Station!

Yes,I'm sure it's labeled Robot
Reply With Quote
  #7   Spotlight this post!  
Unread 16-02-2015, 20:54
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: No Code in Driver Station!

Quote:
Originally Posted by BrighidKHeh View Post
Yes,I'm sure it's labeled Robot
And the package is "org.usfirst.frc.team3871.robot"? Sorry for pestering, but that is usually the cause of this problem.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #8   Spotlight this post!  
Unread 16-02-2015, 23:07
BrighidKHeh's Avatar
BrighidKHeh BrighidKHeh is offline
Registered User
FRC #3871 (Trojan Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Worthington, MN
Posts: 37
BrighidKHeh is an unknown quantity at this point
Re: No Code in Driver Station!

Yes it is
Reply With Quote
  #9   Spotlight this post!  
Unread 16-02-2015, 23:11
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 93
JacobD is an unknown quantity at this point
Re: No Code in Driver Station!

We cannot help you until you give us the code.
Reply With Quote
  #10   Spotlight this post!  
Unread 16-02-2015, 23:28
BrighidKHeh's Avatar
BrighidKHeh BrighidKHeh is offline
Registered User
FRC #3871 (Trojan Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Worthington, MN
Posts: 37
BrighidKHeh is an unknown quantity at this point
Re: No Code in Driver Station!

IO? Robot? RobotMap? Build? Subsystems? Commands? There are no errors within the code itself. None that are marked, at least.

Last edited by BrighidKHeh : 16-02-2015 at 23:32.
Reply With Quote
  #11   Spotlight this post!  
Unread 17-02-2015, 00:30
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 93
JacobD is an unknown quantity at this point
Re: No Code in Driver Station!

Quote:
Originally Posted by BrighidKHeh View Post
IO? Robot? RobotMap? Build? Subsystems? Commands? There are no errors within the code itself. None that are marked, at least.
I have seen that error a few times now. It is always a code error. For a while, we were getting that error because our ultrasonics weren't working correctly.
Reply With Quote
  #12   Spotlight this post!  
Unread 17-02-2015, 16:35
BrighidKHeh's Avatar
BrighidKHeh BrighidKHeh is offline
Registered User
FRC #3871 (Trojan Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Worthington, MN
Posts: 37
BrighidKHeh is an unknown quantity at this point
Re: No Code in Driver Station!

Robot.java:
Code:
package org.usfirst.frc.team3871.Trojans2015.robot;
import org.usfirst.frc.team3871.Trojans2015.commands.Autonomous;
import org.usfirst.frc.team3871.Trojans2015.robot.IO;
import org.usfirst.frc.team3871.Trojans2015.subsystems.DriveTrain;
import org.usfirst.frc.team3871.Trojans2015.subsystems.NoodleAndToteSystems;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;

/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class Robot extends IterativeRobot {
 public static Object NoodleAndToteSystem;
 public static Autonomous Autonomous;
 public static IO io;
 public static DriveTrain driveTrain;
 public static NoodleAndToteSystems noodleAndToteSystems;
/**
  * This function is run when the robot is first started up and should be
  * used for any initialization code.
 * @param Autonomous 
  */
 public void robotInit(Autonomous Autonomous) {
	RobotMap.init();
     driveTrain = new DriveTrain();
     noodleAndToteSystems = new NoodleAndToteSystems();
     // This MUST be here. If the OI creates Commands (which it very likely
     // will), constructing it during the construction of CommandBase (from
     // which commands extend), subsystems are not guaranteed to be
     // yet. Thus, their requires() statements may grab null pointers. Bad
     // news. Don't move it.
     io = new IO();
     // instantiate the command used for the autonomous period
     Autonomous = new Autonomous();
 }
 public void autonomousInit() {
     // schedule the autonomous command (example)
     if (Autonomous!= null) Autonomous.start();
 }
/**
  * This function is called periodically during autonomous
  */
 public void autonomousPeriodic() {
     Scheduler.getInstance().run();
 }

 public void teleopInit() {
	// This makes sure that the autonomous stops running when
     // teleop starts running. If you want the autonomous to 
     // continue until interrupted by another command, remove
     // this line or comment it out.
	if (Autonomous != null) Autonomous.cancel();
 }

 /**
  * This function is called periodically during operator control
  */
 public void teleopPeriodic() {
     Scheduler.getInstance().run();
 }

 /**
  * This function called periodically during test mode
  */
 public void testPeriodic() {
     LiveWindow.run();
 }
}

IO.java
Code:
package org.usfirst.frc.team3871.Trojans2015.robot;
//import org.usfirst.frc3871.Trojans3.commands.*;

import org.usfirst.frc.team3871.Trojans2015.commands.Autonomous;
import org.usfirst.frc.team3871.Trojans2015.commands.NoodleBottomSystem;

import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Sendable;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
//import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
//import edu.wpi.first.wpilibj.*;
//import edu.wpi.first.wpilibj.Joystick;
//import edu.wpi.first.wpilibj.buttons.*;
/**
* This class is the glue that binds the controls on the physical operator
* interface to the commands and command groups that allow control of the robot.
* @param <Joystick>
* @param <JoystickButton>
 * @param <limitSwitch>
*/
public class IO {
	 //// CREATING BUTTONS
	 // One type of button is a joystick button which is any button on a joystick.
	 // You create one by telling it which joystick it's on and which button
	 // number it is.
	 // Joystick stick = new Joystick(port);
	 // Button button = new JoystickButton(stick, buttonNumber);
	 
	 // Another type of button you can create is a DigitalIOButton, which is
	 // a button or switch hooked up to the cypress module. These are useful if
	 // you want to build a customized operator interface.
	 // Button button = new DigitalIOButton(1);
	 
	 // There are a few additional built in buttons you can use. Additionally,
	 // by subclassing Button you can create custom triggers and bind those to
	 // commands the same as any other Button.
	 
	 //// TRIGGERING COMMANDS WITH BUTTONS
	 // Once you have a button, it's trivial to bind it to a button in one of
	 // three ways:
	 
	 // Start the command when the button is pressed and let it run the command
	 // until it is finished as determined by it's isFinished method.
	 // button.whenPressed(new ExampleCommand());
	 
	 // Run the command while the button is being held down and interrupt it once
	 // the button is released.
	 // button.whileHeld(new ExampleCommand());
	 
	 // Start the command when the button is released  and let it run the command
	 // until it is finished as determined by it's isFinished method.
	 // button.whenReleased(new ExampleCommand());
	
	 public Joystick rightJoystick;
	 public JoystickButton NoodleBottomMotorsOn;
	 public JoystickButton NoodleTopMotorsOn;  
	 public Joystick ArmUpDown;
	 public Joystick leftJoystick;
	 public DigitalInput limitSwitch1;
	 public DigitalInput limitSwitch2;
	 public DigitalInput limitSwitch3;
	 public DigitalInput limitSwitch4;
	
	 public IO() {
	     rightJoystick = new Joystick(1);
	     leftJoystick = new Joystick(2);
	     NoodleBottomMotorsOn = new JoystickButton(rightJoystick, 3);
	     NoodleBottomMotorsOn.whileHeld(new NoodleBottomSystem());
	     NoodleTopMotorsOn = new JoystickButton(rightJoystick, 2);
	     ArmUpDown = new Joystick(1);
	     limitSwitch1 = new DigitalInput(1);
	     limitSwitch2 = new DigitalInput(2);
	     limitSwitch3 = new DigitalInput(3);
	     limitSwitch4 = new DigitalInput(4);
	     
	     // SmartDashboard Buttons
	     SmartDashboard.putData("Autonomous", (Sendable) new Autonomous());
	     SmartDashboard.putData("Drive With Joysticks", (Sendable) new org.usfirst.frc.team3871.Trojans2015.commands.DriveWithJoysticks());
	     SmartDashboard.putData("Noodle Bottom Motors On", (Sendable) new org.usfirst.frc.team3871.Trojans2015.commands.NoodleBottomSystem());
	     SmartDashboard.putData("Noodle Top Motors On", (Sendable) new org.usfirst.frc.team3871.Trojans2015.commands.NoodleTopSystem());
	     SmartDashboard.putData("Arm Up", (Sendable) new org.usfirst.frc.team3871.Trojans2015.commands.ArmUp());
	 }
	 public Joystick getrightJoystick() {
		return rightJoystick;
	 }      
	 /**
	  *
	  * @return
	  */
	 public Joystick getleftJoystick() {
	     return leftJoystick;
	 }
 }


RobotMap.java
Code:
package org.usfirst.frc.team3871.Trojans2015.robot;
    
import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;

/**
 * The RobotMap is a mapping from the ports sensors and actuators are wired into
 * to a variable name. This provides flexibility changing wiring, makes checking
 * the wiring easier and significantly reduces the number of magic numbers
 * floating around.
 */
public class RobotMap {
    public static SpeedController driveTrainFrontRightMotor;
    public static SpeedController driveTrainFrontLeftMotor;
    public static RobotDrive driveTrainRobotDrive41;
    public static SpeedController toteLiftSystemArmMotor;
    public static SpeedController noodleWheel1SystemMotor;
    public static SpeedController noodleWheel2SystemMotor;
    public static SpeedController noodleWheel3SystemMotor;
    public static RobotDrive noodleBottomSystemMotor;
    public static RobotDrive noodleTopSystemMotor;
    public static SpeedController ArmMotor;

    public static void init() {
        driveTrainFrontRightMotor = new Talon(1);
	LiveWindow.addActuator("Drive Train", "Front Right Motor", (Talon) driveTrainFrontRightMotor);
        driveTrainFrontLeftMotor = new Talon(2);
	LiveWindow.addActuator("Drive Train", "Front Left Motor", (Talon) driveTrainFrontLeftMotor);
        noodleWheel1SystemMotor = new Talon(3);
        LiveWindow.addActuator("NoodleAndToteSystem", "Wheel 1 System", (Talon) noodleWheel1SystemMotor);
        noodleWheel2SystemMotor = new Jaguar(4);
        LiveWindow.addActuator("NoodleAndToteSystem", "Wheel 2 System", (Jaguar) noodleWheel2SystemMotor);
        noodleWheel3SystemMotor = new Jaguar(5);
        LiveWindow.addActuator("NoodleAndToteSystem", "Wheel 3 System", (Jaguar) noodleWheel3SystemMotor);
        ArmMotor = new Talon(6);
        LiveWindow.addActuator("NoodleAndToteSystem", "Tote Lift System", (Talon) ArmMotor);
        
        driveTrainRobotDrive41 = new RobotDrive(driveTrainFrontLeftMotor,
              driveTrainFrontRightMotor);
	
        driveTrainRobotDrive41.setSafetyEnabled(true);
        driveTrainRobotDrive41.setExpiration(0.1);
        driveTrainRobotDrive41.setSensitivity(0.5);
        driveTrainRobotDrive41.setMaxOutput(1.0);
    }
}


Build Properties
# Project specific information
package=org.usfirst.frc.team3871.robot
robot.class=${package}.Robot
simula/worlds/Geation.world.file=/usr/share/frcsimrsBotDemo.world

Last edited by BrighidKHeh : 17-02-2015 at 22:33.
Reply With Quote
  #13   Spotlight this post!  
Unread 18-02-2015, 11:47
Cel Skeggs Cel Skeggs is offline
Robot Software Manager Alumnus
AKA: Previously known as Colby
FRC #1540 (The Flaming Chickens)
Team Role: Alumni
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Portland, Oregon, USA
Posts: 107
Cel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of light
Re: No Code in Driver Station!

Quote:
Originally Posted by BrighidKHeh View Post
Code:
package org.usfirst.frc.team3871.Trojans2015.robot;
...
Code:
package=org.usfirst.frc.team3871.robot
I suspect that this would be your problem. Your package is clearly not just "org.usfirst.frc.team3871.robot". "Trojans2015" is still part of the package name.

(Also, for future reference, package name elements are usually lower-case: org.usfirst.frc.team3871.trojans2015.robot.)
__________________
Software manager alumnus. Developer of the CCRE, a powerful robot code framework based on dataflow and composibility.
Refer to as she/her/hers. Years of FRC: 2012, 2013, 2014, 2015, 2016. FLL for a few years beforehand.
Team 1540: The Flaming Chickens | Portland, Oregon | Twitter | Facebook
Reply With Quote
  #14   Spotlight this post!  
Unread 23-02-2015, 16:46
BrighidKHeh's Avatar
BrighidKHeh BrighidKHeh is offline
Registered User
FRC #3871 (Trojan Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Worthington, MN
Posts: 37
BrighidKHeh is an unknown quantity at this point
Re: No Code in Driver Station!

I fixed that. It still didn't work.
Reply With Quote
  #15   Spotlight this post!  
Unread 23-02-2015, 16:49
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 93
JacobD is an unknown quantity at this point
Re: No Code in Driver Station!

Quote:
Originally Posted by JacobD View Post
The best thing to do is start with a very barebones version of code. Make sure that works. Then, add each part to your code in and test it after each addition. Otherwise, could you post some code so we can help you?
Did you try this yet?
Reply With Quote
Reply


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 18:05.

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