def __init__(self) -> None: self._power_boards = BoardGroup.get_board_group( PowerBoard, SRV4PowerBoardConsoleBackend, ) self.power_board = self._power_boards.singular() # Restrict to exactly one board. self.motor_boards = BoardGroup.get_board_group( MotorBoard, SRV4MotorBoardConsoleBackend, )
def __init__(self) -> None: self.power_boards = BoardGroup.get_board_group( PowerBoard, SRV4PowerBoardHardwareBackend, ) self.power_board: PowerBoard = self.power_boards.singular() self.power_board.outputs.power_on() sleep(0.2) # Give time for servo board to initialise. self.servo_boards = BoardGroup.get_board_group( ServoBoard, SRV4ServoBoardHardwareBackend, ) self.servo_board: ServoBoard = self.servo_boards.singular()
class Robot(BaseRobot): """A basic robot with a power board.""" def __init__(self): self.power_boards = BoardGroup( PowerBoard, HardwareEnvironment.get_backend(PowerBoard), ) self.power_board: PowerBoard = self.power_boards.singular()
def _init_power_board(self) -> None: self._power_boards = BoardGroup.get_board_group( PowerBoard, self._environment.get_backend(PowerBoard), ) self.power_board: PowerBoard = self._power_boards.singular() # Power on robot, so that we can find other boards. self.power_board.outputs.power_on()
def __init__(self) -> None: self._power_boards = BoardGroup.get_board_group( PowerBoard, SRV4PowerBoardConsoleBackend, ) self.power_board = self._power_boards.singular( ) # Restrict to exactly one board. # Expose just a component to the user. self.big_led = self.power_board.outputs[0]
def _init_auxilliary_boards(self) -> None: self.motor_boards = self._environment.get_board_group( MotorBoard, ) self.servo_boards = self._environment.get_board_group( ServoBoard, ) self.arduinos = self._environment.get_board_group( SBArduinoBoard, ) if ENABLE_VISION: self._cameras = BoardGroup.get_board_group( ZolotoCameraBoard, SbotCameraBackend, ) self._camera: Optional[ZolotoCameraBoard] = ( self._get_optional_board(self._cameras) )
def __init__(self) -> None: self.power_boards = BoardGroup.get_board_group( PowerBoard, SRV4PowerBoardHardwareBackend, ) self.power_board: PowerBoard = self.power_boards.singular()
def __init__(self) -> None: self.camera_boards = BoardGroup.get_board_group( ZolotoCameraBoard, ZolotoCameraBackend, ) self.camera_board: ZolotoCameraBoard = self.camera_boards.singular()
def __init__(self) -> None: self.arduinos = BoardGroup.get_board_group( Ruggeduino, SRV4RuggeduinoHardwareBackend, ) self.arduino: Ruggeduino = self.arduinos.singular()
def __init__(self) -> None: self.arduinos = BoardGroup.get_board_group( SBArduinoBoard, SBArduinoHardwareBackend, ) self.arduino: SBArduinoBoard = self.arduinos.singular()
def __init__(self): self.power_boards = BoardGroup( PowerBoard, HardwareEnvironment.get_backend(PowerBoard), ) self.power_board: PowerBoard = self.power_boards.singular()