Add numerical jacobian library.
Change-Id: I1f54172a561f00c9cca2b218f16a1f1dba776d5c
diff --git a/frc971/control_loops/BUILD b/frc971/control_loops/BUILD
index eccbb14..01dc25e 100644
--- a/frc971/control_loops/BUILD
+++ b/frc971/control_loops/BUILD
@@ -1,204 +1,228 @@
-package(default_visibility = ['//visibility:public'])
+package(default_visibility = ["//visibility:public"])
-load('//aos/build:queues.bzl', 'queue_library')
+load("//aos/build:queues.bzl", "queue_library")
cc_library(
- name = 'team_number_test_environment',
- srcs = [
- 'team_number_test_environment.cc',
- ],
- hdrs = [
- 'team_number_test_environment.h',
- ],
- deps = [
- '//aos/common/network:team_number',
- '//aos/testing:googletest',
- ],
- testonly = True,
+ name = "team_number_test_environment",
+ testonly = True,
+ srcs = [
+ "team_number_test_environment.cc",
+ ],
+ hdrs = [
+ "team_number_test_environment.h",
+ ],
+ deps = [
+ "//aos/common/network:team_number",
+ "//aos/testing:googletest",
+ ],
)
cc_test(
- name = 'hybrid_state_feedback_loop_test',
- srcs = [
- 'hybrid_state_feedback_loop_test.cc',
- ],
- deps = [
- ':hybrid_state_feedback_loop',
- '//aos/testing:googletest',
- ],
+ name = "hybrid_state_feedback_loop_test",
+ srcs = [
+ "hybrid_state_feedback_loop_test.cc",
+ ],
+ deps = [
+ ":hybrid_state_feedback_loop",
+ "//aos/testing:googletest",
+ ],
)
cc_library(
- name = 'hall_effect_tracker',
- hdrs = [
- 'hall_effect_tracker.h',
- ],
- deps = [
- ':queues',
- ],
+ name = "hall_effect_tracker",
+ hdrs = [
+ "hall_effect_tracker.h",
+ ],
+ deps = [
+ ":queues",
+ ],
)
queue_library(
- name = 'queues',
- srcs = [
- 'control_loops.q',
- ],
+ name = "queues",
+ srcs = [
+ "control_loops.q",
+ ],
)
cc_test(
- name = 'position_sensor_sim_test',
- srcs = [
- 'position_sensor_sim_test.cc',
- ],
- deps = [
- ':queues',
- ':position_sensor_sim',
- '//aos/testing:googletest',
- '//aos/common/logging',
- ],
+ name = "position_sensor_sim_test",
+ srcs = [
+ "position_sensor_sim_test.cc",
+ ],
+ deps = [
+ ":position_sensor_sim",
+ ":queues",
+ "//aos/common/logging",
+ "//aos/testing:googletest",
+ ],
)
cc_library(
- name = 'position_sensor_sim',
- testonly = True,
- srcs = [
- 'position_sensor_sim.cc',
- ],
- hdrs = [
- 'position_sensor_sim.h',
- ],
- deps = [
- ':queues',
- ':gaussian_noise',
- '//debian:libm',
- '//aos/testing:random_seed',
- ],
+ name = "position_sensor_sim",
+ testonly = True,
+ srcs = [
+ "position_sensor_sim.cc",
+ ],
+ hdrs = [
+ "position_sensor_sim.h",
+ ],
+ deps = [
+ ":gaussian_noise",
+ ":queues",
+ "//aos/testing:random_seed",
+ "//debian:libm",
+ ],
)
cc_library(
- name = 'gaussian_noise',
- srcs = [
- 'gaussian_noise.cc',
- ],
- hdrs = [
- 'gaussian_noise.h',
- ],
- deps = [
- '//debian:libm',
- ],
+ name = "gaussian_noise",
+ srcs = [
+ "gaussian_noise.cc",
+ ],
+ hdrs = [
+ "gaussian_noise.h",
+ ],
+ deps = [
+ "//debian:libm",
+ ],
)
cc_library(
- name = 'coerce_goal',
- srcs = [
- 'coerce_goal.cc',
- ],
- hdrs = [
- 'coerce_goal.h',
- ],
- deps = [
- '//third_party/eigen',
- '//aos/common/controls:polytope',
- '//debian:libm',
- ],
+ name = "coerce_goal",
+ srcs = [
+ "coerce_goal.cc",
+ ],
+ hdrs = [
+ "coerce_goal.h",
+ ],
+ deps = [
+ "//aos/common/controls:polytope",
+ "//debian:libm",
+ "//third_party/eigen",
+ ],
)
# TODO(austin): Select isn't working right. We should be able to remove
# logging conditionally with select and have CPU constraints work correctly.
cc_library(
- name = 'state_feedback_loop_uc',
- hdrs = [
- 'state_feedback_loop.h',
- ],
- deps = [
- '//aos/common:macros',
- '//third_party/eigen',
- ],
- restricted_to = ['//tools:cortex-m4f'],
-)
-cc_library(
- name = 'state_feedback_loop',
- hdrs = [
- 'state_feedback_loop.h',
- ],
- deps = [
- '//aos/common/logging',
- '//aos/common:macros',
- '//third_party/eigen',
- ],
+ name = "state_feedback_loop_uc",
+ hdrs = [
+ "state_feedback_loop.h",
+ ],
+ restricted_to = ["//tools:cortex-m4f"],
+ deps = [
+ "//aos/common:macros",
+ "//third_party/eigen",
+ ],
)
cc_library(
- name = 'hybrid_state_feedback_loop',
- hdrs = [
- 'hybrid_state_feedback_loop.h',
- ],
- deps = [
- ':state_feedback_loop',
- '//aos/common/controls:control_loop',
- '//aos/common/logging',
- '//aos/common:macros',
- '//third_party/eigen',
- ],
+ name = "state_feedback_loop",
+ hdrs = [
+ "state_feedback_loop.h",
+ ],
+ deps = [
+ "//aos/common:macros",
+ "//aos/common/logging",
+ "//third_party/eigen",
+ ],
)
cc_library(
- name = 'simple_capped_state_feedback_loop',
- hdrs = [
- 'simple_capped_state_feedback_loop.h',
- ],
- deps = [
- '//third_party/eigen',
- ':state_feedback_loop',
- ],
+ name = "hybrid_state_feedback_loop",
+ hdrs = [
+ "hybrid_state_feedback_loop.h",
+ ],
+ deps = [
+ ":state_feedback_loop",
+ "//aos/common:macros",
+ "//aos/common/controls:control_loop",
+ "//aos/common/logging",
+ "//third_party/eigen",
+ ],
)
cc_library(
- name = 'runge_kutta',
- hdrs = [
- 'runge_kutta.h',
- ],
- deps = [
- '//third_party/eigen',
- ],
+ name = "simple_capped_state_feedback_loop",
+ hdrs = [
+ "simple_capped_state_feedback_loop.h",
+ ],
+ deps = [
+ ":state_feedback_loop",
+ "//third_party/eigen",
+ ],
+)
+
+cc_library(
+ name = "runge_kutta",
+ hdrs = [
+ "runge_kutta.h",
+ ],
+ deps = [
+ "//third_party/eigen",
+ ],
)
cc_test(
- name = 'runge_kutta_test',
- srcs = [
- 'runge_kutta_test.cc',
- ],
- deps = [
- ':runge_kutta',
- '//aos/testing:googletest',
- '//third_party/eigen',
- ],
+ name = "runge_kutta_test",
+ srcs = [
+ "runge_kutta_test.cc",
+ ],
+ deps = [
+ ":runge_kutta",
+ "//aos/testing:googletest",
+ "//third_party/eigen",
+ ],
)
queue_library(
- name = 'profiled_subsystem_queue',
- srcs = [
- 'profiled_subsystem.q',
- ],
- deps = [
- ':queues',
- ],
+ name = "profiled_subsystem_queue",
+ srcs = [
+ "profiled_subsystem.q",
+ ],
+ deps = [
+ ":queues",
+ ],
)
cc_library(
- name = 'profiled_subsystem',
- srcs = [
- 'profiled_subsystem.cc',
- ],
- hdrs = [
- 'profiled_subsystem.h',
- ],
- deps = [
- ':profiled_subsystem_queue',
- ':simple_capped_state_feedback_loop',
- ':state_feedback_loop',
- '//aos/common/controls:control_loop',
- '//aos/common/util:trapezoid_profile',
- '//frc971/zeroing:zeroing',
- ],
+ name = "profiled_subsystem",
+ srcs = [
+ "profiled_subsystem.cc",
+ ],
+ hdrs = [
+ "profiled_subsystem.h",
+ ],
+ deps = [
+ ":profiled_subsystem_queue",
+ ":simple_capped_state_feedback_loop",
+ ":state_feedback_loop",
+ "//aos/common/controls:control_loop",
+ "//aos/common/util:trapezoid_profile",
+ "//frc971/zeroing",
+ ],
)
+
+cc_library(
+ name = "jacobian",
+ hdrs = [
+ "jacobian.h",
+ ],
+ deps = [
+ "//third_party/eigen",
+ ],
+)
+
+cc_test(
+ name = "jacobian_test",
+ srcs = [
+ "jacobian_test.cc",
+ ],
+ deps = [
+ ":jacobian",
+ "//aos/testing:googletest",
+ "//third_party/eigen",
+ ],
+)
+