ActionClient

betfsm_ros.ActionClientBTFSM

Bases: Generator

__init__(name, action_name, action_type, outcomes, timeout=Duration(seconds=1.0), node=None)

Creates a TickingState that calls an action and generates an outcome when the action returns back. While waiting, it gets the response of the action to the blackboard and returns TICKING.

Parameters:
  • name (str) –

    name of the state

  • action_name (str) –

    name of the service

  • action_type (Type) –

    type of the service

  • outcomes (List[str]) –

    outcomes to be expected (TIMEOUT and TICKING will be added)

  • timeout (Duration, default: Duration(seconds=1.0) ) –

    maximum time for contacting service and processing and retrieving request. (special value: Duration(): ad infinitum)

  • node (Node | None, default: None ) –

    node, if None, BeTFSMNode.get_instance() will be used.

feedback_callback(feedback_msg)

Callback for feedback messages from the action server

Parameters:
  • feedback_msg

    feedback message from the action

fill_in_goal(blackboard)

fills in the self.action_type.Goal instance with the goal parameters of the action call

Parameters:
  • blackboard (Blackboard) –

    blackboard to be used

Returns:
  • Type

    self.action_type.Goal: goal to be used for the action call

process_result(blackboard, result)

gets the result and puts it in the blackboard (if needed) and returns an outcome

Parameters:
  • blackboard (Blackboard) –

    blackboard to be used

  • result (Result) –

    result returned by the action

Returns:
  • outcome( str ) –

    str the outcome to give back (should be final outcome, i.e. TICKING not allowed)