blob: f3ea4d658b230b1434519c0cc6e37131f3fee238 [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(
7 data = [
8 ":config.json",
9 ],
10 start_binaries = [
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080011 "//aos/events/logging:logger_main",
Stephan Massaltd021f972020-01-05 20:41:23 -080012 ":joystick_reader",
13 ":wpilib_interface",
Austin Schuh6aa77be2020-02-22 21:06:40 -080014 "//aos/network:message_bridge_client",
15 "//aos/network:message_bridge_server",
16 "//y2020/actors:binaries",
Stephan Massaltd021f972020-01-05 20:41:23 -080017 "//y2020/control_loops/drivetrain:drivetrain",
18 "//y2020/control_loops/superstructure:superstructure",
Stephan Massaltd021f972020-01-05 20:41:23 -080019 ],
20)
21
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080022robot_downloader(
23 name = "pi_download",
24 data = [
25 ":config.json",
26 "//y2020/www:files",
27 "//y2020/www:flatbuffers",
28 "//y2020/www:main_bundle",
29 ],
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 = [
117 "//aos:init",
118 "//aos/actions:action_lib",
119 "//aos/input:action_joystick_input",
120 "//aos/input:drivetrain_input",
121 "//aos/input:joystick_input",
122 "//aos/logging",
123 "//frc971/autonomous:auto_fbs",
124 "//frc971/autonomous:base_autonomous_actor",
125 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davisa8fed3d2020-02-22 21:44:57 -0800126 "//y2020:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -0800127 "//y2020/control_loops/drivetrain:drivetrain_base",
128 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
129 "//y2020/control_loops/superstructure:superstructure_status_fbs",
130 ],
131)
132
133aos_config(
134 name = "config",
135 src = "y2020.json",
136 flatbuffers = [
Austin Schuh6aa77be2020-02-22 21:06:40 -0800137 "//aos/network:message_bridge_client_fbs",
138 "//aos/network:message_bridge_server_fbs",
139 "//aos/network:timestamp_fbs",
140 "//y2019/control_loops/drivetrain:target_selector_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800141 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
142 "//y2020/control_loops/superstructure:superstructure_output_fbs",
143 "//y2020/control_loops/superstructure:superstructure_position_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800144 "//y2020/control_loops/superstructure:superstructure_status_fbs",
Brian Silverman967e5df2020-02-09 16:43:34 -0800145 "//y2020/vision/sift:sift_fbs",
Brian Silverman62956e72020-02-26 21:04:05 -0800146 "//y2020/vision/sift:sift_training_fbs",
Austin Schuh6aa77be2020-02-22 21:06:40 -0800147 "//y2020/vision:vision_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800148 ],
149 visibility = ["//visibility:public"],
150 deps = [
151 "//aos/robot_state:config",
152 "//frc971/autonomous:config",
153 "//frc971/control_loops/drivetrain:config",
154 "//frc971/wpilib:config",
155 ],
156)
157
158py_library(
159 name = "python_init",
160 srcs = ["__init__.py"],
161 visibility = ["//visibility:public"],
162)
Alex Perry5f474f22020-02-01 12:14:24 -0800163
164sh_binary(
165 name = "web_proxy",
166 srcs = ["web_proxy.sh"],
167 data = [
168 ":config.json",
169 "//aos/network:web_proxy_main",
Alex Perry5f474f22020-02-01 12:14:24 -0800170 "//y2020/www:files",
171 "//y2020/www:flatbuffers",
Kai Tinkess10943cf2020-02-01 15:49:57 -0800172 "//y2020/www:main_bundle",
Alex Perry5f474f22020-02-01 12:14:24 -0800173 ],
174)