View Single Post
  #4   Spotlight this post!  
Unread 20-01-2013, 20:55
kenfox kenfox is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Ann Arbor, MI
Posts: 52
kenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of light
Re: WPILib Cookbook's Example Code Doesn't Work

Quote:
Originally Posted by danielcg25 View Post
I followed all the instructions for C++ up until page 30
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.
Reply With Quote