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_received_frame(frame)[source]#

Handle a received frame.

Parameters:

frame (Frame)

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_request(payload)[source]#
async run()[source]#

Launch the controller.

send_payload(destination, payload)[source]#

Sends a command in an HDLC frame over serial.

Parameters:
  • destination (int)

  • payload (Payload)

async web()[source]#

Starts the web server application.

class dotbot.controller.ControllerSettings(adapter='serial', port='/dev/ttyACM0', baudrate=1000000, mqtt_host='localhost', mqtt_port=1883, mqtt_use_tls=False, dotbot_address='FFFFFFFFFFFFFFFF', gw_address='0000000000000000', network_id='0000', controller_http_port='8000', webbrowser=False, verbose=False, log_level='info', log_output='/home/docs/checkouts/readthedocs.org/user_builds/pydotbot/checkouts/0.28.0/doc/pydotbot.log', simulator_init_state_path='simulator_init_state.toml')[source]#

Bases: object

Data class that holds controller settings.

Parameters:
  • adapter (str)

  • port (str)

  • baudrate (int)

  • mqtt_host (str)

  • mqtt_port (int)

  • mqtt_use_tls (bool)

  • dotbot_address (str)

  • gw_address (str)

  • network_id (str)

  • controller_http_port (int)

  • webbrowser (bool)

  • verbose (bool)

  • log_level (str)

  • log_output (str)

  • simulator_init_state_path (str)

adapter: str = 'serial'#
baudrate: int = 1000000#
controller_http_port: int = '8000'#
dotbot_address: str = 'FFFFFFFFFFFFFFFF'#
gw_address: str = '0000000000000000'#
log_level: str = 'info'#
log_output: str = '/home/docs/checkouts/readthedocs.org/user_builds/pydotbot/checkouts/0.28.0/doc/pydotbot.log'#
mqtt_host: str = 'localhost'#
mqtt_port: int = 1883#
mqtt_use_tls: bool = False#
network_id: str = '0000'#
port: str = '/dev/ttyACM0'#
simulator_init_state_path: str = 'simulator_init_state.toml'#
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

dotbot.controller.load_calibration()[source]#
Return type:

PayloadLh2CalibrationHomography