blob: aecfd98b8e4e6dc99c870b7fece2a51dce544360 [file] [log] [blame]
Austin Schuh55a13dc2019-01-27 22:39:03 -08001package(default_visibility = ["//visibility:public"])
Comran Morshed25f81a02016-01-23 13:40:10 +00002
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Comran Morshed25f81a02016-01-23 13:40:10 +00004
Alex Perrycb7da4b2019-08-28 19:35:56 -07005flatbuffer_cc_library(
6 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 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070010 gen_reflections = 1,
11)
12
13flatbuffer_cc_library(
14 name = "superstructure_position_fbs",
15 srcs = [
16 "superstructure_position.fbs",
17 ],
18 gen_reflections = 1,
19 includes = [
20 "//frc971/control_loops:control_loops_fbs_includes",
21 ],
22)
23
24flatbuffer_cc_library(
25 name = "superstructure_output_fbs",
26 srcs = [
27 "superstructure_output.fbs",
28 ],
29 gen_reflections = 1,
30)
31
32flatbuffer_cc_library(
33 name = "superstructure_status_fbs",
34 srcs = [
35 "superstructure_status.fbs",
36 ],
37 gen_reflections = 1,
38 includes = [
39 "//frc971/control_loops:control_loops_fbs_includes",
Austin Schuh55a13dc2019-01-27 22:39:03 -080040 ],
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)",
52 tools = [
53 "//y2016/control_loops/python:intake",
54 ],
55 visibility = ["//visibility:private"],
Comran Morshed2ae094e2016-01-23 20:43:20 +000056)
57
58genrule(
Austin Schuh55a13dc2019-01-27 22:39:03 -080059 name = "genrule_arm",
60 outs = [
61 "arm_plant.h",
62 "arm_plant.cc",
63 "integral_arm_plant.h",
64 "integral_arm_plant.cc",
65 ],
66 cmd = "$(location //y2016/control_loops/python:arm) $(OUTS)",
67 tools = [
68 "//y2016/control_loops/python:arm",
69 ],
70 visibility = ["//visibility:private"],
Comran Morshed2ae094e2016-01-23 20:43:20 +000071)
72
73cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080074 name = "superstructure_plants",
75 srcs = [
76 "arm_plant.cc",
77 "intake_plant.cc",
78 "integral_arm_plant.cc",
79 "integral_intake_plant.cc",
80 ],
81 hdrs = [
82 "arm_plant.h",
83 "intake_plant.h",
84 "integral_arm_plant.h",
85 "integral_intake_plant.h",
86 ],
87 deps = [
88 "//frc971/control_loops:state_feedback_loop",
89 ],
Comran Morshed2ae094e2016-01-23 20:43:20 +000090)
91
Comran Morshed25f81a02016-01-23 13:40:10 +000092cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080093 name = "superstructure_lib",
94 srcs = [
95 "superstructure.cc",
96 "superstructure_controls.cc",
97 ],
98 hdrs = [
99 "superstructure.h",
100 "superstructure_controls.h",
101 ],
102 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700103 ":superstructure_goal_fbs",
104 ":superstructure_output_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800105 ":superstructure_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700106 ":superstructure_position_fbs",
107 ":superstructure_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800108 "//aos:math",
109 "//aos/controls:control_loop",
110 "//aos/util:trapezoid_profile",
111 "//frc971/control_loops:profiled_subsystem",
112 "//frc971/control_loops:simple_capped_state_feedback_loop",
113 "//frc971/control_loops:state_feedback_loop",
114 "//frc971/zeroing",
115 "//y2016:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700116 "//y2016/queues:ball_detector_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800117 ],
Comran Morshed25f81a02016-01-23 13:40:10 +0000118)
119
120cc_test(
Austin Schuh55a13dc2019-01-27 22:39:03 -0800121 name = "superstructure_lib_test",
122 srcs = [
123 "superstructure_lib_test.cc",
124 ],
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700125 data = ["//y2016:config"],
Austin Schuh55a13dc2019-01-27 22:39:03 -0800126 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700127 ":superstructure_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800128 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700129 ":superstructure_output_fbs",
130 ":superstructure_position_fbs",
131 ":superstructure_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800132 "//aos:math",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800133 "//aos/controls:control_loop_test",
134 "//aos/testing:googletest",
135 "//aos/time",
136 "//frc971/control_loops:position_sensor_sim",
137 "//frc971/control_loops:team_number_test_environment",
138 ],
Comran Morshed25f81a02016-01-23 13:40:10 +0000139)
140
141cc_binary(
Austin Schuh55a13dc2019-01-27 22:39:03 -0800142 name = "superstructure",
143 srcs = [
144 "superstructure_main.cc",
145 ],
146 deps = [
147 ":superstructure_lib",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800148 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700149 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800150 ],
Comran Morshed25f81a02016-01-23 13:40:10 +0000151)