Small hack to allow script to run locally or on the pi
Change-Id: I94e44113e5412e5629d085ed6211a2391a59375b
diff --git a/y2020/vision/galactic_search_path.py b/y2020/vision/galactic_search_path.py
index e7f8402..a4acb05 100644
--- a/y2020/vision/galactic_search_path.py
+++ b/y2020/vision/galactic_search_path.py
@@ -30,6 +30,11 @@
NUM_RECTS = 4
AOS_SEND_PATH = "bazel-bin/aos/aos_send"
+CONFIG_PATH = "bazel-bin/y2020/config.json"
+
+if os.path.isdir("/home/pi/robot_code"):
+ AOS_SEND_PATH = "/home/pi/robot_code/aos_send.stripped"
+ CONFIG_PATH = "/home/pi/robot_code/config.stripped.json"
# The minimum percentage of yellow for a region of a image to
# be considered to have a ball
@@ -101,7 +106,7 @@
glog.warn("More than one ball found, path is unknown" if rects_with_balls > 1 else
"No balls found")
glog.info("Path is %s" % path)
- os.system(AOS_SEND_PATH + " --config bazel-bin/y2020/config.json " +
+ os.system(AOS_SEND_PATH + " --config " + CONFIG_PATH +
"/pi1/camera y2020.vision.GalacticSearchPath '" + json.dumps(path) + "'")
for j in range(len(pcts)):