blob: 4e23089656bf59fdb43de4708cbed2145b759729 [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Comran Morshed2a97bc82016-01-16 17:27:01 +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 = "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 ],
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 = "shooter_position_fbs",
15 srcs = [
16 "shooter_position.fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080017 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070019)
20
James Kuszmaulf01da392023-12-14 11:22:14 -080021static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070022 name = "shooter_output_fbs",
23 srcs = [
24 "shooter_output.fbs",
25 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080026 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070027)
28
James Kuszmaulf01da392023-12-14 11:22:14 -080029static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070030 name = "shooter_status_fbs",
31 srcs = [
32 "shooter_status.fbs",
33 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080034 target_compatible_with = ["@platforms//os:linux"],
Comran Morshed2a97bc82016-01-16 17:27:01 +000035)
36
37genrule(
Austin Schuh55a13dc2019-01-27 22:39:03 -080038 name = "genrule_shooter",
39 outs = [
40 "shooter_plant.h",
41 "shooter_plant.cc",
42 "shooter_integral_plant.h",
43 "shooter_integral_plant.cc",
44 ],
45 cmd = "$(location //y2016/control_loops/python:shooter) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080046 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080047 tools = [
48 "//y2016/control_loops/python:shooter",
49 ],
50 visibility = ["//visibility:private"],
Comran Morshed2a97bc82016-01-16 17:27:01 +000051)
52
53cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080054 name = "shooter_plants",
55 srcs = [
56 "shooter_integral_plant.cc",
57 "shooter_plant.cc",
58 ],
59 hdrs = [
60 "shooter_integral_plant.h",
61 "shooter_plant.h",
62 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080063 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080064 deps = [
65 "//frc971/control_loops:state_feedback_loop",
66 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +000067)
68
69cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080070 name = "shooter_lib",
71 srcs = [
72 "shooter.cc",
73 ],
74 hdrs = [
75 "shooter.h",
76 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080077 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080078 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070079 ":shooter_goal_fbs",
80 ":shooter_output_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080081 ":shooter_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -070082 ":shooter_position_fbs",
83 ":shooter_status_fbs",
James Kuszmaul61750662021-06-21 21:32:33 -070084 "//frc971/control_loops:control_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -080085 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +000086)
87
88cc_test(
Austin Schuh55a13dc2019-01-27 22:39:03 -080089 name = "shooter_lib_test",
90 srcs = [
91 "shooter_lib_test.cc",
92 ],
Austin Schuhc5fa6d92022-02-25 14:36:28 -080093 data = ["//y2016:aos_config"],
Philipp Schraderdada1072020-11-24 11:34:46 -080094 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080095 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070096 ":shooter_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080097 ":shooter_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070098 ":shooter_output_fbs",
99 ":shooter_position_fbs",
100 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800101 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700102 "//frc971/control_loops:control_loop_test",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800103 "//frc971/control_loops:state_feedback_loop",
104 "//frc971/control_loops:team_number_test_environment",
105 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +0000106)
107
108cc_binary(
Austin Schuh55a13dc2019-01-27 22:39:03 -0800109 name = "shooter",
110 srcs = [
111 "shooter_main.cc",
112 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800113 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -0800114 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700115 ":shooter_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800116 ":shooter_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700117 ":shooter_output_fbs",
118 ":shooter_position_fbs",
119 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800120 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700121 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800122 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +0000123)