blob: d44807ef8311a4dde14296447036a73879589fd3 [file] [log] [blame]
Sabina Davis8d20ca82018-02-19 13:17:45 -08001package(default_visibility = ["//visibility:public"])
Neil Balchd5206fe2018-01-24 20:25:12 -08002
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Neil Balchd5206fe2018-01-24 20:25:12 -08004
Alex Perrycb7da4b2019-08-28 19:35:56 -07005flatbuffer_cc_library(
6 name = "superstructure_goal_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -08007 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -07008 "superstructure_goal.fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -08009 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070010 gen_reflections = 1,
11 includes = [
12 "//frc971/control_loops:control_loops_fbs_includes",
Sabina Davis8d20ca82018-02-19 13:17:45 -080013 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080014 target_compatible_with = ["@platforms//os:linux"],
Neil Balchd5206fe2018-01-24 20:25:12 -080015)
16
Alex Perrycb7da4b2019-08-28 19:35:56 -070017flatbuffer_cc_library(
18 name = "superstructure_position_fbs",
19 srcs = [
20 "superstructure_position.fbs",
21 ],
22 gen_reflections = 1,
23 includes = [
24 "//frc971/control_loops:control_loops_fbs_includes",
25 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080026 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070027)
28
29flatbuffer_cc_library(
30 name = "superstructure_status_fbs",
31 srcs = [
32 "superstructure_status.fbs",
33 ],
34 gen_reflections = 1,
35 includes = [
36 "//frc971/control_loops:control_loops_fbs_includes",
37 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080038 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070039)
40
41flatbuffer_cc_library(
42 name = "superstructure_output_fbs",
43 srcs = [
44 "superstructure_output.fbs",
45 ],
46 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080047 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070048)
49
Sabina Davis8d20ca82018-02-19 13:17:45 -080050cc_library(
51 name = "superstructure_lib",
52 srcs = [
53 "superstructure.cc",
54 ],
55 hdrs = [
56 "superstructure.h",
57 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis8d20ca82018-02-19 13:17:45 -080059 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070060 ":superstructure_goal_fbs",
61 ":superstructure_output_fbs",
62 ":superstructure_position_fbs",
63 ":superstructure_status_fbs",
John Park33858a32018-09-28 23:05:48 -070064 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070065 "//aos/events:event_loop",
66 "//frc971/control_loops:control_loops_fbs",
67 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080068 "//y2018:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -070069 "//y2018:status_light_fbs",
Austin Schuhcb091712018-02-21 20:01:55 -080070 "//y2018/control_loops/superstructure/arm",
Sabina Davis8d20ca82018-02-19 13:17:45 -080071 "//y2018/control_loops/superstructure/intake",
Alex Perrycb7da4b2019-08-28 19:35:56 -070072 "//y2018/vision:vision_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080073 ],
74)
75
76cc_test(
77 name = "superstructure_lib_test",
Austin Schuhe40ea512019-02-09 21:54:25 -080078 timeout = "long",
Sabina Davis8d20ca82018-02-19 13:17:45 -080079 srcs = [
80 "superstructure_lib_test.cc",
81 ],
Austin Schuh14d7d3d2020-09-10 18:14:36 -070082 data = ["//y2018:config"],
Austin Schuh9fe68f72019-08-10 19:32:03 -070083 shard_count = 5,
Philipp Schraderdada1072020-11-24 11:34:46 -080084 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis8d20ca82018-02-19 13:17:45 -080085 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070086 ":superstructure_goal_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080087 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070088 ":superstructure_output_fbs",
89 ":superstructure_position_fbs",
90 ":superstructure_status_fbs",
John Park33858a32018-09-28 23:05:48 -070091 "//aos:math",
John Park33858a32018-09-28 23:05:48 -070092 "//aos/controls:control_loop_test",
Sabina Davis8d20ca82018-02-19 13:17:45 -080093 "//aos/testing:googletest",
Austin Schuhe40ea512019-02-09 21:54:25 -080094 "//aos/time",
Sabina Davis8d20ca82018-02-19 13:17:45 -080095 "//frc971/control_loops:position_sensor_sim",
96 "//frc971/control_loops:team_number_test_environment",
97 "//y2018/control_loops/superstructure/intake:intake_plants",
98 ],
99)
100
101cc_binary(
102 name = "superstructure",
103 srcs = [
104 "superstructure_main.cc",
105 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800106 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis8d20ca82018-02-19 13:17:45 -0800107 deps = [
108 ":superstructure_lib",
John Park398c74a2018-10-20 21:17:39 -0700109 "//aos:init",
Sabina Davis8d20ca82018-02-19 13:17:45 -0800110 ],
111)
Neil Balch6040a352018-03-04 16:02:56 -0800112
113cc_library(
114 name = "debouncer",
Neil Balch6040a352018-03-04 16:02:56 -0800115 srcs = [
116 "debouncer.cc",
117 ],
Austin Schuhe40ea512019-02-09 21:54:25 -0800118 hdrs = [
119 "debouncer.h",
120 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800121 target_compatible_with = ["@platforms//os:linux"],
Neil Balch6040a352018-03-04 16:02:56 -0800122)
123
124cc_test(
125 name = "debouncer_test",
126 srcs = [
127 "debouncer_test.cc",
128 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800129 target_compatible_with = ["@platforms//os:linux"],
Neil Balch6040a352018-03-04 16:02:56 -0800130 deps = [
131 ":debouncer",
132 "//aos/testing:googletest",
133 ],
134)