devices.radio module

class devices.radio.IDPEmitter(name)

Bases: controller.Emitter

class devices.radio.IDPRadio(sampling_rate)

Bases: object

static decode_message(message_bytes: bytes) → dict

Decode the received bytes as a dictionary

Parameters

message_bytes (bytes) – Received bytes

Returns

The decoded dictionary

Return type

dict

dispatch_message() → None

Send the given message

This should only be called once per timestep

static encode_message(message: dict) → bytes

Encode the given dictionary into bytes by first dumping it as JSON

Parameters

message (dict) – The message to send

Returns

The encoded bytes

Return type

bytes

get_message() → dict

Get the latest received message

This can be called multiple times per timestep

Returns

The decoded received message

Return type

dict

get_other_bot_bearing() → Union[None, list]
get_other_bot_collected() → Union[None, list]
get_other_bot_position() → Union[None, list]
get_other_bot_target_pos() → Union[None, list]
get_other_bot_vertices() → Union[None, list]
send_message(message: dict) → None

Add more message to be sent

Parameters

message (dict) – The key-value pair to be appended to the message

class devices.radio.IDPReceiver(name, sampling_rate)

Bases: controller.Receiver