Go to Post Is your team sponsored by Rube Goldberg? - bdaroz [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 18-01-2017, 10:23
beardo17 beardo17 is offline
Registered User
FRC #6121
 
Join Date: Jan 2017
Location: Grayling, MI
Posts: 6
beardo17 is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2017, 10:36
question question is offline
Registered User
FRC #2472
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Minnesota
Posts: 7
question is an unknown quantity at this point
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2017, 10:43
beardo17 beardo17 is offline
Registered User
FRC #6121
 
Join Date: Jan 2017
Location: Grayling, MI
Posts: 6
beardo17 is an unknown quantity at this point
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2017, 11:52
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 144
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
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.
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 18-01-2017, 12:07
beardo17 beardo17 is offline
Registered User
FRC #6121
 
Join Date: Jan 2017
Location: Grayling, MI
Posts: 6
beardo17 is an unknown quantity at this point
Re: No Robot Code

Quote:
Originally Posted by AustinShalit View Post
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)
Reply With Quote
  #6   Spotlight this post!  
Unread 18-01-2017, 12:51
david.e.boles david.e.boles is offline
Bringer of Whales and Petunias
AKA: david476
FRC #5940 (BREAD)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2011
Location: San Francisco, CA
Posts: 30
david.e.boles is on a distinguished road
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 18-01-2017, 13:08
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 144
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: No Robot Code

Quote:
Originally Posted by david.e.boles View Post
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!
__________________
Reply With Quote
  #8   Spotlight this post!  
Unread 18-01-2017, 15:26
beardo17 beardo17 is offline
Registered User
FRC #6121
 
Join Date: Jan 2017
Location: Grayling, MI
Posts: 6
beardo17 is an unknown quantity at this point
Re: No Robot Code

Oh Yay!!! That fixed Evereything! Thank you all!!!!
Reply With Quote
  #9   Spotlight this post!  
Unread 18-01-2017, 11:54
engunneer's Avatar
engunneer engunneer is online now
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 869
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: No Robot Code

Quote:
Originally Posted by beardo17 View Post
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!
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
Reply With Quote
  #10   Spotlight this post!  
Unread 18-01-2017, 11:56
yuval092 yuval092 is offline
Registered User
FTC #11229
 
Join Date: Jan 2017
Location: israel
Posts: 1
yuval092 has a little shameless behaviour in the past
Re: No Robot Code

wat
Reply With Quote
  #11   Spotlight this post!  
Unread 18-01-2017, 11:57
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 144
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: No Robot Code

Quote:
Originally Posted by engunneer View Post
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
__________________
Reply With Quote
  #12   Spotlight this post!  
Unread 18-01-2017, 12:05
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 377
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
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
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #13   Spotlight this post!  
Unread 18-01-2017, 11:56
beardo17 beardo17 is offline
Registered User
FRC #6121
 
Join Date: Jan 2017
Location: Grayling, MI
Posts: 6
beardo17 is an unknown quantity at this point
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
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 12:58.

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