dev #30

Merged
Vickram merged 129 commits from dev into Vickram_dev_ 2025-10-31 00:27:54 +00:00
3 changed files with 63 additions and 3 deletions
Showing only changes of commit f3f99f4e94 - Show all commits

27
missions/Boat_mission.py Normal file
View File

@@ -0,0 +1,27 @@
from pybricks.hubs import PrimeHub
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop
from pybricks.robotics import DriveBase
from pybricks.tools import wait, StopWatch
from pybricks.tools import run_task,multitask
hub = PrimeHub()
left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE)
right_motor = Motor(Port.B)
left_arm = Motor(Port.C, Direction.COUNTERCLOCKWISE)
right_arm = Motor(Port.D)
drive_base = DriveBase(left_motor, right_motor, wheel_diameter=68.8, axle_track=180)
drive_base.settings(880,850,700,700)
drive_base.use_gyro(True)
first_run = True
async def main():
await drive_base.straight(750)
await drive_base.straight(-650)
run_task(main())

View File

@@ -0,0 +1,33 @@
from pybricks.hubs import PrimeHub
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop
from pybricks.robotics import DriveBase
from pybricks.tools import wait, StopWatch
from pybricks.tools import run_task, multitask
hub = PrimeHub()
left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE)
right_motor = Motor(Port.B)
left_arm = Motor(Port.C, Direction.COUNTERCLOCKWISE)
right_arm = Motor(Port.D)
drive_base = DriveBase(left_motor, right_motor, wheel_diameter=68.8, axle_track=180)
drive_base.settings(600,500,300,200)
drive_base.use_gyro(True)
async def main():
await drive_base.straight(200)
await drive_base.turn(-20)
await drive_base.straight(536)
await drive_base.turn(60, Stop.HOLD)
await drive_base.straight(30)
await right_arm.run_angle(5000,3000)
await drive_base.straight(40)
await right_arm.run_angle(5000,-4000)
await drive_base.straight(-60)
await drive_base.turn(-60)
await drive_base.straight(-670)
run_task(main())

View File

@@ -20,10 +20,10 @@ drive_base.use_gyro(True)
async def main():
await drive_base.straight(420)
await right_arm.run_angle(300,-100)
await drive_base.straight(500)
await right_arm.run_angle(300,100)
await drive_base.straight(-100)
await right_arm.run_angle(300, 100)
await right_arm.run_angle(300,-100)
await drive_base.straight(-350)
run_task(main())