Add debug script and break out test utils
Signed-off-by: justinT21 <jjturcot@gmail.com>
Change-Id: I5913be5bf7aed9ef9f274d3ad4ced61b1738ca71
diff --git a/frc971/control_loops/swerve/BUILD b/frc971/control_loops/swerve/BUILD
index 29dbf76..3755ab4 100644
--- a/frc971/control_loops/swerve/BUILD
+++ b/frc971/control_loops/swerve/BUILD
@@ -170,7 +170,7 @@
)
cc_library(
- name = "dynamics",
+ name = "eigen_dynamics",
srcs = ["dynamics.cc"],
hdrs = ["dynamics.h"],
deps = [
@@ -196,14 +196,49 @@
py_test(
name = "physics_test",
srcs = [
- "bigcaster_dynamics.py",
- "dynamics.py",
- "nocaster_dynamics.py",
"physics_test.py",
],
target_compatible_with = ["@platforms//cpu:x86_64"],
deps = [
+ ":physics_test_utils",
"@pip//casadi",
"@pip//numpy",
],
)
+
+py_library(
+ name = "dynamics",
+ srcs = [
+ "bigcaster_dynamics.py",
+ "dynamics.py",
+ "nocaster_dynamics.py",
+ ],
+ deps = [
+ "@pip//casadi",
+ ],
+)
+
+py_library(
+ name = "physics_test_utils",
+ srcs = [
+ "physics_test_utils.py",
+ ],
+ deps = [
+ ":dynamics",
+ "@pip//casadi",
+ "@pip//numpy",
+ ],
+)
+
+py_binary(
+ name = "physics_debug",
+ srcs = [
+ "physics_debug.py",
+ ],
+ deps = [
+ ":physics_test_utils",
+ "@pip//matplotlib",
+ "@pip//pygobject",
+ "@pip//scipy",
+ ],
+)