simulation.src.simulation_evaluation.src.state_machine package

Subpackages

Submodules

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

Track the state of a simulated drive.

Functions:

log([logger_name])

Log the state of each state machine.

main([args])

Console-script entry point for the state machine node.

Classes:

StateMachineNode()

ROS node which tracks the state of a simulated drive.

log(logger_name: str = 'info')[source]

Log the state of each state machine.

Parameters:

logger_name – Name of the node-logger method used to emit the log message.

class StateMachineNode[source]

Bases: NodeBase

ROS node which tracks the state of a simulated drive.

info_publisher

Publish human readable states on change

zone_subscriber

Subscribes to zone of speaker

location_subscriber

Subscribes to location of speaker

events_subscriber

Subscribes to events of speaker

speed_subscriber

Subscribes to speed of speaker

set_subscribers

Subscribes to …/set

Type:

List

sm_publishers

Publishes to …/state

Type:

List

state_machines

Array of all StateMachine

Type:

List[StateMachine]

Methods:

start()

Start node.

initalize_state_machines()

Init each state machine.

_make_set_callback(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.

_make_set_callback(state_machine: StateMachine)[source]
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: State, 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

main(args=None)[source]

Console-script entry point for the state machine node.

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.