dotbot.sailbot_simulator module#

Sailbot simulator for the DotBot project.

class dotbot.sailbot_simulator.Point(x, y)[source]#

Bases: object

Point class for the sailbot simulator.

Parameters:
  • x (float)

  • y (float)

x: float#
y: float#
class dotbot.sailbot_simulator.SailBotSimulator(address)[source]#

Bases: object

Simulator class for the sailbot.

advertise()[source]#

Send an advertisement message to the gateway.

control_loop_update()[source]#

Control loop for the sailbot in automatic mode.

decode_serial_input(bytes_)[source]#

Decode the serial input received from the gateway.

encode_serial_output()[source]#

Encode the sailbot data to be sent to the gateway.

simulation_update()[source]#

Updates the state-space model every SIM_DELTA_T seconds convert to radians.

property header#
class dotbot.sailbot_simulator.SailBotSimulatorCommunicationInterface(on_frame_received)[source]#

Bases: Thread

Bidirectional serial interface to control simulated robots.

Parameters:

on_frame_received (Callable)

run()[source]#

Listen continuously at each byte received on the fake serial interface.

stop()[source]#
write(bytes_)[source]#

Write bytes on the fake serial, similar to the real gateway.

class dotbot.sailbot_simulator.SailBotSimulatorLineClass(point, angle_radians)[source]#

Bases: object

Simulator zig-zag routine helper class.

Parameters:

point (Point)

distance2point(point)[source]#

Returns the distance from the point to the line.

Parameters:

point (Point)

line_side(point)[source]#

Am I on the left or the right?.

Parameters:

point (Point)

class dotbot.sailbot_simulator.SailBotSimulatorMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

Operation mode of the sailbot simulator.

AUTOMATIC = 'AUTOMATIC'#
MANUAL = 'MANUAL'#
dotbot.sailbot_simulator.cartesian2geographical(x, y)[source]#

Converts cartesian coordinates to geographical coordinates.

dotbot.sailbot_simulator.geographical2cartesian(latitude, longitude)[source]#

Converts geographical coordinates to cartesian coordinates.