blob: 5b7560ddfbc6cb633d4ff89f0f544b2941c91d8f [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",
Jim Ostrowskibaa43692020-03-08 16:25:10 -070027 binaries = [
28 "//y2020/vision:viewer",
29 ],
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080030 data = [
31 ":config.json",
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080032 ],
33 dirs = [
34 "//y2020/www:www_files",
35 ],
36 restricted_to = ["//tools:armhf-debian"],
37 start_binaries = [
38 "//aos/network:message_bridge_client",
39 "//aos/network:message_bridge_server",
40 "//y2020/vision:camera_reader",
41 "//aos/network:web_proxy_main",
42 ],
43 target_type = "pi",
44)
45
Stephan Massaltd021f972020-01-05 20:41:23 -080046cc_library(
47 name = "constants",
48 srcs = [
49 "constants.cc",
50 ],
51 hdrs = [
52 "constants.h",
53 ],
54 visibility = ["//visibility:public"],
55 deps = [
56 "//aos/logging",
57 "//aos/mutex",
58 "//aos/network:team_number",
59 "//frc971:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -080060 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
61 "//y2020/control_loops/drivetrain:polydrivetrain_plants",
Austin Schuh9dcd5202020-02-20 20:06:04 -080062 "//y2020/control_loops/superstructure/accelerator:accelerator_plants",
63 "//y2020/control_loops/superstructure/control_panel:control_panel_plants",
64 "//y2020/control_loops/superstructure/finisher:finisher_plants",
Sabina Davisa587fbd2020-01-31 22:11:15 -080065 "//y2020/control_loops/superstructure/hood:hood_plants",
Sabina Davise8d38992020-02-02 15:00:31 -080066 "//y2020/control_loops/superstructure/intake:intake_plants",
Kai Tinkess10943cf2020-02-01 15:49:57 -080067 "//y2020/control_loops/superstructure/turret:turret_plants",
Stephan Massaltd021f972020-01-05 20:41:23 -080068 "@com_google_absl//absl/base",
69 ],
70)
71
72cc_binary(
73 name = "wpilib_interface",
74 srcs = [
75 "wpilib_interface.cc",
76 ],
77 restricted_to = ["//tools:roborio"],
78 deps = [
79 ":constants",
80 "//aos:init",
81 "//aos:make_unique",
82 "//aos:math",
83 "//aos/controls:control_loop",
84 "//aos/events:shm_event_loop",
85 "//aos/logging",
86 "//aos/robot_state:robot_state_fbs",
87 "//aos/stl_mutex",
88 "//aos/time",
89 "//aos/util:log_interval",
90 "//aos/util:phased_loop",
91 "//aos/util:wrapping_counter",
92 "//frc971/autonomous:auto_mode_fbs",
93 "//frc971/control_loops:control_loops_fbs",
94 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
James Kuszmaula244a912020-01-18 13:50:50 -080095 "//frc971/wpilib:ADIS16470",
Stephan Massaltd021f972020-01-05 20:41:23 -080096 "//frc971/wpilib:buffered_pcm",
97 "//frc971/wpilib:drivetrain_writer",
98 "//frc971/wpilib:encoder_and_potentiometer",
99 "//frc971/wpilib:interrupt_edge_counting",
100 "//frc971/wpilib:joystick_sender",
101 "//frc971/wpilib:logging_fbs",
102 "//frc971/wpilib:loop_output_handler",
103 "//frc971/wpilib:pdp_fetcher",
104 "//frc971/wpilib:sensor_reader",
105 "//frc971/wpilib:wpilib_interface",
106 "//frc971/wpilib:wpilib_robot_base",
Alex Perryc4691f52020-02-17 19:20:01 -0800107 "//third_party:phoenix",
Stephan Massaltd021f972020-01-05 20:41:23 -0800108 "//third_party:wpilib",
109 "//y2020/control_loops/superstructure:superstructure_output_fbs",
110 "//y2020/control_loops/superstructure:superstructure_position_fbs",
111 ],
112)
113
114cc_binary(
115 name = "joystick_reader",
116 srcs = [
117 ":joystick_reader.cc",
118 ],
119 deps = [
Austin Schuhd58b2902020-03-01 19:28:04 -0800120 ":setpoint_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800121 "//aos:init",
122 "//aos/actions:action_lib",
123 "//aos/input:action_joystick_input",
124 "//aos/input:drivetrain_input",
125 "//aos/input:joystick_input",
126 "//aos/logging",
127 "//frc971/autonomous:auto_fbs",
128 "//frc971/autonomous:base_autonomous_actor",
129 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davisa8fed3d2020-02-22 21:44:57 -0800130 "//y2020:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -0800131 "//y2020/control_loops/drivetrain:drivetrain_base",
132 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
133 "//y2020/control_loops/superstructure:superstructure_status_fbs",
134 ],
135)
136
137aos_config(
138 name = "config",
139 src = "y2020.json",
140 flatbuffers = [
Austin Schuhd58b2902020-03-01 19:28:04 -0800141 ":setpoint_fbs",
Austin Schuh6aa77be2020-02-22 21:06:40 -0800142 "//aos/network:message_bridge_client_fbs",
143 "//aos/network:message_bridge_server_fbs",
144 "//aos/network:timestamp_fbs",
145 "//y2019/control_loops/drivetrain:target_selector_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800146 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
147 "//y2020/control_loops/superstructure:superstructure_output_fbs",
148 "//y2020/control_loops/superstructure:superstructure_position_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800149 "//y2020/control_loops/superstructure:superstructure_status_fbs",
Brian Silverman967e5df2020-02-09 16:43:34 -0800150 "//y2020/vision/sift:sift_fbs",
Brian Silverman62956e72020-02-26 21:04:05 -0800151 "//y2020/vision/sift:sift_training_fbs",
Austin Schuh6aa77be2020-02-22 21:06:40 -0800152 "//y2020/vision:vision_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800153 ],
154 visibility = ["//visibility:public"],
155 deps = [
156 "//aos/robot_state:config",
157 "//frc971/autonomous:config",
158 "//frc971/control_loops/drivetrain:config",
159 "//frc971/wpilib:config",
160 ],
161)
162
163py_library(
164 name = "python_init",
165 srcs = ["__init__.py"],
166 visibility = ["//visibility:public"],
167)
Alex Perry5f474f22020-02-01 12:14:24 -0800168
169sh_binary(
170 name = "web_proxy",
171 srcs = ["web_proxy.sh"],
172 data = [
173 ":config.json",
Alex Perry5427c9a2020-02-15 17:43:45 -0800174 "//y2020/www:field_main_bundle",
Alex Perry5f474f22020-02-01 12:14:24 -0800175 "//aos/network:web_proxy_main",
Alex Perry5f474f22020-02-01 12:14:24 -0800176 "//y2020/www:files",
177 "//y2020/www:flatbuffers",
Alex Perrya24127d2020-03-06 21:00:32 -0800178 "//y2020/www:camera_main_bundle",
Alex Perry5f474f22020-02-01 12:14:24 -0800179 ],
180)
Austin Schuhd58b2902020-03-01 19:28:04 -0800181
182load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
183
184flatbuffer_cc_library(
185 name = "setpoint_fbs",
186 srcs = [
187 "setpoint.fbs",
188 ],
189 gen_reflections = 1,
190)
191
192cc_binary(
193 name = "setpoint_setter",
194 srcs = ["setpoint_setter.cc"],
195 deps = [
196 ":setpoint_fbs",
197 "//aos:init",
198 "//aos/events:shm_event_loop",
199 ],
200)