0
$\begingroup$

Rosanswers logo

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.


Originally posted by ceverett on ROS Answers with karma: 332 on 2013-03-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by jbohren with karma: 5809 on 2013-03-29

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.