blob: bc22b9624ff5ed7823266fc6b09bfea38e811f09 [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",
13 "//y2020/control_loops/drivetrain:drivetrain",
14 "//y2020/control_loops/superstructure:superstructure",
15 "//y2020/actors:binaries",
16 ],
17)
18
19cc_library(
20 name = "constants",
21 srcs = [
22 "constants.cc",
23 ],
24 hdrs = [
25 "constants.h",
26 ],
27 visibility = ["//visibility:public"],
28 deps = [
29 "//aos/logging",
30 "//aos/mutex",
31 "//aos/network:team_number",
32 "//frc971:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -080033 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
34 "//y2020/control_loops/drivetrain:polydrivetrain_plants",
Austin Schuh9dcd5202020-02-20 20:06:04 -080035 "//y2020/control_loops/superstructure/accelerator:accelerator_plants",
36 "//y2020/control_loops/superstructure/control_panel:control_panel_plants",
37 "//y2020/control_loops/superstructure/finisher:finisher_plants",
Sabina Davisa587fbd2020-01-31 22:11:15 -080038 "//y2020/control_loops/superstructure/hood:hood_plants",
Sabina Davise8d38992020-02-02 15:00:31 -080039 "//y2020/control_loops/superstructure/intake:intake_plants",
Kai Tinkess10943cf2020-02-01 15:49:57 -080040 "//y2020/control_loops/superstructure/turret:turret_plants",
Stephan Massaltd021f972020-01-05 20:41:23 -080041 "@com_google_absl//absl/base",
42 ],
43)
44
45cc_binary(
46 name = "wpilib_interface",
47 srcs = [
48 "wpilib_interface.cc",
49 ],
50 restricted_to = ["//tools:roborio"],
51 deps = [
52 ":constants",
53 "//aos:init",
54 "//aos:make_unique",
55 "//aos:math",
56 "//aos/controls:control_loop",
57 "//aos/events:shm_event_loop",
58 "//aos/logging",
59 "//aos/robot_state:robot_state_fbs",
60 "//aos/stl_mutex",
61 "//aos/time",
62 "//aos/util:log_interval",
63 "//aos/util:phased_loop",
64 "//aos/util:wrapping_counter",
65 "//frc971/autonomous:auto_mode_fbs",
66 "//frc971/control_loops:control_loops_fbs",
67 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
James Kuszmaula244a912020-01-18 13:50:50 -080068 "//frc971/wpilib:ADIS16470",
Stephan Massaltd021f972020-01-05 20:41:23 -080069 "//frc971/wpilib:buffered_pcm",
70 "//frc971/wpilib:drivetrain_writer",
71 "//frc971/wpilib:encoder_and_potentiometer",
72 "//frc971/wpilib:interrupt_edge_counting",
73 "//frc971/wpilib:joystick_sender",
74 "//frc971/wpilib:logging_fbs",
75 "//frc971/wpilib:loop_output_handler",
76 "//frc971/wpilib:pdp_fetcher",
77 "//frc971/wpilib:sensor_reader",
78 "//frc971/wpilib:wpilib_interface",
79 "//frc971/wpilib:wpilib_robot_base",
Alex Perryc4691f52020-02-17 19:20:01 -080080 "//third_party:phoenix",
Stephan Massaltd021f972020-01-05 20:41:23 -080081 "//third_party:wpilib",
82 "//y2020/control_loops/superstructure:superstructure_output_fbs",
83 "//y2020/control_loops/superstructure:superstructure_position_fbs",
84 ],
85)
86
87cc_binary(
88 name = "joystick_reader",
89 srcs = [
90 ":joystick_reader.cc",
91 ],
92 deps = [
93 "//aos:init",
94 "//aos/actions:action_lib",
95 "//aos/input:action_joystick_input",
96 "//aos/input:drivetrain_input",
97 "//aos/input:joystick_input",
98 "//aos/logging",
99 "//frc971/autonomous:auto_fbs",
100 "//frc971/autonomous:base_autonomous_actor",
101 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davisa8fed3d2020-02-22 21:44:57 -0800102 "//y2020:constants",
Stephan Massaltd021f972020-01-05 20:41:23 -0800103 "//y2020/control_loops/drivetrain:drivetrain_base",
104 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
105 "//y2020/control_loops/superstructure:superstructure_status_fbs",
106 ],
107)
108
109aos_config(
110 name = "config",
111 src = "y2020.json",
112 flatbuffers = [
113 "//y2020/control_loops/superstructure:superstructure_goal_fbs",
114 "//y2020/control_loops/superstructure:superstructure_output_fbs",
115 "//y2020/control_loops/superstructure:superstructure_position_fbs",
James Kuszmaula244a912020-01-18 13:50:50 -0800116 "//y2019/control_loops/drivetrain:target_selector_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800117 "//y2020/control_loops/superstructure:superstructure_status_fbs",
Brian Silverman9dd793b2020-01-31 23:52:21 -0800118 "//y2020/vision:vision_fbs",
Brian Silverman967e5df2020-02-09 16:43:34 -0800119 "//y2020/vision/sift:sift_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -0800120 ],
121 visibility = ["//visibility:public"],
122 deps = [
123 "//aos/robot_state:config",
124 "//frc971/autonomous:config",
125 "//frc971/control_loops/drivetrain:config",
126 "//frc971/wpilib:config",
127 ],
128)
129
130py_library(
131 name = "python_init",
132 srcs = ["__init__.py"],
133 visibility = ["//visibility:public"],
134)
Alex Perry5f474f22020-02-01 12:14:24 -0800135
136sh_binary(
137 name = "web_proxy",
138 srcs = ["web_proxy.sh"],
139 data = [
140 ":config.json",
141 "//aos/network:web_proxy_main",
Alex Perry5f474f22020-02-01 12:14:24 -0800142 "//y2020/www:files",
143 "//y2020/www:flatbuffers",
Kai Tinkess10943cf2020-02-01 15:49:57 -0800144 "//y2020/www:main_bundle",
Alex Perry5f474f22020-02-01 12:14:24 -0800145 ],
146)