Switch to python3 and scipy from slycot
Turns out we need python3 matplotlib to make scipy work well enough to
place the poles correctly for our systems. Rather than do it piecemeal,
do it all at once.
This includes a python opencv upgrade too to support the new python, and
a matplotlib upgrade.
Change-Id: Ic7517b5ebbfdca9cc90ae6a61d86b474f2f21b29
diff --git a/y2020/control_loops/python/BUILD b/y2020/control_loops/python/BUILD
index 34d49cb..9886452 100644
--- a/y2020/control_loops/python/BUILD
+++ b/y2020/control_loops/python/BUILD
@@ -121,7 +121,7 @@
target_compatible_with = ["@platforms//cpu:x86_64"],
deps = [
"//frc971/control_loops/python:controls",
- "@matplotlib_repo//:matplotlib2.7",
+ "@matplotlib_repo//:matplotlib3",
],
)
diff --git a/y2020/control_loops/python/accelerator.py b/y2020/control_loops/python/accelerator.py
index 48c9098..bb50d9d 100644
--- a/y2020/control_loops/python/accelerator.py
+++ b/y2020/control_loops/python/accelerator.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from frc971.control_loops.python import control_loop
from y2020.control_loops.python import flywheel
diff --git a/y2020/control_loops/python/control_panel.py b/y2020/control_loops/python/control_panel.py
index e02aa13..7a5bdf9 100644
--- a/y2020/control_loops/python/control_panel.py
+++ b/y2020/control_loops/python/control_panel.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from aos.util.trapezoid_profile import TrapezoidProfile
from frc971.control_loops.python import control_loop
diff --git a/y2020/control_loops/python/drivetrain.py b/y2020/control_loops/python/drivetrain.py
index 84bbb66..f5c6214 100644
--- a/y2020/control_loops/python/drivetrain.py
+++ b/y2020/control_loops/python/drivetrain.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from __future__ import print_function
from frc971.control_loops.python import drivetrain
diff --git a/y2020/control_loops/python/finisher.py b/y2020/control_loops/python/finisher.py
index 9381630..6da1c03 100644
--- a/y2020/control_loops/python/finisher.py
+++ b/y2020/control_loops/python/finisher.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from frc971.control_loops.python import control_loop
from y2020.control_loops.python import flywheel
diff --git a/y2020/control_loops/python/hood.py b/y2020/control_loops/python/hood.py
index 7e75dce..d8118a1 100644
--- a/y2020/control_loops/python/hood.py
+++ b/y2020/control_loops/python/hood.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from aos.util.trapezoid_profile import TrapezoidProfile
from frc971.control_loops.python import control_loop
@@ -17,7 +17,6 @@
except gflags.DuplicateFlagError:
pass
-
# Hood is an angular subsystem due to the mounting of the encoder on the hood
# joint. We are currently electing to ignore potential non-linearity.
@@ -47,7 +46,7 @@
angular_system.PlotKick(kHood, R)
angular_system.PlotMotion(kHood, R)
- glog.info("Radians per turn: %f\n", radians_per_turn)
+ glog.debug("Radians per turn: %f\n", radians_per_turn)
# Write the generated constants out to a file.
if len(argv) != 5:
diff --git a/y2020/control_loops/python/intake.py b/y2020/control_loops/python/intake.py
index bb19e2d..de60b28 100644
--- a/y2020/control_loops/python/intake.py
+++ b/y2020/control_loops/python/intake.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from aos.util.trapezoid_profile import TrapezoidProfile
from frc971.control_loops.python import control_loop
diff --git a/y2020/control_loops/python/polydrivetrain.py b/y2020/control_loops/python/polydrivetrain.py
index 6481af1..dad06b0 100644
--- a/y2020/control_loops/python/polydrivetrain.py
+++ b/y2020/control_loops/python/polydrivetrain.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
import sys
from y2020.control_loops.python import drivetrain
diff --git a/y2020/control_loops/python/turret.py b/y2020/control_loops/python/turret.py
index 5a27afb..acddae3 100644
--- a/y2020/control_loops/python/turret.py
+++ b/y2020/control_loops/python/turret.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from aos.util.trapezoid_profile import TrapezoidProfile
from frc971.control_loops.python import control_loop
diff --git a/y2020/vision/sift/demo_sift_training.py b/y2020/vision/sift/demo_sift_training.py
index c78a44a..e8d3521 100644
--- a/y2020/vision/sift/demo_sift_training.py
+++ b/y2020/vision/sift/demo_sift_training.py
@@ -16,7 +16,7 @@
image = cv2.cvtColor(image4_cleaned, cv2.COLOR_BGR2GRAY)
image = cv2.resize(image, (640, 480))
- sift = cv2.xfeatures2d.SIFT_create()
+ sift = cv2.SIFT_create()
keypoints, descriptors = sift.detectAndCompute(image, None)
fbb = flatbuffers.Builder(0)
diff --git a/y2020/vision/tools/python_code/load_sift_training.py b/y2020/vision/tools/python_code/load_sift_training.py
index 809d748..402e468 100644
--- a/y2020/vision/tools/python_code/load_sift_training.py
+++ b/y2020/vision/tools/python_code/load_sift_training.py
@@ -52,9 +52,9 @@
output_path = sys.argv[1]
- if (len(sys.argv) > 2):
+ if len(sys.argv) > 2:
if sys.argv[2] == "test":
- glog.info("Loading test data")
+ glog.debug("Loading test data")
import camera_definition_test
import target_definition_test
target_data_list = target_definition_test.compute_target_definition(
@@ -64,7 +64,7 @@
glog.error("Unhandled arguments: '%s'" % sys.argv[2])
quit()
else:
- glog.info("Loading target configuration data")
+ glog.debug("Loading target configuration data")
import camera_definition
import target_definition
target_data_list = target_definition.compute_target_definition()
diff --git a/y2020/vision/tools/python_code/train_and_match.py b/y2020/vision/tools/python_code/train_and_match.py
index 1def399..7a9d9bf 100644
--- a/y2020/vision/tools/python_code/train_and_match.py
+++ b/y2020/vision/tools/python_code/train_and_match.py
@@ -54,7 +54,7 @@
def load_feature_extractor():
if FEATURE_EXTRACTOR_NAME is 'SIFT':
# Initiate SIFT detector
- feature_extractor = cv2.xfeatures2d.SIFT_create()
+ feature_extractor = cv2.SIFT_create()
elif FEATURE_EXTRACTOR_NAME is 'SURF':
# Initiate SURF detector
feature_extractor = cv2.xfeatures2d.SURF_create()