blob: aa5f16e967ee8d45dde002ddfe8e4af65b78e4a5 [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 = [
11 ":joystick_reader",
12 ":wpilib_interface",
Austin Schuh6aa77be2020-02-22 21:06:40 -080013 "//aos/network:message_bridge_client",
14 "//aos/network:message_bridge_server",
15 "//y2020/actors:binaries",
Stephan Massaltd021f972020-01-05 20:41:23 -080016 "//y2020/control_loops/drivetrain:drivetrain",
17 "//y2020/control_loops/superstructure:superstructure",
Stephan Massaltd021f972020-01-05 20:41:23 -080018 ],
19)
20
21cc_library(
22 name = "constants",
23 srcs = [
24 "constants.cc",
25 ],
26 hdrs = [
27 "constants.h",
28 ],
29 visibility = ["//visibility:public"],
30 deps = [
31 "//aos/logging",
32 "//aos/mutex",
33 "//aos/network:team_number",
34 "//frc971:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -080035 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
36 "//y2020/control_loops/drivetrain:polydrivetrain_plants",
Austin Schuh9dcd5202020-02-20 20:06:04 -080037 "//y2020/control_loops/superstructure/accelerator:accelerator_plants",
38 "//y2020/control_loops/superstructure/control_panel:control_panel_plants",
39 "//y2020/control_loops/superstructure/finisher:finisher_plants",
Sabina Davisa587fbd2020-01-31 22:11:15 -080040 "//y2020/control_loops/superstructure/hood:hood_plants",
Sabina Davise8d38992020-02-02 15:00:31 -080041 "//y2020/control_loops/superstructure/intake:intake_plants",
Kai Tinkess10943cf2020-02-01 15:49:57 -080042 "//y2020/control_loops/superstructure/turret:turret_plants",
Stephan Massaltd021f972020-01-05 20:41:23 -080043 "@com_google_absl//absl/base",
44 ],
45)
46
47cc_binary(
48 name = "wpilib_interface",
49 srcs = [
50 "wpilib_interface.cc",
51 ],
52 restricted_to = ["//tools:roborio"],
53 deps = [
54 ":constants",
55 "//aos:init",
56 "//aos:make_unique",
57 "//aos:math",
58 "//aos/controls:control_loop",
59 "//aos/events:shm_event_loop",
60 "//aos/logging",
61 "//aos/robot_state:robot_state_fbs",
62 "//aos/stl_mutex",
63 "//aos/time",
64 "//aos/util:log_interval",
65 "//aos/util:phased_loop",
66 "//aos/util:wrapping_counter",
67 "//frc971/autonomous:auto_mode_fbs",
68 "//frc971/control_loops:control_loops_fbs",
69 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
James Kuszmaula244a912020-01-18 13:50:50 -080070 "//frc971/wpilib:ADIS16470",
Stephan Massaltd021f972020-01-05 20:41:23 -080071 "//frc971/wpilib:buffered_pcm",
72 "//frc971/wpilib:drivetrain_writer",
73 "//frc971/wpilib:encoder_and_potentiometer",
74 "//frc971/wpilib:interrupt_edge_counting",
75 "//frc971/wpilib:joystick_sender",
76 "//frc971/wpilib:logging_fbs",
77 "//frc971/wpilib:loop_output_handler",
78 "//frc971/wpilib:pdp_fetcher",
79 "//frc971/wpilib:sensor_reader",
80 "//frc971/wpilib:wpilib_interface",
81 "//frc971/wpilib:wpilib_robot_base",
Alex Perryc4691f52020-02-17 19:20:01 -080082 "//third_party:phoenix",
Stephan Massaltd021f972020-01-05 20:41:23 -080083 "//third_party:wpilib",
84 "//y2020/control_loops/superstructure:superstructure_output_fbs",
85 "//y2020/control_loops/superstructure:superstructure_position_fbs",
86 ],
87)
88
89cc_binary(
90 name = "joystick_reader",
91 srcs = [
92 ":joystick_reader.cc",
93 ],
94 deps = [
95 "//aos:init",
96 "//aos/actions:action_lib",
97 "//aos/input:action_joystick_input",
98 "//aos/input:drivetrain_input",
99 "//aos/input:joystick_input",
100 "//aos/logging",
101 "//frc971/autonomous:auto_fbs",
102 "//frc971/autonomous:base_autonomous_actor",
103 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davisa8fed3d2020-02-22 21:44:57 -0800104 "//y2020:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -0800105 "//y2020/control_loops/drivetrain:drivetrain_base",
106 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
107 "//y2020/control_loops/superstructure:superstructure_status_fbs",
108 ],
109)
110
111aos_config(
112 name = "config",
113 src = "y2020.json",
114 flatbuffers = [
Austin Schuh6aa77be2020-02-22 21:06:40 -0800115 "//aos/network:message_bridge_client_fbs",
116 "//aos/network:message_bridge_server_fbs",
117 "//aos/network:timestamp_fbs",
118 "//y2019/control_loops/drivetrain:target_selector_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800119 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
120 "//y2020/control_loops/superstructure:superstructure_output_fbs",
121 "//y2020/control_loops/superstructure:superstructure_position_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800122 "//y2020/control_loops/superstructure:superstructure_status_fbs",
Brian Silverman967e5df2020-02-09 16:43:34 -0800123 "//y2020/vision/sift:sift_fbs",
Austin Schuh6aa77be2020-02-22 21:06:40 -0800124 "//y2020/vision:vision_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800125 ],
126 visibility = ["//visibility:public"],
127 deps = [
128 "//aos/robot_state:config",
129 "//frc971/autonomous:config",
130 "//frc971/control_loops/drivetrain:config",
131 "//frc971/wpilib:config",
132 ],
133)
134
135py_library(
136 name = "python_init",
137 srcs = ["__init__.py"],
138 visibility = ["//visibility:public"],
139)
Alex Perry5f474f22020-02-01 12:14:24 -0800140
141sh_binary(
142 name = "web_proxy",
143 srcs = ["web_proxy.sh"],
144 data = [
145 ":config.json",
146 "//aos/network:web_proxy_main",
Alex Perry5f474f22020-02-01 12:14:24 -0800147 "//y2020/www:files",
148 "//y2020/www:flatbuffers",
Kai Tinkess10943cf2020-02-01 15:49:57 -0800149 "//y2020/www:main_bundle",
Alex Perry5f474f22020-02-01 12:14:24 -0800150 ],
151)