Thread: Autonomous
View Single Post
  #2   Spotlight this post!  
Unread 02-15-2016, 01:51 AM
cantdecide cantdecide is offline
Registered User
FRC #5773 (YAFL Mechatronics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Turkey
Posts: 31
cantdecide is an unknown quantity at this point
Re: Autonomous

Are you changing the "auton" parameter from SmartDashboard? You need to tab away from the input box after changing its value for the changes to come through. Try putting a SmartDashboard::PutNumber right after the GetNumber in Autonomous() with a different name in order to make sure that you're reading the number correctly. Also, I'd suggest not using cout since I'm not sure if you can view console output without Riolog. Try using another SmartDashboard variable for that.

On other small flaws I can see, I suggest using a while loop that runs while the robot is autonomous and enabled around drive code instead of blindly waiting. I'm not sure if just waiting would cause any issues with the code you have right now but if your method gets more complex and requires cleanup after it's complete, you're probably going to need to switch to IterativeRobot or have a while loop. And I'm also not sure why you added a SetSafetyEnabled(false).
Reply With Quote