blob: a2073c9557d09685190cdcefdb71a7e48a749988 [file] [log] [blame]
Austin Schuh55a13dc2019-01-27 22:39:03 -08001package(default_visibility = ["//visibility:public"])
Brian Silverman8c374e02015-09-06 23:02:21 -04002
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Brian Silverman8c374e02015-09-06 23:02:21 -04004
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 includes = [
20 "//frc971/control_loops:control_loops_fbs_includes",
21 ],
22)
23
24flatbuffer_cc_library(
25 name = "shooter_output_fbs",
26 srcs = [
27 "shooter_output.fbs",
28 ],
29 gen_reflections = 1,
30)
31
32flatbuffer_cc_library(
33 name = "shooter_status_fbs",
34 srcs = [
35 "shooter_status.fbs",
36 ],
37 gen_reflections = 1,
Brian Silverman8c374e02015-09-06 23:02:21 -040038)
39
Austin Schuh9d4aca82015-11-08 14:41:31 -080040genrule(
Austin Schuh55a13dc2019-01-27 22:39:03 -080041 name = "genrule_shooter",
42 outs = [
43 "shooter_motor_plant.cc",
44 "shooter_motor_plant.h",
45 "unaugmented_shooter_motor_plant.cc",
46 "unaugmented_shooter_motor_plant.h",
47 ],
48 cmd = "$(location //y2014/control_loops/python:shooter) $(OUTS)",
49 tools = [
50 "//y2014/control_loops/python:shooter",
51 ],
52 visibility = ["//visibility:private"],
Austin Schuh9d4aca82015-11-08 14:41:31 -080053)
54
Brian Silverman8c374e02015-09-06 23:02:21 -040055cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080056 name = "shooter_lib",
57 srcs = [
58 "shooter.cc",
59 "shooter_motor_plant.cc",
60 "unaugmented_shooter_motor_plant.cc",
61 ],
62 hdrs = [
63 "shooter.h",
64 "shooter_motor_plant.h",
65 "unaugmented_shooter_motor_plant.h",
66 ],
67 linkopts = [
68 "-lm",
69 ],
70 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070071 ":shooter_goal_fbs",
72 ":shooter_output_fbs",
73 ":shooter_position_fbs",
74 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080075 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070076 "//frc971/control_loops:control_loops_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080077 "//frc971/control_loops:state_feedback_loop",
78 "//y2014:constants",
79 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040080)
81
Brian Silverman100534c2015-09-07 15:51:23 -040082cc_test(
Austin Schuh55a13dc2019-01-27 22:39:03 -080083 name = "shooter_lib_test",
84 srcs = [
85 "shooter_lib_test.cc",
86 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070087 data = ["//y2014:config.json"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080088 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070089 ":shooter_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080090 ":shooter_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070091 ":shooter_output_fbs",
92 ":shooter_position_fbs",
93 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080094 "//aos/controls:control_loop_test",
95 "//aos/testing:googletest",
96 "//frc971/control_loops:state_feedback_loop",
97 "//frc971/control_loops:team_number_test_environment",
98 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040099)
100
101cc_binary(
Austin Schuh55a13dc2019-01-27 22:39:03 -0800102 name = "shooter",
103 srcs = [
104 "shooter_main.cc",
105 ],
106 deps = [
107 ":shooter_lib",
108 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700109 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800110 ],
Brian Silverman8c374e02015-09-06 23:02:21 -0400111)