Add shooter python codegen
Signed-off-by: Maxwell Henderson <mxwhenderson@gmail.com>
Change-Id: I8b76968b8c7628822136155d7a15a149e6d236d6
diff --git a/y2024/control_loops/superstructure/altitude/BUILD b/y2024/control_loops/superstructure/altitude/BUILD
new file mode 100644
index 0000000..71e2e3b
--- /dev/null
+++ b/y2024/control_loops/superstructure/altitude/BUILD
@@ -0,0 +1,42 @@
+package(default_visibility = ["//y2024:__subpackages__"])
+
+genrule(
+ name = "genrule_altitude",
+ outs = [
+ "altitude_plant.h",
+ "altitude_plant.cc",
+ "altitude_plant.json",
+ "integral_altitude_plant.h",
+ "integral_altitude_plant.cc",
+ "integral_altitude_plant.json",
+ ],
+ cmd = "$(location //y2024/control_loops/python:altitude) $(OUTS)",
+ target_compatible_with = ["@platforms//os:linux"],
+ tools = [
+ "//y2024/control_loops/python:altitude",
+ ],
+)
+
+cc_library(
+ name = "altitude_plants",
+ srcs = [
+ "altitude_plant.cc",
+ "integral_altitude_plant.cc",
+ ],
+ hdrs = [
+ "altitude_plant.h",
+ "integral_altitude_plant.h",
+ ],
+ target_compatible_with = ["@platforms//os:linux"],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//frc971/control_loops:hybrid_state_feedback_loop",
+ "//frc971/control_loops:state_feedback_loop",
+ ],
+)
+
+filegroup(
+ name = "altitude_json",
+ srcs = ["integral_altitude_plant.json"],
+ visibility = ["//visibility:public"],
+)
diff --git a/y2024/control_loops/superstructure/catapult/BUILD b/y2024/control_loops/superstructure/catapult/BUILD
new file mode 100644
index 0000000..a6025d8
--- /dev/null
+++ b/y2024/control_loops/superstructure/catapult/BUILD
@@ -0,0 +1,42 @@
+package(default_visibility = ["//y2024:__subpackages__"])
+
+genrule(
+ name = "genrule_catapult",
+ outs = [
+ "catapult_plant.h",
+ "catapult_plant.cc",
+ "catapult_plant.json",
+ "integral_catapult_plant.h",
+ "integral_catapult_plant.cc",
+ "integral_catapult_plant.json",
+ ],
+ cmd = "$(location //y2024/control_loops/python:catapult) $(OUTS)",
+ target_compatible_with = ["@platforms//os:linux"],
+ tools = [
+ "//y2024/control_loops/python:catapult",
+ ],
+)
+
+cc_library(
+ name = "catapult_plants",
+ srcs = [
+ "catapult_plant.cc",
+ "integral_catapult_plant.cc",
+ ],
+ hdrs = [
+ "catapult_plant.h",
+ "integral_catapult_plant.h",
+ ],
+ target_compatible_with = ["@platforms//os:linux"],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//frc971/control_loops:hybrid_state_feedback_loop",
+ "//frc971/control_loops:state_feedback_loop",
+ ],
+)
+
+filegroup(
+ name = "catapult_json",
+ srcs = ["integral_catapult_plant.json"],
+ visibility = ["//visibility:public"],
+)
diff --git a/y2024/control_loops/superstructure/superstructure_can_position.fbs b/y2024/control_loops/superstructure/superstructure_can_position.fbs
index 69bcdd0..0f751ab 100644
--- a/y2024/control_loops/superstructure/superstructure_can_position.fbs
+++ b/y2024/control_loops/superstructure/superstructure_can_position.fbs
@@ -26,6 +26,12 @@
// CAN Position of the retention roller falcon
retention_roller:frc971.control_loops.CANTalonFX (id: 6);
+
+ // CAN Position of the shooter turret falcon
+ turret:frc971.control_loops.CANTalonFX (id: 7);
+
+ // CAN Position of the shooter altitude falcon
+ altitude:frc971.control_loops.CANTalonFX (id: 8);
}
root_type CANPosition;
diff --git a/y2024/control_loops/superstructure/superstructure_status.fbs b/y2024/control_loops/superstructure/superstructure_status.fbs
index 3a4b443..ceed417 100644
--- a/y2024/control_loops/superstructure/superstructure_status.fbs
+++ b/y2024/control_loops/superstructure/superstructure_status.fbs
@@ -57,6 +57,9 @@
// Estimated angle and angular velocitiy of the climber.
climber_state:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 5);
+
+ // Status of the subsytems involved in the shooter
+ shooter_status:ShooterStatus (id: 6);
}
root_type Status;
diff --git a/y2024/control_loops/superstructure/turret/BUILD b/y2024/control_loops/superstructure/turret/BUILD
new file mode 100644
index 0000000..c67eb89
--- /dev/null
+++ b/y2024/control_loops/superstructure/turret/BUILD
@@ -0,0 +1,42 @@
+package(default_visibility = ["//y2024:__subpackages__"])
+
+genrule(
+ name = "genrule_turret",
+ outs = [
+ "turret_plant.h",
+ "turret_plant.cc",
+ "turret_plant.json",
+ "integral_turret_plant.h",
+ "integral_turret_plant.cc",
+ "integral_turret_plant.json",
+ ],
+ cmd = "$(location //y2024/control_loops/python:turret) $(OUTS)",
+ target_compatible_with = ["@platforms//os:linux"],
+ tools = [
+ "//y2024/control_loops/python:turret",
+ ],
+)
+
+cc_library(
+ name = "turret_plants",
+ srcs = [
+ "integral_turret_plant.cc",
+ "turret_plant.cc",
+ ],
+ hdrs = [
+ "integral_turret_plant.h",
+ "turret_plant.h",
+ ],
+ target_compatible_with = ["@platforms//os:linux"],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//frc971/control_loops:hybrid_state_feedback_loop",
+ "//frc971/control_loops:state_feedback_loop",
+ ],
+)
+
+filegroup(
+ name = "turret_json",
+ srcs = ["integral_turret_plant.json"],
+ visibility = ["//visibility:public"],
+)