|
Re: New version of the WPILib Cookbook posted
Thanks for this cookbook... it has helped us tremendously.
One question... in the example Command described, you get various subsystems using [Subsystem].getInstance(). In the Subsystem class there is not a static instance member, rather it is in the CommandBase. Do you recommend putting the static instance in the CommandBase or putting it in the Subsystem and writing a GetInstance() method on the Subsystem? Sample below.
public class DriveWithJoystick extends CommandBase {
Chassis m_chassis;
public DriveWithJoystick() {
m_chassis = Chassis.getInstance(); // not available...
requires(m_chassis); // reserve the chassis subsystem
}
|