blob: 9f71e95777ff13d8f69ff9939502808dd164f13e [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,
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,
20 includes = [
21 "//frc971/control_loops:control_loops_fbs_includes",
22 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080023 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070024)
25
26flatbuffer_cc_library(
27 name = "shooter_output_fbs",
28 srcs = [
29 "shooter_output.fbs",
30 ],
31 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080032 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070033)
34
35flatbuffer_cc_library(
36 name = "shooter_status_fbs",
37 srcs = [
38 "shooter_status.fbs",
39 ],
40 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080041 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman8c374e02015-09-06 23:02:21 -040042)
43
Austin Schuh9d4aca82015-11-08 14:41:31 -080044genrule(
Austin Schuh55a13dc2019-01-27 22:39:03 -080045 name = "genrule_shooter",
46 outs = [
47 "shooter_motor_plant.cc",
48 "shooter_motor_plant.h",
49 "unaugmented_shooter_motor_plant.cc",
50 "unaugmented_shooter_motor_plant.h",
51 ],
52 cmd = "$(location //y2014/control_loops/python:shooter) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080053 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080054 tools = [
55 "//y2014/control_loops/python:shooter",
56 ],
57 visibility = ["//visibility:private"],
Austin Schuh9d4aca82015-11-08 14:41:31 -080058)
59
Brian Silverman8c374e02015-09-06 23:02:21 -040060cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080061 name = "shooter_lib",
62 srcs = [
63 "shooter.cc",
64 "shooter_motor_plant.cc",
65 "unaugmented_shooter_motor_plant.cc",
66 ],
67 hdrs = [
68 "shooter.h",
69 "shooter_motor_plant.h",
70 "unaugmented_shooter_motor_plant.h",
71 ],
72 linkopts = [
73 "-lm",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080076 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070077 ":shooter_goal_fbs",
78 ":shooter_output_fbs",
79 ":shooter_position_fbs",
80 ":shooter_status_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080081 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070082 "//frc971/control_loops:control_loops_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080083 "//frc971/control_loops:state_feedback_loop",
84 "//y2014:constants",
85 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040086)
87
Brian Silverman100534c2015-09-07 15:51:23 -040088cc_test(
Austin Schuh55a13dc2019-01-27 22:39:03 -080089 name = "shooter_lib_test",
90 srcs = [
91 "shooter_lib_test.cc",
92 ],
Austin Schuh14d7d3d2020-09-10 18:14:36 -070093 data = ["//y2014: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/controls:control_loop_test",
102 "//aos/testing:googletest",
103 "//frc971/control_loops:state_feedback_loop",
104 "//frc971/control_loops:team_number_test_environment",
105 ],
Brian Silverman8c374e02015-09-06 23:02:21 -0400106)
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 = [
115 ":shooter_lib",
116 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700117 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800118 ],
Brian Silverman8c374e02015-09-06 23:02:21 -0400119)