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