Updated constants and wpilib_interface.
Updated wpilib_interface and the constants files to have the
superstructure components.
Updated the linear_system codegen to output free speed in radians.
Updated the intake python file with the correct gear ratio.
Created the superstructure plants.
Change-Id: I5a2b54fe3de8d9ae9b0f79820465a2f97baed22d
diff --git a/y2019/control_loops/python/intake.py b/y2019/control_loops/python/intake.py
index 97f8880..d1c5710 100755
--- a/y2019/control_loops/python/intake.py
+++ b/y2019/control_loops/python/intake.py
@@ -20,7 +20,7 @@
kIntake = angular_system.AngularSystemParams(
name='Intake',
motor=control_loop.BAG(),
- G=(1.0 / 9.0) * (1.0 / 9.0) * (16.0 / 38.0),
+ G=(1.0 / 7.0) * (1.0 / 4.0) * (1.0 / 4.0)* (18.0 / 38.0),
# TODO(austin): Pull moments of inertia from CAD when it's done.
J=0.8,
q_pos=0.20,
diff --git a/y2019/control_loops/superstructure/elevator/BUILD b/y2019/control_loops/superstructure/elevator/BUILD
new file mode 100644
index 0000000..f3d99fe
--- /dev/null
+++ b/y2019/control_loops/superstructure/elevator/BUILD
@@ -0,0 +1,32 @@
+package(default_visibility = ["//y2019:__subpackages__"])
+
+genrule(
+ name = "genrule_elevator",
+ outs = [
+ "elevator_plant.h",
+ "elevator_plant.cc",
+ "integral_elevator_plant.h",
+ "integral_elevator_plant.cc",
+ ],
+ cmd = "$(location //y2019/control_loops/python:elevator) $(OUTS)",
+ tools = [
+ "//y2019/control_loops/python:elevator",
+ ],
+)
+
+cc_library(
+ name = "elevator_plants",
+ srcs = [
+ "elevator_plant.cc",
+ "integral_elevator_plant.cc",
+ ],
+ hdrs = [
+ "elevator_plant.h",
+ "integral_elevator_plant.h",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//frc971/control_loops:hybrid_state_feedback_loop",
+ "//frc971/control_loops:state_feedback_loop",
+ ],
+)
diff --git a/y2019/control_loops/superstructure/intake/BUILD b/y2019/control_loops/superstructure/intake/BUILD
new file mode 100644
index 0000000..4f7f6b0
--- /dev/null
+++ b/y2019/control_loops/superstructure/intake/BUILD
@@ -0,0 +1,32 @@
+package(default_visibility = ["//y2019:__subpackages__"])
+
+genrule(
+ name = "genrule_intake",
+ outs = [
+ "intake_plant.h",
+ "intake_plant.cc",
+ "integral_intake_plant.h",
+ "integral_intake_plant.cc",
+ ],
+ cmd = "$(location //y2019/control_loops/python:intake) $(OUTS)",
+ tools = [
+ "//y2019/control_loops/python:intake",
+ ],
+)
+
+cc_library(
+ name = "intake_plants",
+ srcs = [
+ "intake_plant.cc",
+ "integral_intake_plant.cc",
+ ],
+ hdrs = [
+ "intake_plant.h",
+ "integral_intake_plant.h",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//frc971/control_loops:hybrid_state_feedback_loop",
+ "//frc971/control_loops:state_feedback_loop",
+ ],
+)
diff --git a/y2019/control_loops/superstructure/stilts/BUILD b/y2019/control_loops/superstructure/stilts/BUILD
new file mode 100644
index 0000000..6beea39
--- /dev/null
+++ b/y2019/control_loops/superstructure/stilts/BUILD
@@ -0,0 +1,32 @@
+package(default_visibility = ["//y2019:__subpackages__"])
+
+genrule(
+ name = "genrule_stilts",
+ outs = [
+ "stilts_plant.h",
+ "stilts_plant.cc",
+ "integral_stilts_plant.h",
+ "integral_stilts_plant.cc",
+ ],
+ cmd = "$(location //y2019/control_loops/python:stilts) $(OUTS)",
+ tools = [
+ "//y2019/control_loops/python:stilts",
+ ],
+)
+
+cc_library(
+ name = "stilts_plants",
+ srcs = [
+ "stilts_plant.cc",
+ "integral_stilts_plant.cc",
+ ],
+ hdrs = [
+ "stilts_plant.h",
+ "integral_stilts_plant.h",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//frc971/control_loops:hybrid_state_feedback_loop",
+ "//frc971/control_loops:state_feedback_loop",
+ ],
+)
diff --git a/y2019/control_loops/superstructure/superstructure.q b/y2019/control_loops/superstructure/superstructure.q
index fef9ced..cd004ac 100644
--- a/y2019/control_loops/superstructure/superstructure.q
+++ b/y2019/control_loops/superstructure/superstructure.q
@@ -86,7 +86,7 @@
.frc971.PotAndAbsolutePosition wrist;
// Position of the intake. 0 when rollers are retracted, positive extended.
- .frc971.PotAndAbsolutePosition intake_joint;
+ .frc971.AbsolutePosition intake_joint;
// Position of the stilts, 0 when retracted (defualt), positive lifts robot.
.frc971.PotAndAbsolutePosition stilts;
@@ -124,4 +124,4 @@
queue Position position;
};
-queue_group SuperstructureQueue superstructure_queue;
\ No newline at end of file
+queue_group SuperstructureQueue superstructure_queue;
diff --git a/y2019/control_loops/superstructure/wrist/BUILD b/y2019/control_loops/superstructure/wrist/BUILD
new file mode 100644
index 0000000..3d007be
--- /dev/null
+++ b/y2019/control_loops/superstructure/wrist/BUILD
@@ -0,0 +1,32 @@
+package(default_visibility = ["//y2019:__subpackages__"])
+
+genrule(
+ name = "genrule_wrist",
+ outs = [
+ "wrist_plant.h",
+ "wrist_plant.cc",
+ "integral_wrist_plant.h",
+ "integral_wrist_plant.cc",
+ ],
+ cmd = "$(location //y2019/control_loops/python:wrist) $(OUTS)",
+ tools = [
+ "//y2019/control_loops/python:wrist",
+ ],
+)
+
+cc_library(
+ name = "wrist_plants",
+ srcs = [
+ "wrist_plant.cc",
+ "integral_wrist_plant.cc",
+ ],
+ hdrs = [
+ "wrist_plant.h",
+ "integral_wrist_plant.h",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//frc971/control_loops:hybrid_state_feedback_loop",
+ "//frc971/control_loops:state_feedback_loop",
+ ],
+)