yasmin_viewer.yasmin_viewer_pub module
- class yasmin_viewer.yasmin_viewer_pub.YasminViewerPub(fsm: yasmin.StateMachine, fsm_name: str = '', rate: int = 4, node: rclpy.node.Node = None)
Bases:
objectA class to publish the state of a Finite State Machine (FSM) for visualization.
- cleanup() None
Cleans up resources used by the YasminViewerPub instance.
- parse_concurrence_transitions(concurrence: yasmin.Concurrence) Dict[str, Dict[str, str]]
Converts a concurrence outcome map into transition-like information for visualization.
In concurrence, transitions are based on outcome combinations rather than direct state-to-state transitions. This method creates pseudo-transitions that represent the outcome mapping logic.
- Args:
concurrence (Concurrence): The concurrence state to parse transitions from.
- Returns:
List[TransitionMsg]: A list of TransitionMsg representing the concurrence outcome mappings.
- parse_state(state_name: str, state_info: Dict[str, Any], states_list: List[yasmin_msgs.msg.State], parent: int = -1) None
Recursively parses a state and its transitions, adding the resulting StateMsg to the states list.
- Args:
state_name (str): The name of the state. state_info (Dict[str, str]): Information about the state, including its transitions. states_list (List[StateMsg]): A list to which the parsed StateMsg will be appended. parent (int, optional): The ID of the parent state. Defaults to -1.
- Returns:
None
- parse_transitions(transitions: Dict[str, str]) List[yasmin_msgs.msg.Transition]
Converts a dictionary of transitions into a list of TransitionMsg.
- Args:
transitions (Dict[str, str]): A dictionary where keys are outcome names and values are state names.
- Returns:
List[TransitionMsg]: A list of TransitionMsg representing the FSM transitions.