Update shout-fll-scrimmage/bioglow_shoutfll_scrimmage_main.py

This commit is contained in:
2026-10-17 01:22:55 +00:00
parent 1c0099bb0a
commit 53517762ef

View File

@@ -7,8 +7,13 @@
import bioglow_helpers as helper
import bioglow_robot_settings as robot
import bioglow_mission_3_4_5 as Run_1 # import here the name of files containing mission runs Run_1 for run 1,
# Run_2 for run 2, and so on..
import bioglow_missions_3_4_5 as Run_1 # import here the name of files containing mission runs Run_1 for run 1,
import bioglow_mission_2 as Run_2 # Run_2 for run 2, and so on..
import bioglow_mission_1 as Run_3
import bioglow_missions_11_6_7 as Run_4
import bioglow_mission_13 as Run_5
import bioglow_mission_12 as Run_6
import bioglow_missions_14_15 as Run_7
# Function to classify color based on HSV
def detect_color(h, s, v, reflected):
@@ -22,7 +27,7 @@ def detect_color(h, s, v, reflected):
elif 70 < h < 160: # green - do it vertically not horizontally for accuracy
return "Green"
elif 195 < h < 198: # light blue
return "Light_Blue"
return "Cyan"
elif 210 < h < 225: # blue - do it vertically not horizontally for accuracy
return "Blue"
elif 260 < h < 350: # purple
@@ -52,22 +57,22 @@ async def main():
await Run_1.solve_missions()
elif color == "Red":
print('Running Mission 2, Detect Red')
pass # TODO: Run2 not written yet (it crashed with NameError)
await Run_2.solve_missions()
elif color == "Yellow":
print('Running Mission 3, Detect Yellow')
pass # TODO: Run3 not written yet (it crashed with NameError)
await Run_3.solve_missions()
elif color == "Blue":
print('Running Mission 4, Detect Blue')
pass # TODO: Run4 not written yet (it crashed with NameError)
elif color == "Orange":
print('Running Mission 5, Detect Orange')
pass # TODO: Run5 not written yet (it crashed with NameError)
await Run_4.solve_missions()
elif color == "Purple":
print('Running Mission 6, Detect Purple')
pass # TODO: Run6 not written yet (it crashed with NameError)
elif color == "Light_Blue":
print('Running Mission 5, Detect Purple')
await Run_5.solve_missions()
elif color == "Orange":
print('Running Mission 6, Detect Orange')
await Run_6.solve_missions()
elif color == "Cyan":
print('Running Mission 7, Detect Cyan')
pass # TODO: Run7 not written yet (it crashed with NameError)
await Run_7.solve_missions()
elif color == "White":
print('Detect White')
else: