How can one pass userdata into a SMACH state machine wrapped by ActionServerWrapper

asked 2019-05-22 18:56:37 -0600

aceofspade gravatar image

updated 2019-05-22 23:27:25 -0600

Hi all,

I am trying to execute a state machine via an Action Service Wrapper. I would like to pass in userdata which has multiple fields. Here's how I would typically call the state machine:

sm = Navigate()
userdata = smach.UserData()
userdata.map_loc_name = map_loc_name
sm.execute(userdata)

Here's how I'm currently using the ActionServerWrapper

asw = ActionServerWrapper(
    'navigation_state_machine', New, sm,
    ['did_something','did_something_else'], ['aborted'], ['preempted'],
    goal_key = 'map_loc_name',
    result_key = 'egad_its_a_result' )
asw.run_server()

I was wondering if anyone has suggestions on how I might pass in userdata.

Thanks!

edit retag flag offensive close merge delete

Comments

After searching, I found this: https://answers.ros.org/question/2706... which I believe answers my question. I will validate that this works on ROS Kinetic tomorrow.

aceofspade gravatar imageaceofspade ( 2019-05-23 02:03:26 -0600 )edit