Update shout-fll-scrimmage/bioglow_shoutfll_scrimmage_main.py
This commit is contained in:
@@ -7,8 +7,13 @@
|
|||||||
|
|
||||||
import bioglow_helpers as helper
|
import bioglow_helpers as helper
|
||||||
import bioglow_robot_settings as robot
|
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,
|
import bioglow_missions_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_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
|
# Function to classify color based on HSV
|
||||||
def detect_color(h, s, v, reflected):
|
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
|
elif 70 < h < 160: # green - do it vertically not horizontally for accuracy
|
||||||
return "Green"
|
return "Green"
|
||||||
elif 195 < h < 198: # light blue
|
elif 195 < h < 198: # light blue
|
||||||
return "Light_Blue"
|
return "Cyan"
|
||||||
elif 210 < h < 225: # blue - do it vertically not horizontally for accuracy
|
elif 210 < h < 225: # blue - do it vertically not horizontally for accuracy
|
||||||
return "Blue"
|
return "Blue"
|
||||||
elif 260 < h < 350: # purple
|
elif 260 < h < 350: # purple
|
||||||
@@ -52,22 +57,22 @@ async def main():
|
|||||||
await Run_1.solve_missions()
|
await Run_1.solve_missions()
|
||||||
elif color == "Red":
|
elif color == "Red":
|
||||||
print('Running Mission 2, Detect 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":
|
elif color == "Yellow":
|
||||||
print('Running Mission 3, Detect 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":
|
elif color == "Blue":
|
||||||
print('Running Mission 4, Detect Blue')
|
print('Running Mission 4, Detect Blue')
|
||||||
pass # TODO: Run4 not written yet (it crashed with NameError)
|
await Run_4.solve_missions()
|
||||||
elif color == "Orange":
|
|
||||||
print('Running Mission 5, Detect Orange')
|
|
||||||
pass # TODO: Run5 not written yet (it crashed with NameError)
|
|
||||||
elif color == "Purple":
|
elif color == "Purple":
|
||||||
print('Running Mission 6, Detect Purple')
|
print('Running Mission 5, Detect Purple')
|
||||||
pass # TODO: Run6 not written yet (it crashed with NameError)
|
await Run_5.solve_missions()
|
||||||
elif color == "Light_Blue":
|
elif color == "Orange":
|
||||||
|
print('Running Mission 6, Detect Orange')
|
||||||
|
await Run_6.solve_missions()
|
||||||
|
elif color == "Cyan":
|
||||||
print('Running Mission 7, Detect 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":
|
elif color == "White":
|
||||||
print('Detect White')
|
print('Detect White')
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user