View Single Post
  #6   Spotlight this post!  
Unread 20-01-2013, 22:57
danielcg25 danielcg25 is offline
Registered User
FRC #0706
 
Join Date: Jan 2013
Location: Milwaukee, WI
Posts: 7
danielcg25 is an unknown quantity at this point
Re: WPILib Cookbook's Example Code Doesn't Work

Quote:
Originally Posted by kenfox View Post
If you are using the cookbook from 2012, there are a few things that changed. I think http://wpilib.screenstepslive.com/s/3120 will eventually have all the content of the old documentation, but until then you have to pick through the old examples and watch for changes.

In your case it sounds like you have a chassis subsystem. The old way of handling that was to put all subsystems into the CommandBase class so all commands have easy access to subsystems. That's not a good design.

The 2013 approach is better. Put your subsystems into the Robot class and in your commands refer to Robot::chassis. If you use Robot Builder it follows this convention.

Since you are new to the command-based robot approach, you definitely should experiment with Robot Builder and carefully read the code it generates. It's quite good. Even if you decide not to use Robot Builder, you'll probably adopt a lot of what you learn from reading that code.
I do have a Chassis subsystem; I'll look into the 2013 documentation instead now. Thanks.
Reply With Quote