blob: 320a0cf8bff8e96dd69d0dce35f461794014c1d3 [file] [log] [blame]
Stephan Massaltd021f972020-01-05 20:41:23 -08001load("//frc971:downloader.bzl", "robot_downloader")
2load("//aos:config.bzl", "aos_config")
3load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
4load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
5
6robot_downloader(
Austin Schuhd58b2902020-03-01 19:28:04 -08007 binaries = [
8 ":setpoint_setter",
9 ],
Stephan Massaltd021f972020-01-05 20:41:23 -080010 data = [
11 ":config.json",
12 ],
13 start_binaries = [
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080014 "//aos/events/logging:logger_main",
Stephan Massaltd021f972020-01-05 20:41:23 -080015 ":joystick_reader",
16 ":wpilib_interface",
Austin Schuh6aa77be2020-02-22 21:06:40 -080017 "//aos/network:message_bridge_client",
18 "//aos/network:message_bridge_server",
19 "//y2020/actors:binaries",
Stephan Massaltd021f972020-01-05 20:41:23 -080020 "//y2020/control_loops/drivetrain:drivetrain",
21 "//y2020/control_loops/superstructure:superstructure",
Stephan Massaltd021f972020-01-05 20:41:23 -080022 ],
23)
24
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080025robot_downloader(
26 name = "pi_download",
27 data = [
28 ":config.json",
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080029 ],
30 dirs = [
31 "//y2020/www:www_files",
32 ],
33 restricted_to = ["//tools:armhf-debian"],
34 start_binaries = [
35 "//aos/network:message_bridge_client",
36 "//aos/network:message_bridge_server",
37 "//y2020/vision:camera_reader",
38 "//aos/network:web_proxy_main",
39 ],
40 target_type = "pi",
41)
42
Stephan Massaltd021f972020-01-05 20:41:23 -080043cc_library(
44 name = "constants",
45 srcs = [
46 "constants.cc",
47 ],
48 hdrs = [
49 "constants.h",
50 ],
51 visibility = ["//visibility:public"],
52 deps = [
53 "//aos/logging",
54 "//aos/mutex",
55 "//aos/network:team_number",
56 "//frc971:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -080057 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
58 "//y2020/control_loops/drivetrain:polydrivetrain_plants",
Austin Schuh9dcd5202020-02-20 20:06:04 -080059 "//y2020/control_loops/superstructure/accelerator:accelerator_plants",
60 "//y2020/control_loops/superstructure/control_panel:control_panel_plants",
61 "//y2020/control_loops/superstructure/finisher:finisher_plants",
Sabina Davisa587fbd2020-01-31 22:11:15 -080062 "//y2020/control_loops/superstructure/hood:hood_plants",
Sabina Davise8d38992020-02-02 15:00:31 -080063 "//y2020/control_loops/superstructure/intake:intake_plants",
Kai Tinkess10943cf2020-02-01 15:49:57 -080064 "//y2020/control_loops/superstructure/turret:turret_plants",
Stephan Massaltd021f972020-01-05 20:41:23 -080065 "@com_google_absl//absl/base",
66 ],
67)
68
69cc_binary(
70 name = "wpilib_interface",
71 srcs = [
72 "wpilib_interface.cc",
73 ],
74 restricted_to = ["//tools:roborio"],
75 deps = [
76 ":constants",
77 "//aos:init",
78 "//aos:make_unique",
79 "//aos:math",
80 "//aos/controls:control_loop",
81 "//aos/events:shm_event_loop",
82 "//aos/logging",
83 "//aos/robot_state:robot_state_fbs",
84 "//aos/stl_mutex",
85 "//aos/time",
86 "//aos/util:log_interval",
87 "//aos/util:phased_loop",
88 "//aos/util:wrapping_counter",
89 "//frc971/autonomous:auto_mode_fbs",
90 "//frc971/control_loops:control_loops_fbs",
91 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
James Kuszmaula244a912020-01-18 13:50:50 -080092 "//frc971/wpilib:ADIS16470",
Stephan Massaltd021f972020-01-05 20:41:23 -080093 "//frc971/wpilib:buffered_pcm",
94 "//frc971/wpilib:drivetrain_writer",
95 "//frc971/wpilib:encoder_and_potentiometer",
96 "//frc971/wpilib:interrupt_edge_counting",
97 "//frc971/wpilib:joystick_sender",
98 "//frc971/wpilib:logging_fbs",
99 "//frc971/wpilib:loop_output_handler",
100 "//frc971/wpilib:pdp_fetcher",
101 "//frc971/wpilib:sensor_reader",
102 "//frc971/wpilib:wpilib_interface",
103 "//frc971/wpilib:wpilib_robot_base",
Alex Perryc4691f52020-02-17 19:20:01 -0800104 "//third_party:phoenix",
Stephan Massaltd021f972020-01-05 20:41:23 -0800105 "//third_party:wpilib",
106 "//y2020/control_loops/superstructure:superstructure_output_fbs",
107 "//y2020/control_loops/superstructure:superstructure_position_fbs",
108 ],
109)
110
111cc_binary(
112 name = "joystick_reader",
113 srcs = [
114 ":joystick_reader.cc",
115 ],
116 deps = [
Austin Schuhd58b2902020-03-01 19:28:04 -0800117 ":setpoint_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800118 "//aos:init",
119 "//aos/actions:action_lib",
120 "//aos/input:action_joystick_input",
121 "//aos/input:drivetrain_input",
122 "//aos/input:joystick_input",
123 "//aos/logging",
124 "//frc971/autonomous:auto_fbs",
125 "//frc971/autonomous:base_autonomous_actor",
126 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davisa8fed3d2020-02-22 21:44:57 -0800127 "//y2020:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -0800128 "//y2020/control_loops/drivetrain:drivetrain_base",
129 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
130 "//y2020/control_loops/superstructure:superstructure_status_fbs",
131 ],
132)
133
134aos_config(
135 name = "config",
136 src = "y2020.json",
137 flatbuffers = [
Austin Schuhd58b2902020-03-01 19:28:04 -0800138 ":setpoint_fbs",
Austin Schuh6aa77be2020-02-22 21:06:40 -0800139 "//aos/network:message_bridge_client_fbs",
140 "//aos/network:message_bridge_server_fbs",
141 "//aos/network:timestamp_fbs",
142 "//y2019/control_loops/drivetrain:target_selector_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800143 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
144 "//y2020/control_loops/superstructure:superstructure_output_fbs",
145 "//y2020/control_loops/superstructure:superstructure_position_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800146 "//y2020/control_loops/superstructure:superstructure_status_fbs",
Brian Silverman967e5df2020-02-09 16:43:34 -0800147 "//y2020/vision/sift:sift_fbs",
Brian Silverman62956e72020-02-26 21:04:05 -0800148 "//y2020/vision/sift:sift_training_fbs",
Austin Schuh6aa77be2020-02-22 21:06:40 -0800149 "//y2020/vision:vision_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800150 ],
151 visibility = ["//visibility:public"],
152 deps = [
153 "//aos/robot_state:config",
154 "//frc971/autonomous:config",
155 "//frc971/control_loops/drivetrain:config",
156 "//frc971/wpilib:config",
157 ],
158)
159
160py_library(
161 name = "python_init",
162 srcs = ["__init__.py"],
163 visibility = ["//visibility:public"],
164)
Alex Perry5f474f22020-02-01 12:14:24 -0800165
166sh_binary(
167 name = "web_proxy",
168 srcs = ["web_proxy.sh"],
169 data = [
170 ":config.json",
Alex Perry5427c9a2020-02-15 17:43:45 -0800171 "//y2020/www:field_main_bundle",
Alex Perry5f474f22020-02-01 12:14:24 -0800172 "//aos/network:web_proxy_main",
Alex Perry5f474f22020-02-01 12:14:24 -0800173 "//y2020/www:files",
174 "//y2020/www:flatbuffers",
Alex Perrya24127d2020-03-06 21:00:32 -0800175 "//y2020/www:camera_main_bundle",
Alex Perry5f474f22020-02-01 12:14:24 -0800176 ],
177)
Austin Schuhd58b2902020-03-01 19:28:04 -0800178
179load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
180
181flatbuffer_cc_library(
182 name = "setpoint_fbs",
183 srcs = [
184 "setpoint.fbs",
185 ],
186 gen_reflections = 1,
187)
188
189cc_binary(
190 name = "setpoint_setter",
191 srcs = ["setpoint_setter.cc"],
192 deps = [
193 ":setpoint_fbs",
194 "//aos:init",
195 "//aos/events:shm_event_loop",
196 ],
197)