52 Commits

Author SHA1 Message Date
f1ca63bad2 Merge pull request 'cleanup folder structure' (#8) from dev into main
Reviewed-on: #8
2026-10-12 16:39:42 +00:00
514bb91f7b cleanup folder structure 2026-10-12 11:38:27 -05:00
466657022a Merge branch 'dev' 2026-10-12 11:35:41 -05:00
f4cfa3e8f4 resolving 2026-10-12 11:28:46 -05:00
0c3b2e1053 Update discovery-phase/missions/Showcase_codes.py 2026-10-12 11:28:46 -05:00
cc1643f9e8 resolving again 2026-10-12 11:28:43 -05:00
47a5a8445b resolving 2026-10-12 11:27:31 -05:00
e53e367751 Update discovery-phase/missions/mission_experimental_stalinus.py 2026-10-12 11:26:27 -05:00
13a24e17ad Update discovery-phase/missions/mission_experimental_hirohitus.py 2026-10-12 11:26:27 -05:00
bda38fab1c Add discovery-phase/missions/Exploding Seeds 2026-10-12 11:26:27 -05:00
275c73382c resolving 2026-10-12 11:26:22 -05:00
72ffdf2172 Update discovery-phase/missions/Showcase_codes.py 2026-10-12 11:25:38 -05:00
1a94799e5a Update discovery-phase/missions/Showcase_codes.py 2026-10-12 11:25:12 -05:00
99080ce07e resolving 2026-10-12 11:24:00 -05:00
75013f1039 Update discovery-phase/missions/Mission 11, 6+More-Rishabh 2026-10-12 11:23:40 -05:00
f2a0d940e0 Update discovery-phase/missions/Showcase_codes.py 2026-10-12 11:23:40 -05:00
ff561e51a0 Update discovery-phase/missions/Showcase_codes.py 2026-10-12 11:19:00 -05:00
0cd478fde1 resolving 2026-10-12 11:15:42 -05:00
2888d96d30 Cleaning up main branh 2026-10-12 11:14:51 -05:00
d444fb97c5 Add Mission 3, 4, & 5 2026-10-12 11:14:50 -05:00
a9d3cd971e Update discovery-phase/missions/Showcase_codes.py 2026-10-11 23:57:01 +00:00
e608f7ea1f Update discovery-phase/missions/mission_experimental_stalinus.py 2026-10-11 22:21:31 +00:00
f3041b0483 Update discovery-phase/missions/mission_experimental_hirohitus.py 2026-10-11 22:21:06 +00:00
83363ed0c4 Add discovery-phase/missions/Exploding Seeds 2026-10-09 20:43:02 +00:00
c15d8f0fd6 Update discovery-phase/missions/Showcase_codes.py 2026-10-07 02:02:12 +00:00
788745f4f4 Update discovery-phase/missions/Showcase_codes.py 2026-10-02 21:52:26 +00:00
a60078d89d Update discovery-phase/missions/Showcase_codes.py 2026-10-02 21:29:41 +00:00
0e1e580fb0 Update discovery-phase/missions/Showcase_codes.py 2026-10-02 21:07:59 +00:00
98b987fe71 Update discovery-phase/missions/Mission 11, 6+More-Rishabh 2026-09-30 00:59:14 +00:00
19912d759e Update discovery-phase/missions/Showcase_codes.py 2026-09-28 12:43:43 +00:00
e9b42189b0 Add discovery-phase/missions/Mission 1-Rishabh 2026-09-27 23:30:23 +00:00
b1783a2fce Update discovery-phase/missions/Mission 11, 6+More-Rishabh 2026-09-27 23:29:44 +00:00
57844e8b1a Add discovery-phase/missions/Mission 3, 4, 5 - Rishabh 2026-09-27 23:29:13 +00:00
74b363f97e Add discovery-phase/missions/Mission 11, 6+More 2026-09-27 23:28:22 +00:00
e332b0c324 Update discovery-phase/missions/Showcase_codes.py 2026-09-27 04:15:25 +00:00
64a296a84e Update discovery-phase/missions/Showcase_codes.py 2026-09-27 04:12:58 +00:00
de8a3455b0 Add discovery-phase/missions/drone survey.py 2026-09-22 23:56:31 +00:00
3fcbb79439 Add discovery-phase/missions/Showcase_codes.py 2026-09-22 20:58:48 +00:00
8c7bec48ff Update discovery-phase/missions/mission_experimental_stalinus.py 2026-09-21 04:23:15 +00:00
ad69b7560d Update discovery-phase/missions/mission_experimental_hirohitus.py 2026-09-21 04:22:59 +00:00
9125c0b4aa Update discovery-phase/missions 3, 4, 5/Mission 3, 4, & 5.py 2026-09-21 04:20:37 +00:00
54b58c64c3 Update discovery-phase/missions/mission 3_4_5_johannes.py 2026-09-21 04:19:47 +00:00
4c9b7607f6 Add discovery-phase/missions/mission_experimental_johannes_2.py 2026-09-21 04:19:29 +00:00
d8bf319fdf Add discovery-phase/missions/mission_experimental_johannes.py 2026-09-21 04:18:59 +00:00
99826dad19 Add discovery-phase/missions/mission_1_johannes.py 2026-09-21 04:17:55 +00:00
ddbc8a6390 Add discovery-phase/missions/mission_2_johannes.py 2026-09-21 04:17:23 +00:00
4748e17030 Add discovery-phase/missions/Mission 3_4_5 Johannes.py 2026-09-21 04:16:18 +00:00
1ffcfceae7 Add discovery-phase/missions/mission_15_Parthiv.py 2026-09-20 23:19:09 +00:00
b31f815876 Add discovery-phase/missions/mission_9.py 2026-09-20 22:17:05 +00:00
3fee5ba45c Upload files to "discovery-phase/missions 3, 4, 5" 2026-09-20 22:11:53 +00:00
37aa0e9037 added discovery phase folder 2026-09-20 15:45:48 -05:00
08fa18fc72 folder structure commit 2026-09-20 14:56:22 -05:00
5 changed files with 378 additions and 100 deletions

View File

@@ -1,11 +1,8 @@
#SETTING UP from pybricks.hubs import PrimeHub
import umath
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop 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.robotics import DriveBase
from pybricks.hubs import PrimeHub from pybricks.tools import wait, StopWatch
# Initialize hub and devices # Initialize hub and devices
hub = PrimeHub() hub = PrimeHub()
@@ -17,26 +14,22 @@ lazer_ranger = UltrasonicSensor(Port.E)
color_sensor = ColorSensor(Port.F) color_sensor = ColorSensor(Port.F)
# DriveBase configuration # DriveBase configuration
WHEEL_DIAMETER = 68.8 # mm (adjust for your wheels) WHEEL_DIAMETER = 62.4 # mm (adjust for your wheels)
AXLE_TRACK = 180 # mm (distance between wheels) AXLE_TRACK = 150 # mm (distance between wheels)
drive_base = DriveBase(left_motor, right_motor, WHEEL_DIAMETER, AXLE_TRACK) drive_base = DriveBase(left_motor, right_motor, WHEEL_DIAMETER, AXLE_TRACK)
drive_base.settings(600, 450, 300, 200) drive_base.settings(600, 500, 300, 200)
drive_base.use_gyro(True) drive_base.use_gyro(True)
#Run def set_default_speed():
drive_base.straight(550)#Works (600(Previous)) drive_base.settings(600, 500, 300, 200)
drive_base.straight(-200)
drive_base.turn(45)
drive_base.straight(575)
drive_base.turn(-90)#-90 for Coach Cisco table
left_arm.run_angle(200,270)
drive_base.straight(300)
left_arm.run_angle(200,-265)
right_arm.run_angle(200, -200)
drive_base.straight(-105)#Use -105 for Coach Cisco table(-105 for school)
drive_base.turn(32)#was 24-Use 24 for Coach Cisco's table(32 for school)
right_arm.run_angle(1500, 180)
drive_base.turn(30)
drive_base.straight(-1000)
def set_speed(straight_speed, st_acc, turn_speed, turn_acc):
drive_base.settings(straight_speed, st_acc, turn_speed, turn_acc)
left_arm.run_angle(300,100)
drive_base.arc(150,None,115)
drive_base.straight(270)
left_arm.run_angle(300,-90)
drive_base.straight(-80)
left_arm.run_angle(300,-100)
drive_base.arc(-1000,None,-800)

View File

@@ -31,30 +31,31 @@ def set_speed(straight_speed, st_acc, turn_speed, turn_acc):
#Run code #Run code
drive_base.straight(50)#Was 50 drive_base.straight(50)#Was 50
drive_base.turn(-43.75)#42 Mostly works drive_base.turn(-49)#42 Mostly works
drive_base.straight(735)#Was 750 drive_base.straight(700)#Was 735
#left_arm.run_angle(1500,-100)#Was 1000,And was -30 #left_arm.run_angle(1500,-100)#Was 1000,And was -30
#wait(1000) #wait(1000)
#drive_base.straight(330) #drive_base.straight(330)
drive_base.turn(80)#Was 80 drive_base.turn(40)#Was 80
set_speed(100,300,300,200) set_speed(100,300,300,200)
drive_base.straight(350)#Was 400 drive_base.straight(100)
drive_base.turn(47)#Was 37
drive_base.straight(320)#Was 300-350
drive_base.straight(-110)#Was -125 drive_base.straight(-110)#Was -125
set_default_speed set_default_speed
drive_base.turn(87)#Was 90 drive_base.turn(85)#Was 87
#right_arm.run_angle(1000, -30)#Was -47 #right_arm.run_angle(1000, -30)#Was -47
drive_base.straight(100) drive_base.straight(50)#150
drive_base.turn(-70) drive_base.turn(-67)#Was -73
left_arm.run_angle(1000,180) print("Mycellium")
drive_base.straight(55) left_arm.run_angle(1000,180)#Towards Mycellium
drive_base.turn(-30)#Was Positive 30 drive_base.straight(75)#Was 75
#left_arm.run_angle(2000,-180) drive_base.turn(-10)#Was Positive 30
drive_base.straight(-20) drive_base.straight(3)
drive_base.straight(-200) set_speed(1000,300,300,200)
drive_base.turn(120) left_arm.run_angle(102020,-180)
#Going back drive_base.turn(70)#Orignal 120
drive_base.straight(700) drive_base.straight(300)

View File

@@ -15,8 +15,8 @@ Improvements over baseline:
from pybricks.tools import StopWatch, wait from pybricks.tools import StopWatch, wait
import umath import umath
WHEEL_DIAMETER = 68.8 # mm — adjust to your wheel (Done) WHEEL_DIAMETER = 62.4 # mm — adjust to your wheel (Done)
AXLE_TRACK = 180 # mm — used only if you add turning later (Done) AXLE_TRACK = 150 # mm — used only if you add turning later (Done)
LOOP_MS = 20 # fixed control loop period LOOP_MS = 20 # fixed control loop period
RAMP_MM = 50 # begin decelerating this far from target RAMP_MM = 50 # begin decelerating this far from target
MIN_SPEED = 80 # floor speed during ramp (avoid stall) MIN_SPEED = 80 # floor speed during ramp (avoid stall)
@@ -202,8 +202,16 @@ async def multilift_down(rotation_angle):
) )
<<<<<<< HEAD
async def Run1(): # Flip The Rock, Lucky Leaves, Reaching Roots - Parthiv
=======
<<<<<<< HEAD
async def Run1(): # Flip The Rock, Lucky Leaves, Reaching Roots - Johannes async def Run1(): # Flip The Rock, Lucky Leaves, Reaching Roots - Johannes
>>>>>>> 3cd1849 (Update discovery-phase/missions/Showcase_codes.py)
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
await set_speed(600,200,300,200) await set_speed(600,200,300,200)
await drive_base.straight(500) await drive_base.straight(500)
await multitask( await multitask(
@@ -230,8 +238,8 @@ async def Run1(): # Flip The Rock, Lucky Leaves, Reaching Roots - Johannes
async def Run2(): # Exploding Seeds - Johannes async def Run2(): # Exploding Seeds - Johannes
await multitask( await multitask(
right_arm.run_angle(400,-100) right_arm.run_angle(400,-100),
left_arm.run_angle(300,100) left_arm.run_angle(300,100),
drive_base.arc(150,None,115) drive_base.arc(150,None,115)
) )
await drive_base.straight(270) await drive_base.straight(270)
@@ -263,7 +271,7 @@ async def Run2_1(): # Drone Survey, Experimental - Johannes
async def Run3(): # Window to the Past, Leaf Cutter, Humongous Fungus, Experimental - Johannes async def Run3(): # Window to the Past, Leaf Cutter, Humongous Fungus, Experimental - Johannes
await drive_base.straight(110) await drive_base.straight(98)
await drive_base.turn(-45) await drive_base.turn(-45)
await drive_base.straight(300) await drive_base.straight(300)
await right_arm.run_angle(300,120) await right_arm.run_angle(300,120)
@@ -272,19 +280,44 @@ async def Run3(): # Window to the Past, Leaf Cutter, Humongous Fungus, Experimen
await drive_base.straight(250) await drive_base.straight(250)
await drive_base.turn(40) await drive_base.turn(40)
set_speed(100,200,300,200) set_speed(100,200,300,200)
<<<<<<< HEAD
await drive_base.straight(170) await drive_base.straight(170)
<<<<<<< HEAD
await drive_base.straight(-145) await drive_base.straight(-145)
await drive_base.turn(80) await drive_base.turn(80)
await drive_base.straight(230) await drive_base.straight(230)
set_speed(600, 500, 300, 200) set_speed(600, 500, 300, 200)
await drive_base.straight(-138) await drive_base.straight(-138)
=======
await drive_base.straight(-135)
await drive_base.turn(80)
await drive_base.straight(230)
set_speed(600, 500, 300, 200)
await drive_base.straight(-145)
>>>>>>> 0e1e580 (Update discovery-phase/missions/Showcase_codes.py)
=======
await drive_base.straight(177)
await drive_base.straight(-145)
await drive_base.turn(85)
await drive_base.straight(232)
set_speed(600, 500, 300, 200)
await drive_base.straight(-138)
>>>>>>> 788745f (Update discovery-phase/missions/Showcase_codes.py)
await multitask( await multitask(
drive_base.turn(-36), drive_base.turn(-36),
right_arm.run_angle(200,-140) right_arm.run_angle(200,-140)
) )
set_speed(100,200,300,200) set_speed(100,200,300,200)
await drive_base.straight(230) await drive_base.straight(230)
<<<<<<< HEAD
<<<<<<< HEAD
await right_arm.run_angle(300,105) await right_arm.run_angle(300,105)
=======
await right_arm.run_angle(300,160)
>>>>>>> 0e1e580 (Update discovery-phase/missions/Showcase_codes.py)
=======
await right_arm.run_angle(300,105)
>>>>>>> 788745f (Update discovery-phase/missions/Showcase_codes.py)
await wait(200) await wait(200)
await drive_base.turn(-90) await drive_base.turn(-90)
await drive_base.straight(-170) await drive_base.straight(-170)
@@ -296,43 +329,280 @@ async def Run3(): # Window to the Past, Leaf Cutter, Humongous Fungus, Experimen
async def Run4(): #Flip the Rock, Lucky Leaves, Reaching Roots - Rishabh async def Run4(): #Flip the Rock, Lucky Leaves, Reaching Roots - Rishabh
#Run #Run
=======
>>>>>>> c15d8f0 (Update discovery-phase/missions/Showcase_codes.py)
await drive_base.straight(550)#Works (600(Previous)) await drive_base.straight(550)#Works (600(Previous))
await drive_base.straight(-200) await drive_base.straight(-200)
=======
await drive_base.straight(415)
await drive_base.straight(-150)
>>>>>>> a9d3cd9 (Update discovery-phase/missions/Showcase_codes.py)
=======
await drive_base.straight(415)
await drive_base.straight(-150)
>>>>>>> dev
await drive_base.turn(45) await drive_base.turn(45)
await drive_base.straight(575) await drive_base.straight(600)
await drive_base.turn(-90)#-90 for Coach Cisco table await drive_base.turn(-90)
await left_arm.run_angle(200,270) await multitask(
left_arm.run_angle(200,300),
right_arm.run_angle(200,-290)
)
set_speed(100,500,300,200)
await drive_base.straight(300) await drive_base.straight(300)
await left_arm.run_angle(200,-265) await left_arm.run_angle(200,-300)
await right_arm.run_angle(200, -200) await drive_base.straight(-95)
await drive_base.straight(-105)#Use -105 for Coach Cisco table(-105 for school) await drive_base.turn(22)
await drive_base.turn(32)#was 24-Use 24 for Coach Cisco's table(32 for school) await right_arm.run_angle(5000,100)
await right_arm.run_angle(1500, 180) await drive_base.straight(90)
await drive_base.turn(30) set_speed(700,500,300,200)
await drive_base.straight(-1000) await drive_base.arc(-700,angle=-150)
<<<<<<< HEAD
<<<<<<< HEAD
async def Run11(): # Interchangable Mission - Parthiv async def Run11(): # Interchangable Mission - Parthiv
=======
=======
>>>>>>> dev
async def Run2(): # Exploding Seeds - Johannes
await multitask(
right_arm.run_angle(400,-100),
drive_base.arc(150,None,115),
)
await drive_base.straight(270)
await left_arm.run_angle(300,-80)
await drive_base.straight(-100)
await left_arm.run_angle(300,-100)
await drive_base.arc(-1000,None,-800)
async def Run3(): # Drone Survey - Johannes
await multitask(
left_arm.run_angle(400,-300),
right_arm.run_angle(400,100),
drive_base.straight(900)
)
await drive_base.turn(-25)
await drive_base.straight(110)
await drive_base.turn(-35)
await drive_base.turn(35)
await drive_base.straight(-30)
await drive_base.turn(25)
await drive_base.straight(-200)
await drive_base.turn(-45)
await drive_base.straight(500)
await drive_base.turn(75)
await drive_base.straight(700)
async def Run4(): # Window to the Past, Leaf Cutter, Humongous Fungus, Experimental - Johannes
await drive_base.straight(110)
await drive_base.turn(-45)
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> dev
await drive_base.straight(280)
=======
await drive_base.straight(300)
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
await right_arm.run_angle(300,120)
await left_arm.run_angle(400,200)
await drive_base.straight(-70)
await left_arm.run_angle(600,-110)
await drive_base.straight(370)
await drive_base.turn(50)
<<<<<<< HEAD
await multitask(
drive_base.straight(250),
left_arm.run_angle(600,-60)
)
await drive_base.turn(40)
set_speed(100,200,300,200)
await drive_base.straight(170)
await drive_base.straight(-135)
await drive_base.turn(80)
await drive_base.straight(85)
=======
await drive_base.straight(250)
await drive_base.turn(40)
set_speed(100,200,300,200)
await drive_base.straight(170)
<<<<<<< HEAD
=======
await drive_base.straight(300)
await right_arm.run_angle(300,120)
await drive_base.straight(290)
await drive_base.turn(50)
await drive_base.straight(250)
await drive_base.turn(40)
set_speed(100,200,300,200)
await drive_base.straight(170)
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
=======
>>>>>>> dev
await drive_base.straight(-145)
await drive_base.turn(80)
await drive_base.straight(230)
set_speed(600, 500, 300, 200)
await drive_base.straight(-138)
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
=======
=======
>>>>>>> dev
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
await multitask(
drive_base.turn(-36),
right_arm.run_angle(200,-140)
)
set_speed(100,200,300,200)
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> dev
await drive_base.straight(235)
await multitask(
right_arm.run_angle(300,100),
left_arm.run_angle(200,140)
)
await wait(200)
await drive_base.straight(30)
=======
await drive_base.straight(230)
await right_arm.run_angle(300,105)
await wait(200)
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
<<<<<<< HEAD
=======
await drive_base.straight(230)
await right_arm.run_angle(300,105)
await wait(200)
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
=======
>>>>>>> dev
await drive_base.turn(-90)
await drive_base.straight(-170)
set_speed(600,500,300,200)
await drive_base.straight(100)
await drive_base.arc(800,None,-900)
async def Run5(): # Forest Elder - Parthiv
await drive_base.straight(475)
await right_arm.run_angle(300,25)
await drive_base.turn(-20)
await left_arm.run_angle(200,245)
await drive_base.straight(60)
await drive_base.turn(25)
await left_arm.run_angle(100,-56.5)
await drive_base.straight(-50)
await drive_base.straight(50)
await drive_base.turn(-25)
await left_arm.run_angle(200,-200)
await drive_base.straight(-240)
await drive_base.turn(15)
await right_arm.run_angle(200,-200)
await drive_base.straight(-200)
<<<<<<< HEAD
await drive_base.stop
=======
=======
async def Run1(): # Flip The Rock, Lucky Leaves, Reaching Roots - Parthiv
await drive_base.straight(415)
await drive_base.straight(-150)
>>>>>>> a9d3cd9 (Update discovery-phase/missions/Showcase_codes.py)
await drive_base.turn(45)
await drive_base.straight(600)
await drive_base.turn(-90)
await multitask(
left_arm.run_angle(200,300),
right_arm.run_angle(200,-290)
)
set_speed(100,500,300,200)
await drive_base.straight(300)
await left_arm.run_angle(200,-300)
await drive_base.straight(-95)
await drive_base.turn(22)
await right_arm.run_angle(5000,100)
await drive_base.straight(90)
set_speed(700,500,300,200)
await drive_base.arc(-700,angle=-150)
>>>>>>> 3cd1849 (Update discovery-phase/missions/Showcase_codes.py)
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
async def Run6(): # Interchangable Mission - Parthiv
<<<<<<< HEAD
>>>>>>> c15d8f0 (Update discovery-phase/missions/Showcase_codes.py)
=======
=======
=======
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
async def Run11(): # Interchangable Mission - Parthiv
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
>>>>>>> 0cd478f (resolving)
=======
async def Run6(): # Interchangable Mission - Parthiv
=======
async def Run11(): # Interchangable Mission - Parthiv
>>>>>>> 2b44156 (Update discovery-phase/missions/Showcase_codes.py)
>>>>>>> dev
await left_arm.run_angle(200,-80) await left_arm.run_angle(200,-80)
await right_arm.run_angle(200,-70) await drive_base.arc(-350,angle=90)
await drive_base.arc(-400,angle=90) await drive_base.turn(50)
await drive_base.turn(55) await drive_base.straight(238)
await drive_base.straight(240) await drive_base.turn(-33)
await drive_base.turn(-40)
await drive_base.straight(85) await drive_base.straight(85)
await drive_base.straight(-32) await drive_base.straight(-33)
await run_both_arms() await multitask(
await drive_base.straight(-53) left_arm.run_angle(200,80),
right_arm.run_angle(200,-100)
)
await drive_base.straight(-60)
await right_arm.run_angle(200,100) await right_arm.run_angle(200,100)
await drive_base.turn(30) await drive_base.turn(30)
await drive_base.straight(-775) await drive_base.straight(-775)
await drive_base.stop await drive_base.stop
<<<<<<< HEAD
=======
<<<<<<< HEAD
async def Run12(): # Experimental Research Platform Lifter async def Run12(): # Experimental Research Platform Lifter
=======
>>>>>>> 3cd1849 (Update discovery-phase/missions/Showcase_codes.py)
async def Run7(): # Seed Dispersal and Keystone - Parthiv
await drive_base.straight(600)
await drive_base.arc(400,angle=35)
await drive_base.straight(-40)
await right_arm.run_angle(150,-70)
await drive_base.arc(400,angle=-35)
await drive_base.straight(-540)
await drive_base.turn(-90)
await drive_base.straight(200)
await left_arm.run_angle(100,100)
await drive_base.straight(-350)
<<<<<<< HEAD
=======
>>>>>>> a9d3cd9 (Update discovery-phase/missions/Showcase_codes.py)
>>>>>>> 3cd1849 (Update discovery-phase/missions/Showcase_codes.py)
await multilift_up(1200)
await multilift_down(300)
await drive_base.straight(50)
# Function to classify color based on HSV # Function to classify color based on HSV
@@ -340,9 +610,9 @@ def detect_color(h, s, v, reflected):
if reflected > 4: if reflected > 4:
if h < 4 or h > 350: # red if h < 4 or h > 350: # red
return "Red" return "Red"
elif 3 < h < 40 and s > 70: # orange elif 3 < h < 24 and s > 80: # orange
return "Orange" return "Orange"
elif 47 < h < 56: # yellow elif 30 < h < 60 and v > 50: # yellow
return "Yellow" return "Yellow"
elif 70 < h < 160: # green - do it vertically not horizontally for accuracy elif 70 < h < 160: # green - do it vertically not horizontally for accuracy
return "Green" return "Green"
@@ -352,7 +622,8 @@ def detect_color(h, s, v, reflected):
return "Blue" return "Blue"
elif 260 < h < 350: # purple elif 260 < h < 350: # purple
return "Purple" return "Purple"
elif s < 15 and v > 70: # white
return "White"
else: else:
return "Unknown" return "Unknown"
return "Unknown" return "Unknown"
@@ -372,26 +643,28 @@ async def main():
if color == "Green": if color == "Green":
print('Running Mission 1') print('Running Mission 1, Detect Green')
await Run1() await Run1()
elif color == "Red": elif color == "Red":
print('Running Mission 2') print('Running Mission 2, Detect Red')
await Run2() await Run2()
elif color == "Yellow": elif color == "Yellow":
print('Running Mission 3') print('Running Mission 3, Detect Yellow')
await Run3() await Run3()
elif color == "Blue": elif color == "Blue":
print('Running Mission 4') print('Running Mission 4, Detect Blue')
await Run4() await Run4()
elif color == "Orange": elif color == "Orange":
print('Running Mission 5') print('Running Mission 5, Detect Orange')
await Run3() await Run5()
elif color == "Purple": elif color == "Purple":
print('Running Mission 11') print('Running Mission 6, Detect Purple')
await Run11() await Run6()
elif color == "Light_Blue": elif color == "Light_Blue":
print("Running Mission 12") print('Running Mission 7, Detect Cyan')
await Run12() await Run7()
elif color == "White":
print('Detect White')
else: else:
print(f"Unknown color detected (Hue: {h}, Sat: {s}, Val: {v})") print(f"Unknown color detected (Hue: {h}, Sat: {s}, Val: {v})")
#pass #pass

View File

@@ -42,8 +42,13 @@ async def multilift_down(rotation_angle):
async def main(): async def main():
await multilift_up(1200) await drive_base.arc(900,None,400)
await multilift_down(300) await drive_base.arc(-500,None,250)
await drive_base.straight(50) set_speed(100,400,300,200)
await drive_base.straight(200)
await multilift_up(1950)
await multilift_down(500)
set_speed(1000,500,300,200)
await drive_base.arc(-1000,None,-900)
run_task(main()) run_task(main())

View File

@@ -32,33 +32,39 @@ async def main():
await drive_base.straight(110) await drive_base.straight(110)
await drive_base.turn(-45) await drive_base.turn(-45)
await drive_base.straight(240) await drive_base.straight(280)
await right_arm.run_angle(300,120) await right_arm.run_angle(300,120)
await drive_base.straight(290) await left_arm.run_angle(400,200)
await drive_base.straight(-70)
await left_arm.run_angle(600,-110)
await drive_base.straight(370)
await drive_base.turn(50) await drive_base.turn(50)
await drive_base.straight(300) await multitask(
drive_base.straight(250),
left_arm.run_angle(600,-60)
)
await drive_base.turn(40) await drive_base.turn(40)
set_speed(100,200,300,200) set_speed(100,200,300,200)
await drive_base.straight(130) await drive_base.straight(170)
await drive_base.straight(-115)
await drive_base.turn(87)
await drive_base.straight(230)
set_speed(600, 500, 300, 200)
await drive_base.straight(-135) await drive_base.straight(-135)
await drive_base.turn(80)
await drive_base.straight(85)
await multitask( await multitask(
drive_base.turn(-40), drive_base.turn(-36),
right_arm.run_angle(100,-110) right_arm.run_angle(200,-140)
) )
set_speed(100,200,300,200) set_speed(100,200,300,200)
await drive_base.straight(220) await drive_base.straight(230)
await right_arm.run_angle(300,85) await multitask(
await wait(500) right_arm.run_angle(300,160),
await drive_base.straight(142) left_arm.run_angle(300,150)
await drive_base.arc(110,None,-166) )
await drive_base.straight(140) await wait(200)
await drive_base.straight(-150) await drive_base.straight(30)
await drive_base.turn(-90)
await drive_base.straight(-170)
set_speed(600,500,300,200) set_speed(600,500,300,200)
await drive_base.straight(150) await drive_base.straight(100)
await drive_base.arc(800,None,-900) await drive_base.arc(800,None,-900)
run_task(main()) run_task(main())