![]() |
WPILib Cookbook's Example Code Doesn't Work
I followed all the instructions for C++ up until page 30, and when I tried to build my project it doesn't work. I'm sure I have the exact same code as is shown in the cookbook, and I get these errors.
Code:
C:/WindRiver/workspace/CommandBasedRobotTemplate_Cookbook/CommandBase.cpp:9: error: `Chassis*CommandBase::Chassis' is not a static member of `class CommandBase' |
Re: WPILib Cookbook's Example Code Doesn't Work
Disclaimer: I don't have any real experience with command/subsystem programming, so I might not be a good person to take advice from. That said...
Double-check page 27. Does your code match? Specifically, did you leave out any spaces, or get a word miscapitalized? |
Re: WPILib Cookbook's Example Code Doesn't Work
Quote:
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. |
Re: WPILib Cookbook's Example Code Doesn't Work
I think somewhere you have "Chassis" written as "chassis"... maybe. Thats what I can gather off your build console. I'd have to see your source code.
(We do not use subsystems and commands for our robots, just FYI. I find it to be messy-disgusting layers of OOP and abstractions... so if it is a command-based issue, I dont know what it would be) |
Re: WPILib Cookbook's Example Code Doesn't Work
Quote:
|
Re: WPILib Cookbook's Example Code Doesn't Work
Quote:
|
| All times are GMT -5. The time now is 18:24. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi