Exemplo n.º 1
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.

        self.motor_boards = BoardGroup.get_board_group(
            MotorBoard,
            SRV4MotorBoardConsoleBackend,
        )
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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]
Exemplo n.º 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)
            )
Exemplo n.º 7
0
 def __init__(self) -> None:
     self.power_boards = BoardGroup.get_board_group(
         PowerBoard,
         SRV4PowerBoardHardwareBackend,
     )
     self.power_board: PowerBoard = self.power_boards.singular()
Exemplo n.º 8
0
 def __init__(self) -> None:
     self.camera_boards = BoardGroup.get_board_group(
         ZolotoCameraBoard,
         ZolotoCameraBackend,
     )
     self.camera_board: ZolotoCameraBoard = self.camera_boards.singular()
Exemplo n.º 9
0
 def __init__(self) -> None:
     self.arduinos = BoardGroup.get_board_group(
         Ruggeduino,
         SRV4RuggeduinoHardwareBackend,
     )
     self.arduino: Ruggeduino = self.arduinos.singular()
Exemplo n.º 10
0
 def __init__(self) -> None:
     self.arduinos = BoardGroup.get_board_group(
         SBArduinoBoard,
         SBArduinoHardwareBackend,
     )
     self.arduino: SBArduinoBoard = self.arduinos.singular()
Exemplo n.º 11
0
 def __init__(self):
     self.power_boards = BoardGroup(
         PowerBoard,
         HardwareEnvironment.get_backend(PowerBoard),
     )
     self.power_board: PowerBoard = self.power_boards.singular()