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,
        )
Exemple #2
0
    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()
Exemple #3
0
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()
Exemple #4
0
    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()
Exemple #5
0
    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]
Exemple #6
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)
            )
Exemple #7
0
 def __init__(self) -> None:
     self.power_boards = BoardGroup.get_board_group(
         PowerBoard,
         SRV4PowerBoardHardwareBackend,
     )
     self.power_board: PowerBoard = self.power_boards.singular()
Exemple #8
0
 def __init__(self) -> None:
     self.camera_boards = BoardGroup.get_board_group(
         ZolotoCameraBoard,
         ZolotoCameraBackend,
     )
     self.camera_board: ZolotoCameraBoard = self.camera_boards.singular()
Exemple #9
0
 def __init__(self) -> None:
     self.arduinos = BoardGroup.get_board_group(
         Ruggeduino,
         SRV4RuggeduinoHardwareBackend,
     )
     self.arduino: Ruggeduino = self.arduinos.singular()
Exemple #10
0
 def __init__(self) -> None:
     self.arduinos = BoardGroup.get_board_group(
         SBArduinoBoard,
         SBArduinoHardwareBackend,
     )
     self.arduino: SBArduinoBoard = self.arduinos.singular()
Exemple #11
0
 def __init__(self):
     self.power_boards = BoardGroup(
         PowerBoard,
         HardwareEnvironment.get_backend(PowerBoard),
     )
     self.power_board: PowerBoard = self.power_boards.singular()