simulation.src.simulation_evaluation.src.state_machine package

Submodules

simulation.src.simulation_evaluation.src.state_machine.node module

Track the state of a simulated drive.

Functions:

log([logger])

Log the state of each state machine.

Classes:

StateMachineNode()

ROS node which tracks the state of a simulated drive.

log(logger: Callable[[str], None] = <function loginfo>)[source]

Log the state of each state machine.

Parameters

logger – Function to which the log message should be sent

class StateMachineNode[source]

Bases: simulation.utils.ros_base.node_base.NodeBase

ROS node which tracks the state of a simulated drive.

info_publisher

Publish human readable states on change

Type

rospy.Publisher

zone_subscriber

Subscribes to zone of speaker

Type

rospy.Subscriber

location_subscriber

Subscribes to location of speaker

Type

rospy.Subscriber

events_subscriber

Subscribes to events of speaker

Type

rospy.Subscriber

speed_subscriber

Subscribes to speed of speaker

Type

rospy.Subscriber

set_subscribers

Subscribes to …/set

Type

List[rospy.Subscriber]

sm_publishers

Publishes to …/state

Type

List[rospy.Publisher]

state_machines

Array of all StateMachine

Type

List[StateMachine]

Methods:

start()

Start node.

initalize_state_machines()

Init each state machine.

stop()

Turn off node.

on_state_machine_update()

publish_updates(*args, **kwargs)

on_msg(*args, **kwargs)

set_state_machine(new_msg, state_machine)

Update state machine manually.

start()[source]

Start node.

initalize_state_machines()[source]

Init each state machine.

Creates a list with each StateMachine in .state_machines, creates a publisher for each get topic in .sm_publishers and creates a subscriper for each set topic in .set_publishers.

stop()[source]

Turn off node.

on_state_machine_update()[source]
publish_updates(*args, **kwargs)[source]
on_msg(*args, **kwargs)[source]
set_state_machine(new_msg: simulation_evaluation.msg._State.State, state_machine: simulation.src.simulation_evaluation.src.state_machine.state_machines.state_machine.StateMachine)[source]

Update state machine manually.

Parameters
  • new_msg – Message of the state to which the state machine should be set to

  • state_machine (StateMachine) – State machine to be changed

Module contents

The StateMachineNode handels multiple state machines.

It subscribes to the speaker, parses the messages to the state machines and publishes it’s changes.