Thread: No Robot Code
View Single Post
  #12   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: 152
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