Ask Your Question
0

Using smach with nodelets

asked 2013-03-29 10:55:27 -0500

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-03-29 16:45:00 -0500

jbohren gravatar image

Yes, if you put an action server in your controller, you can set up the callbacks to control the execution of your controller. Then you can control the execution of your controller very easily with SMACH.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-03-29 10:55:27 -0500

Seen: 241 times

Last updated: Mar 29 '13