Command Programming
Define declarative behaviors for your robot.
The sunset framework utilizes a command framework similar to the known as command base which is used in other systems such as WPILib. This system works by building small individual commands and then composing complete actions by taking advantage of the linked-list property that these commands possess.
Modifying system state with commands
Imagine we have a Topic called PublishValue
that does nothing but publish a message which corresponds to some internal state variable.
For example's sake, lets say we want to modify what this value is using a command.
We can see this command requires us to inject an instance of PublishValue
into it for modification. This allows multiple instances of the same type to be used for different systems.
Here is an example of such a command:
Just like the other periodic like methods, it is expected you do not write blocking code which halts the main loop.
Last updated