Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   No Robot Code (http://www.chiefdelphi.com/forums/showthread.php?t=153859)

beardo17 18-01-2017 10:23

No Robot Code
 
We are having troubles with our robot code showing up on our robot. When we run it, the compiler says build successful but the driver station says no robot code and the comms light on the roboRIO is solid red.

Our code is on Github: https://github.com/beardo17/6121-2017

Last year we had a similar issue but I don't remember how we fixed it. Any help would be much appreciated.

question 18-01-2017 10:36

Re: No Robot Code
 
My team had a similar issue, turned out the roborio did not correctly get imaged even though the current image on the imaging tool said the correct image, Try reimaging and reinstalling java to the roborio.

beardo17 18-01-2017 10:43

Re: No Robot Code
 
We did that. We have the latest image and firmware and Java on the roboRIO. We also Updated the eclipse plugins and redownloaded the update suite.

AustinShalit 18-01-2017 11:52

Re: No Robot Code
 
You are using static initialization. This means you do not know what order Objects are going to be created in. For example, in your DriveSubsystem on line 19 you call Robot.oi.getX(). Robot.oi is null and has not been created yet.

The easiest way to fix this is to create your robot project with RobotBuilder.

engunneer 18-01-2017 11:54

Re: No Robot Code
 
Quote:

Originally Posted by beardo17 (Post 1632885)
We are having troubles with our robot code showing up on our robot. When we run it, the compiler says build successful but the driver station says no robot code and the comms light on the roboRIO is solid red.

Our code is on Github: https://github.com/beardo17/6121-2017

Last year we had a similar issue but I don't remember how we fixed it. Any help would be much appreciated.

if the comms light is red, it has no way to know if there is code or not. fix comms first!

beardo17 18-01-2017 11:56

I forgot to mention the comms is green in the driver station. And last year's competition code works just fine.


Sent from my iPhone using Tapatalk

yuval092 18-01-2017 11:56

Re: No Robot Code
 
wat

AustinShalit 18-01-2017 11:57

Re: No Robot Code
 
Quote:

Originally Posted by engunneer (Post 1632930)
if the comms light is red, it has no way to know if there is code or not. fix comms first!

Not quite right. Take a look at this document: http://wpilib.screenstepslive.com/s/...uick-reference

euhlmann 18-01-2017 12:05

Re: No Robot Code
 
If DriverStation doesn't show any log output and the robot program isn't running, it usually means it's crashing on initialization. To help fix the issue, you can use the debugger (right click project > debug as > wpilib deploy), or you can ssh in and do tail -f /home/lvuser/FRC_UserProgram.log to get the log output

beardo17 18-01-2017 12:07

Re: No Robot Code
 
Quote:

Originally Posted by AustinShalit (Post 1632928)
You are using static initialization. This means you do not know what order Objects are going to be created in. For example, in your DriveSubsystem on line 19 you call Robot.oi.getX(). Robot.oi is null and has not been created yet.

The easiest way to fix this is to create your robot project with RobotBuilder.

I'm not sure I quite know what you mean.. If I remove Static from it, will that fix it? (I currently don't have the robot to test on)

david.e.boles 18-01-2017 12:51

Re: No Robot Code
 
The problem AustinShalit is pointing out isn't so much the fact that your variables are static but more that you're not being careful about the way you initialize them. Robot.robotInit() gets called after object variable initialization, take a look at this:

Robot.driveSubsystem initialized:
driveSubsystem.x initialized from Robot.oi.getX()
driveSubsystem.y initialized from Robot.oi.getY() * (Robot.oi.getRTrigger() + 0.5)
other stuff...
Robot.robotInit() called:
Robot.oi initialized
See a problem here? In general though, the best way to work through these issues (besides implementing a better architecture/ conventions that prevent it from happening) is outlined in euhlmann's post.

AustinShalit 18-01-2017 13:08

Re: No Robot Code
 
Quote:

Originally Posted by david.e.boles (Post 1632964)
The problem AustinShalit is pointing out isn't so much the fact that your variables are static but more that you're not being careful about the way you initialize them. Robot.robotInit() gets called after object variable initialization, take a look at this:

Robot.driveSubsystem initialized:
driveSubsystem.x initialized from Robot.oi.getX()
driveSubsystem.y initialized from Robot.oi.getY() * (Robot.oi.getRTrigger() + 0.5)
other stuff...
Robot.robotInit() called:
Robot.oi initialized
See a problem here? In general though, the best way to work through these issues (besides implementing a better architecture/ conventions that prevent it from happening) is outlined in euhlmann's post.

Could not have said it better!

beardo17 18-01-2017 15:26

Re: No Robot Code
 
Oh Yay!!! That fixed Evereything! Thank you all!!!! :)


All times are GMT -5. The time now is 21:40.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi