blob: 794c4fc47b90349ae19223a41ef3007eef1e2f44 [file] [log] [blame]
Austin Schuh55a13dc2019-01-27 22:39:03 -08001package(default_visibility = ["//visibility:public"])
Comran Morshed2a97bc82016-01-16 17:27:01 +00002
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Comran Morshed2a97bc82016-01-16 17:27:01 +00004
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,
11)
12
13flatbuffer_cc_library(
14 name = "shooter_position_fbs",
15 srcs = [
16 "shooter_position.fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080017 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070018 gen_reflections = 1,
19)
20
21flatbuffer_cc_library(
22 name = "shooter_output_fbs",
23 srcs = [
24 "shooter_output.fbs",
25 ],
26 gen_reflections = 1,
27)
28
29flatbuffer_cc_library(
30 name = "shooter_status_fbs",
31 srcs = [
32 "shooter_status.fbs",
33 ],
34 gen_reflections = 1,
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)",
46 tools = [
47 "//y2016/control_loops/python:shooter",
48 ],
49 visibility = ["//visibility:private"],
Comran Morshed2a97bc82016-01-16 17:27:01 +000050)
51
52cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080053 name = "shooter_plants",
54 srcs = [
55 "shooter_integral_plant.cc",
56 "shooter_plant.cc",
57 ],
58 hdrs = [
59 "shooter_integral_plant.h",
60 "shooter_plant.h",
61 ],
62 deps = [
63 "//frc971/control_loops:state_feedback_loop",
64 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +000065)
66
67cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080068 name = "shooter_lib",
69 srcs = [
70 "shooter.cc",
71 ],
72 hdrs = [
73 "shooter.h",
74 ],
75 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070076 ":shooter_goal_fbs",
77 ":shooter_output_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080078 ":shooter_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -070079 ":shooter_position_fbs",
80 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080081 "//aos/controls:control_loop",
82 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +000083)
84
85cc_test(
Austin Schuh55a13dc2019-01-27 22:39:03 -080086 name = "shooter_lib_test",
87 srcs = [
88 "shooter_lib_test.cc",
89 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070090 data = ["//y2016:config.json"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080091 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070092 ":shooter_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080093 ":shooter_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070094 ":shooter_output_fbs",
95 ":shooter_position_fbs",
96 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080097 "//aos/controls:control_loop_test",
98 "//aos/testing:googletest",
99 "//frc971/control_loops:state_feedback_loop",
100 "//frc971/control_loops:team_number_test_environment",
101 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +0000102)
103
104cc_binary(
Austin Schuh55a13dc2019-01-27 22:39:03 -0800105 name = "shooter",
106 srcs = [
107 "shooter_main.cc",
108 ],
109 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700110 ":shooter_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800111 ":shooter_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700112 ":shooter_output_fbs",
113 ":shooter_position_fbs",
114 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800115 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700116 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800117 ],
Comran Morshed2a97bc82016-01-16 17:27:01 +0000118)