Add initial velocity MPC
We actually get to a speed! Need to sort out why steering
overshoots/undershoots, and test more cases when changing direction.
Change-Id: Icd321c1a79b96281f6226886db840bbaeab85142
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/control_loops/swerve/BUILD b/frc971/control_loops/swerve/BUILD
index 3755ab4..e6a3798 100644
--- a/frc971/control_loops/swerve/BUILD
+++ b/frc971/control_loops/swerve/BUILD
@@ -131,13 +131,11 @@
"dynamics.cc",
"dynamics.h",
"dynamics.py",
- "numpy_dynamics.py",
],
args = [
"--output_base=$(BINDIR)/",
"--cc_output_path=$(location :dynamics.cc)",
"--h_output_path=$(location :dynamics.h)",
- "--py_output_path=$(location :numpy_dynamics.py)",
"--casadi_py_output_path=$(location :dynamics.py)",
],
tool = ":generate_physics",
@@ -178,18 +176,15 @@
],
)
-py_binary(
- name = "dynamics_sim",
+py_library(
+ name = "dynamics",
srcs = [
- "dynamics_sim.py",
- "numpy_dynamics.py",
+ "bigcaster_dynamics.py",
+ "dynamics.py",
+ "nocaster_dynamics.py",
],
deps = [
- "//frc971/control_loops/python:controls",
- "@pip//matplotlib",
- "@pip//numpy",
- "@pip//pygobject",
- "@pip//scipy",
+ "@pip//casadi",
],
)
@@ -200,21 +195,25 @@
],
target_compatible_with = ["@platforms//cpu:x86_64"],
deps = [
+ ":dynamics",
":physics_test_utils",
"@pip//casadi",
"@pip//numpy",
],
)
-py_library(
- name = "dynamics",
+py_binary(
+ name = "casadi_velocity_mpc",
srcs = [
- "bigcaster_dynamics.py",
- "dynamics.py",
- "nocaster_dynamics.py",
+ "casadi_velocity_mpc.py",
],
deps = [
+ ":dynamics",
"@pip//casadi",
+ "@pip//matplotlib",
+ "@pip//numpy",
+ "@pip//pygobject",
+ "@pip//scipy",
],
)