Closed auscompgeek closed 1 year ago
See #21
A good motivating example could look something like the following:
class Vision: def __init__(self, name: str): self.camera = PhotonCamera(name) def execute(self): ... class Robot(MagicRobot): vision: Vision def createObjects(self): self.vision_name = 'camera'
Of course, it could also be used like this, to make things less magic:
@dataclass class Chassis: module_a: SwerveModule module_b: SwerveModule module_c: SwerveModule def __post_init__(self): ... def execute(self): ... class Robot(MagicRobot): chassis: Chassis def createObjects(self): self.chassis_module_a = SwerveModule(...) self.chassis_module_b = SwerveModule(...) self.chassis_module_c = SwerveModule(...)
See #21
A good motivating example could look something like the following:
Of course, it could also be used like this, to make things less magic: