blob: 211b55c61ef0b5327744684ddf543970f6d26e18 [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Comran Morshed25f81a02016-01-23 13:40:10 +00002
Philipp Schradercc016b32021-12-30 08:59:58 -08003package(default_visibility = ["//visibility:public"])
4
James Kuszmaulf01da392023-12-14 11:22:14 -08005static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -07006 name = "superstructure_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -08007 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -07008 "superstructure_goal.fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -08009 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080010 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070011)
12
James Kuszmaulf01da392023-12-14 11:22:14 -080013static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070014 name = "superstructure_position_fbs",
15 srcs = [
16 "superstructure_position.fbs",
17 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080019 deps = [
20 "//frc971/control_loops:control_loops_fbs",
21 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070022)
23
James Kuszmaulf01da392023-12-14 11:22:14 -080024static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070025 name = "superstructure_output_fbs",
26 srcs = [
27 "superstructure_output.fbs",
28 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080029 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070030)
31
James Kuszmaulf01da392023-12-14 11:22:14 -080032static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070033 name = "superstructure_status_fbs",
34 srcs = [
35 "superstructure_status.fbs",
36 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080037 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080038 deps = [
39 "//frc971/control_loops:control_loops_fbs",
40 ],
Comran Morshed25f81a02016-01-23 13:40:10 +000041)
42
Comran Morshed2ae094e2016-01-23 20:43:20 +000043genrule(
Austin Schuh55a13dc2019-01-27 22:39:03 -080044 name = "genrule_intake",
45 outs = [
46 "intake_plant.h",
47 "intake_plant.cc",
48 "integral_intake_plant.h",
49 "integral_intake_plant.cc",
50 ],
51 cmd = "$(location //y2016/control_loops/python:intake) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080052 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080053 tools = [
54 "//y2016/control_loops/python:intake",
55 ],
56 visibility = ["//visibility:private"],
Comran Morshed2ae094e2016-01-23 20:43:20 +000057)
58
59genrule(
Austin Schuh55a13dc2019-01-27 22:39:03 -080060 name = "genrule_arm",
61 outs = [
62 "arm_plant.h",
63 "arm_plant.cc",
64 "integral_arm_plant.h",
65 "integral_arm_plant.cc",
66 ],
67 cmd = "$(location //y2016/control_loops/python:arm) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080068 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080069 tools = [
70 "//y2016/control_loops/python:arm",
71 ],
72 visibility = ["//visibility:private"],
Comran Morshed2ae094e2016-01-23 20:43:20 +000073)
74
75cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080076 name = "superstructure_plants",
77 srcs = [
78 "arm_plant.cc",
79 "intake_plant.cc",
80 "integral_arm_plant.cc",
81 "integral_intake_plant.cc",
82 ],
83 hdrs = [
84 "arm_plant.h",
85 "intake_plant.h",
86 "integral_arm_plant.h",
87 "integral_intake_plant.h",
88 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080089 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080090 deps = [
91 "//frc971/control_loops:state_feedback_loop",
92 ],
Comran Morshed2ae094e2016-01-23 20:43:20 +000093)
94
Comran Morshed25f81a02016-01-23 13:40:10 +000095cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080096 name = "superstructure_lib",
97 srcs = [
98 "superstructure.cc",
99 "superstructure_controls.cc",
100 ],
101 hdrs = [
102 "superstructure.h",
103 "superstructure_controls.h",
104 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800105 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -0800106 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700107 ":superstructure_goal_fbs",
108 ":superstructure_output_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800109 ":superstructure_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700110 ":superstructure_position_fbs",
111 ":superstructure_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800112 "//aos:math",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800113 "//aos/util:trapezoid_profile",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700114 "//frc971/control_loops:control_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800115 "//frc971/control_loops:profiled_subsystem",
116 "//frc971/control_loops:simple_capped_state_feedback_loop",
117 "//frc971/control_loops:state_feedback_loop",
118 "//frc971/zeroing",
119 "//y2016:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700120 "//y2016/queues:ball_detector_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800121 ],
Comran Morshed25f81a02016-01-23 13:40:10 +0000122)
123
124cc_test(
Austin Schuh55a13dc2019-01-27 22:39:03 -0800125 name = "superstructure_lib_test",
126 srcs = [
127 "superstructure_lib_test.cc",
128 ],
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800129 data = ["//y2016:aos_config"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800130 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -0800131 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700132 ":superstructure_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800133 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700134 ":superstructure_output_fbs",
135 ":superstructure_position_fbs",
136 ":superstructure_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800137 "//aos:math",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800138 "//aos/testing:googletest",
139 "//aos/time",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700140 "//frc971/control_loops:control_loop_test",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800141 "//frc971/control_loops:position_sensor_sim",
142 "//frc971/control_loops:team_number_test_environment",
143 ],
Comran Morshed25f81a02016-01-23 13:40:10 +0000144)
145
146cc_binary(
Austin Schuh55a13dc2019-01-27 22:39:03 -0800147 name = "superstructure",
148 srcs = [
149 "superstructure_main.cc",
150 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800151 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -0800152 deps = [
153 ":superstructure_lib",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800154 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700155 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800156 ],
Comran Morshed25f81a02016-01-23 13:40:10 +0000157)