|
Re: Command Based programming in LabVIEW?
I presented on this at championships a few years ago, but because of the roboRIO development, I didn't have a chance to implement it.
I'm work working on it again. I can explain the techniques and patterns, but it is not ready for sharing with others.
At the moment, each subsystem is built up using what I refer to it as command & control elements. The controller is the core implementation that owns actuators and sensors, maintains state, and runs at the rate appropriate to the operation being carried out on that mechanism. The commander acts as the interface to the rest of the code, being handed operation requests and set points, sending them to the controller, and notifying clients when operations complete. In some cases such as vision, a few globals are sufficient and no commander is actually needed.
It is useful to build a number of wrappers that simplify making the requests to the commander and potentially wait for completion. These wrappers can then be sequenced or run in parallel, the client can start and forget in teleOp, and can use the same command in auto but wait for completion.
I'm actually testing this out with a local team, and I agree that the simple framework that has been used doesn't offer enough structure for complex robots. I hope that we will offer both next season. Feel free to adopt any of this that makes sense, or if you find something else that works well, I'd love to hear about it.
Greg McKaskle
|