blob: 6f8d7e1eb8c1ac578427f66641b1f7d8460d8fa6 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Comran Morshed2a97bc82016-01-16 17:27:01 +00002
Philipp Schradercc016b32021-12-30 08:59:58 -08003package(default_visibility = ["//visibility:public"])
4
Alex Perrycb7da4b2019-08-28 19:35:56 -07005flatbuffer_cc_library(
6 name = "shooter_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -08007 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -07008 "shooter_goal.fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -08009 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070010 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080011 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070012)
13
14flatbuffer_cc_library(
15 name = "shooter_position_fbs",
16 srcs = [
17 "shooter_position.fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080018 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070019 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080020 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070021)
22
23flatbuffer_cc_library(
24 name = "shooter_output_fbs",
25 srcs = [
26 "shooter_output.fbs",
27 ],
28 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080029 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070030)
31
32flatbuffer_cc_library(
33 name = "shooter_status_fbs",
34 srcs = [
35 "shooter_status.fbs",
36 ],
37 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080038 target_compatible_with = ["@platforms//os:linux"],
Comran Morshed2a97bc82016-01-16 17:27:01 +000039)
40
41genrule(
Austin Schuh55a13dc2019-01-27 22:39:03 -080042 name = "genrule_shooter",
43 outs = [
44 "shooter_plant.h",
45 "shooter_plant.cc",
46 "shooter_integral_plant.h",
47 "shooter_integral_plant.cc",
48 ],
49 cmd = "$(location //y2016/control_loops/python:shooter) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080050 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080051 tools = [
52 "//y2016/control_loops/python:shooter",
53 ],
54 visibility = ["//visibility:private"],
Comran Morshed2a97bc82016-01-16 17:27:01 +000055)
56
57cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080058 name = "shooter_plants",
59 srcs = [
60 "shooter_integral_plant.cc",
61 "shooter_plant.cc",
62 ],
63 hdrs = [
64 "shooter_integral_plant.h",
65 "shooter_plant.h",
66 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080067 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080068 deps = [
69 "//frc971/control_loops:state_feedback_loop",
70 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +000071)
72
73cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080074 name = "shooter_lib",
75 srcs = [
76 "shooter.cc",
77 ],
78 hdrs = [
79 "shooter.h",
80 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080081 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080082 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070083 ":shooter_goal_fbs",
84 ":shooter_output_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080085 ":shooter_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -070086 ":shooter_position_fbs",
87 ":shooter_status_fbs",
James Kuszmaul61750662021-06-21 21:32:33 -070088 "//frc971/control_loops:control_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -080089 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +000090)
91
92cc_test(
Austin Schuh55a13dc2019-01-27 22:39:03 -080093 name = "shooter_lib_test",
94 srcs = [
95 "shooter_lib_test.cc",
96 ],
Austin Schuhc5fa6d92022-02-25 14:36:28 -080097 data = ["//y2016:aos_config"],
Philipp Schraderdada1072020-11-24 11:34:46 -080098 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080099 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700100 ":shooter_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800101 ":shooter_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700102 ":shooter_output_fbs",
103 ":shooter_position_fbs",
104 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800105 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700106 "//frc971/control_loops:control_loop_test",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800107 "//frc971/control_loops:state_feedback_loop",
108 "//frc971/control_loops:team_number_test_environment",
109 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +0000110)
111
112cc_binary(
Austin Schuh55a13dc2019-01-27 22:39:03 -0800113 name = "shooter",
114 srcs = [
115 "shooter_main.cc",
116 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800117 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -0800118 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700119 ":shooter_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800120 ":shooter_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700121 ":shooter_output_fbs",
122 ":shooter_position_fbs",
123 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800124 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700125 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800126 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +0000127)