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.

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.

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.

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.

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

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

wat

Not quite right. Take a look at this document: For the 2020 season software documentation has been moved to https://docs.wpilib.org. Documentation for KOP items can still be found here. | FRC KOP Documentation

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

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)

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!

Oh Yay!!! That fixed Evereything! Thank you all!!! :slight_smile: