src.brains package

Submodules

src.brains.autonomous module

class src.brains.autonomous.Brain(config: Config, *arg)[source]

Bases: Brain

The autonomous Brain object, drives the vehicle autonomously based on information gathered by the sensors

logic()[source]

If anything is detected by the distance_sensors, stop the car

class src.brains.autonomous.Config[source]

Bases: Config

sample_hz: int

src.brains.base module

class src.brains.base.Brain(config: Config, camera: Camera, distance_sensors: list[DistanceSensor], leds: list[LED], switches: list[Switch], vehicle: Vehicle)[source]

Bases: object

The base Brain object, which all other Brains should inherit

camera: Camera
distance_sensors: list[DistanceSensor]
leds: list[LED]
logic()[source]

Process sensor data, tell the vehicle how to drive

loop_counter: int
run()[source]

The main loop of the Brain class. While running, and the switch is one, gather data from sensors and perform brain logic

running: bool
sample_hz: int
switches: list[Switch]
vehicle: Vehicle
class src.brains.base.Config[source]

Bases: TypedDict

sample_hz: int

src.brains.human_driver module

class src.brains.human_driver.Brain(config: Config, *arg)[source]

Bases: Brain

The human_driver Brain object, allows for users to control the vehicle with the keyboard. Not autonomous.

static get_input(timeout: float = None) str[source]

Get real-time key input from user

logic()[source]

Process sensor data, tell the vehicle how to drive

class src.brains.human_driver.Config[source]

Bases: Config

sample_hz: int

Module contents

class src.brains.ModuleTypes[source]

Bases: TypedDict

autonomous: module
base: module
human_driver: module