dotbot.controller module#

Interface of the Dotbot controller.

exception dotbot.controller.ControllerException[source]#

Bases: Exception

Exception raised by Dotbot controllers.

class dotbot.controller.Controller(settings)[source]#

Bases: object

Abstract base class of specific implementations of Dotbot controllers.

Parameters:

settings (ControllerSettings) –

get_dotbots(query)[source]#

Returns the list of dotbots matching the query.

Parameters:

query (DotBotQueryModel) –

Return type:

List[DotBotModel]

handle_byte(byte)[source]#

Called on each byte received over UART.

handle_received_payload(payload)[source]#

Handle a received payload.

Parameters:

payload (ProtocolPayload) –

async notify_clients(notification)[source]#

Send a message to all clients connected.

on_command_clear_position_history(topic, _)[source]#

Called when a clear position history command is received.

on_command_move_raw(topic, payload)[source]#

Called when a move raw command is received.

on_command_rgb_led(topic, payload)[source]#

Called when an rgb led command is received.

on_command_waypoints(topic, payload)[source]#

Called when a list of waypoints is received.

on_command_xgo_action(topic, payload)[source]#

Called when an rgb led command is received.

on_lh2_add(topic, payload)[source]#

Called when an lh2 calibration point is added.

on_lh2_start(topic, _)[source]#

Called to start the lh2 calibration.

on_request(payload)[source]#
async run()[source]#

Launch the controller.

send_payload(payload)[source]#

Sends a command in an HDLC frame over serial.

Parameters:

payload (ProtocolPayload) –

async web()[source]#

Starts the web server application.

class dotbot.controller.ControllerSettings(port, baudrate, dotbot_address, gw_address, swarm_id, controller_port='8000', webbrowser=False, handshake=False, verbose=False)[source]#

Bases: object

Data class that holds controller settings.

Parameters:
  • port (str) –

  • baudrate (int) –

  • dotbot_address (str) –

  • gw_address (str) –

  • swarm_id (str) –

  • controller_port (int) –

  • webbrowser (bool) –

  • handshake (bool) –

  • verbose (bool) –

baudrate: int#
controller_port: int = '8000'#
dotbot_address: str#
gw_address: str#
handshake: bool = False#
port: str#
swarm_id: str#
verbose: bool = False#
webbrowser: bool = False#
dotbot.controller.gps_distance(last, new)[source]#

Helper function that computes the distance between 2 GPS positions in m.

Parameters:
Return type:

float

dotbot.controller.lh2_distance(last, new)[source]#

Helper function that computes the distance between 2 LH2 positions.

Parameters:
Return type:

float