Using smach with nodelets
Hello,
I am interested in using smach to manage my behavioral/control states. I have a C++ nodelet that I have written to perform low level control/navigation. Currently the nodelet, in its onInit() method launches a thread which performs the control.
I would like to treat this as a behavioral state that I can turn on and off. Is it possible to integrate this into smach as a state? If so, how would you do this, perhaps by implementing the nodelet as an Action server?
In summary, I would like to have smach use my "controller" C++ nodelet as one of its states. The reason that I have implemented this as a nodelet is that it sends low-level control command messages to the autopilot process, also a nodelet (this would run on a UAV), and I want the messages to be passed efficiently. I would like to have this state that is the low-level control for following a specific trajectory, another for hovering, returning home, etc.
An alternative is to use a custom state machine that simply sends "active state" messages to each nodelet that should be running.
Any input is appreciated.