Rules for Good SMACC Programming

Rule: State Reactors need to input events to output events. Why? Because we are an event driven library. You want a new event? Use a Client or a Client Behavior.

Rule: State Reactors can throw events, but should not be used to set parameters (That are outside the State Reactor). Why? Because the system becomes Non-deterministic.

Rule: Callback functions should be placed in a Client Behavior (or Client), as opposed to being member functions of the State. The reason for this is that usually a callback is tied to an incoming message/service/action that enters into the ROS queue, but when that message/service/action finally comes in, the State containing the callback function may have already advanced to the next function or have vanished, leading to all sorts of difficult to diagnose issues.

Always looking for additions to this list. Please send in your suggestions to brett@reelrobotix.com