Merge branch 'main' of https://git.latentspace.cloud/senpai/FLL
This commit is contained in:
commit
59e420caa6
3 changed files with 23 additions and 3 deletions
|
|
@ -45,6 +45,8 @@ class Robot:
|
||||||
left: Motor
|
left: Motor
|
||||||
right: Motor
|
right: Motor
|
||||||
db: DriveBase
|
db: DriveBase
|
||||||
|
extra_L: Motor
|
||||||
|
extra_R: Motor
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|
@ -55,6 +57,10 @@ class Robot:
|
||||||
right_port: Port,
|
right_port: Port,
|
||||||
left_direction: Direction,
|
left_direction: Direction,
|
||||||
right_direction: Direction,
|
right_direction: Direction,
|
||||||
|
extra_L_port: Port,
|
||||||
|
extra_R_port: Port,
|
||||||
|
extra_L_direction: Direction,
|
||||||
|
extra_R_direction: Direction,
|
||||||
wheel_diameter: float,
|
wheel_diameter: float,
|
||||||
axle_track: int,
|
axle_track: int,
|
||||||
use_gyro: bool,
|
use_gyro: bool,
|
||||||
|
|
@ -70,6 +76,8 @@ class Robot:
|
||||||
|
|
||||||
self.left = Motor(left_port, left_direction)
|
self.left = Motor(left_port, left_direction)
|
||||||
self.right = Motor(right_port, right_direction)
|
self.right = Motor(right_port, right_direction)
|
||||||
|
self.extra_L = Motor(extra_L_port, extra_L_direction)
|
||||||
|
self.extra_R = Motor(extra_R_port, extra_R_direction)
|
||||||
|
|
||||||
self.db = DriveBase(
|
self.db = DriveBase(
|
||||||
self.left,
|
self.left,
|
||||||
|
|
|
||||||
12
robots.py
12
robots.py
|
|
@ -34,6 +34,10 @@ leorobot = LazyRobot(
|
||||||
turn_rate=DEFAULT_TURN_RATE,
|
turn_rate=DEFAULT_TURN_RATE,
|
||||||
turn_acceleration=DEFAULT_TURN_ACCELERATION,
|
turn_acceleration=DEFAULT_TURN_ACCELERATION,
|
||||||
settle_ms=DEFAULT_GYRO_SETTLE_MS,
|
settle_ms=DEFAULT_GYRO_SETTLE_MS,
|
||||||
|
extra_R_port=Port.E,
|
||||||
|
extra_R_direction=Direction.CLOCKWISE,
|
||||||
|
extra_L_port=Port.D,
|
||||||
|
extra_L_direction=Direction.CLOCKWISE,
|
||||||
)
|
)
|
||||||
|
|
||||||
cbrobot = LazyRobot(
|
cbrobot = LazyRobot(
|
||||||
|
|
@ -52,6 +56,10 @@ cbrobot = LazyRobot(
|
||||||
turn_rate=DEFAULT_TURN_RATE,
|
turn_rate=DEFAULT_TURN_RATE,
|
||||||
turn_acceleration=DEFAULT_TURN_ACCELERATION,
|
turn_acceleration=DEFAULT_TURN_ACCELERATION,
|
||||||
settle_ms=DEFAULT_GYRO_SETTLE_MS,
|
settle_ms=DEFAULT_GYRO_SETTLE_MS,
|
||||||
|
extra_R_port=Port.E,
|
||||||
|
extra_R_direction=Direction.CLOCKWISE,
|
||||||
|
extra_L_port=Port.D,
|
||||||
|
extra_L_direction=Direction.CLOCKWISE,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -71,4 +79,8 @@ giorobot = LazyRobot(
|
||||||
turn_rate=DEFAULT_TURN_RATE,
|
turn_rate=DEFAULT_TURN_RATE,
|
||||||
turn_acceleration=DEFAULT_TURN_ACCELERATION,
|
turn_acceleration=DEFAULT_TURN_ACCELERATION,
|
||||||
settle_ms=DEFAULT_GYRO_SETTLE_MS,
|
settle_ms=DEFAULT_GYRO_SETTLE_MS,
|
||||||
|
extra_R_port=Port.E,
|
||||||
|
extra_R_direction=Direction.CLOCKWISE,
|
||||||
|
extra_L_port=Port.D,
|
||||||
|
extra_L_direction=Direction.CLOCKWISE,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,14 @@ from pybricks.robotics import DriveBase
|
||||||
from assi import A
|
from assi import A
|
||||||
from robot_class import LazyRobot, Robot
|
from robot_class import LazyRobot, Robot
|
||||||
|
|
||||||
msu_R = Motor(Port.E)
|
|
||||||
msu_L = Motor(Port.D)
|
|
||||||
|
|
||||||
|
|
||||||
def main(robot: LazyRobot):
|
def main(robot: LazyRobot):
|
||||||
hub = robot.hub
|
hub = robot.hub
|
||||||
db = robot.db
|
db = robot.db
|
||||||
|
|
||||||
|
msu_R = robot.extra_R
|
||||||
|
msu_L = robot.extra_L
|
||||||
|
|
||||||
db.settings(864, 300, 100, 50)
|
db.settings(864, 300, 100, 50)
|
||||||
|
|
||||||
db.straight(610) # mission 1
|
db.straight(610) # mission 1
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue