Files
pybricks-api/pybricks/robotics.pyi
T
David Lechner 3a66b8e053 api: add type hints for v2
This adds PEP 561 style type hints for Pybricks v2 (just EV3).
2020-12-28 18:47:04 -06:00

35 lines
1.0 KiB
Python

# SPDX-License-Identifier: MIT
# Copyright (c) 2020 The Pybricks Authors
from typing import Optional, Tuple, overload
from ._common import Control, Motor
class DriveBase:
distance_control: Control
heading_control: Control
def __init__(
self,
left_motor: Motor,
right_motor: Motor,
wheel_diameter: int,
axle_track: int,
): ...
def drive(self, drive_speed: int, turn_rate: int) -> None: ...
def stop(self) -> None: ...
def distance(self) -> int: ...
def angle(self) -> int: ...
def state(self) -> Tuple[int, int, int, int]: ...
def reset(self) -> None: ...
@overload
def settings(self) -> Tuple[int, int, int, int]: ...
@overload
def settings(
self,
straight_speed: Optional[int],
straight_acceleration: Optional[int],
turn_rate: Optional[int],
turn_acceleration: Optional[int],
) -> None: ...
def straight(self, distance: int) -> None: ...
def turn(self, angle: int) -> None: ...