Skip to content

AMQP notifications

Manos Tsardoulias edited this page Feb 18, 2021 · 14 revisions

During the simulation, streamsim posts notifications in an AMQP broker, to be used from UIs or other upper level wrappers.

Communications

Streamsim publishes information in the following topic (where {SIMULATION_NAME} is streamsim by default):

{SIMULATION_NAME}.notifications

Dispatched information

Log messages

{
    "type": "new_message",
    "data": {
        "type": <logs>,
        "message": _ 
    }
}

Robot pose

{
  type: 'robot_pose',
  data: {
    name: _,
    x: _,
    y: _,
    theta: _,
  }
}

Detections

{
    "type": "detection",
    "data": {
        "name": _, # sensor name
        "device_type": _,
        "type": _, # detection type
        "id": id, # detection id
        "state": "end", # this means it ended
        "result": decision, # True or False
        "info": info, # Detection-specific information
        "frm": frm # from what actor or anything else the detection occured
    }
}

Sensor pose

This is used for sensors that move with pan-tilts

{
  'type': 'sensor_pose',
  'data': {
    "name": _,
    "x": _,
    "y": _,
    "theta": _
  }
}

Effectors commands

This is used when a command is given to an effector. For now we have leds/lights, speakers, humidifiers, relays, thermostats

{
    'type': 'effector_command',
    'data': {
        "name": _,
        "value": _
    }
}

Alarms

This is sent when an alarm is triggered (even when a robot is in the area alarm this is triggered only when it enters the area)

{
    'type': 'alarm',
    'data': {
        "name": self.name,
        "triggers": triggers # numbers of total triggers thus far
    }
}

RFID readers

This is sent when rfids are detected

{
    'type': 'rfid_tags',
    'data': {
        "name": self.name,
        "tags": XXX # list of tags
    }
}