Compare commits
5 Commits
2d614c0e38
...
80d6300fc0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80d6300fc0 | ||
|
|
b25a2a5feb | ||
| 6e82f4d476 | |||
| 7e1d310e24 | |||
| 37b025088f |
@@ -142,6 +142,18 @@ async def Run4(): # From Send_Over_Final.py
|
|||||||
|
|
||||||
# Add Rishi's code here
|
# Add Rishi's code here
|
||||||
async def Run5():
|
async def Run5():
|
||||||
|
<<<<<<< HEAD
|
||||||
|
await drive_base.straight(600)
|
||||||
|
await drive_base.straight(-100)
|
||||||
|
await drive_base.straight(150)
|
||||||
|
await drive_base.turn(60)
|
||||||
|
await drive_base.straight(100)
|
||||||
|
await drive_base.turn(-86)
|
||||||
|
await drive_base.straight(120)
|
||||||
|
await drive_base.turn(-45)
|
||||||
|
await drive_base.straight(-200)
|
||||||
|
await drive_base.turn(75)
|
||||||
|
=======
|
||||||
await drive_base.straight(700)
|
await drive_base.straight(700)
|
||||||
await drive_base.turn(-20)
|
await drive_base.turn(-20)
|
||||||
await drive_base.straight(110)
|
await drive_base.straight(110)
|
||||||
@@ -152,6 +164,7 @@ async def Run5():
|
|||||||
await drive_base.straight(84)
|
await drive_base.straight(84)
|
||||||
await right_arm.run_angle(300, 1200)
|
await right_arm.run_angle(300, 1200)
|
||||||
await drive_base.straight(-875)
|
await drive_base.straight(-875)
|
||||||
|
>>>>>>> 2d614c0e381ebefc99efa272a3ec8ee172c5f6ce
|
||||||
|
|
||||||
# Add - Adi's code here
|
# Add - Adi's code here
|
||||||
async def Run6():
|
async def Run6():
|
||||||
|
|||||||
38
missions/New_MapReveal/New_MapReveal_Mineshaft.py
Normal file
38
missions/New_MapReveal/New_MapReveal_Mineshaft.py
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor
|
||||||
|
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop
|
||||||
|
from pybricks.tools import run_task, multitask
|
||||||
|
from pybricks.tools import wait, StopWatch
|
||||||
|
from pybricks.robotics import DriveBase
|
||||||
|
from pybricks.hubs import PrimeHub
|
||||||
|
|
||||||
|
# Initialize hub and devices
|
||||||
|
hub = PrimeHub()
|
||||||
|
left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE)
|
||||||
|
right_motor = Motor(Port.B)
|
||||||
|
left_arm = Motor(Port.C)
|
||||||
|
right_arm = Motor(Port.D)
|
||||||
|
lazer_ranger = UltrasonicSensor(Port.E)
|
||||||
|
color_sensor = ColorSensor(Port.F)
|
||||||
|
|
||||||
|
# DriveBase configuration
|
||||||
|
WHEEL_DIAMETER = 68.8 # mm (adjust for your wheels)
|
||||||
|
AXLE_TRACK = 180 # mm (distance between wheels)
|
||||||
|
drive_base = DriveBase(left_motor, right_motor, WHEEL_DIAMETER, AXLE_TRACK)
|
||||||
|
drive_base.settings(600, 500, 300, 200)
|
||||||
|
drive_base.use_gyro(True)
|
||||||
|
|
||||||
|
WALL_DISTANCE = 200 # mm
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
await drive_base.straight(700)
|
||||||
|
await drive_base.turn(-20)
|
||||||
|
await drive_base.straight(110)
|
||||||
|
await drive_base.straight(-220)
|
||||||
|
await drive_base.turn(63)
|
||||||
|
await drive_base.straight(130)
|
||||||
|
await right_arm.run_angle(1000, -1200)
|
||||||
|
await drive_base.straight(84)
|
||||||
|
await right_arm.run_angle(300, 1200)
|
||||||
|
await drive_base.straight(-875)
|
||||||
|
|
||||||
|
run_task(main())
|
||||||
Reference in New Issue
Block a user