blob: d9cd4fdd23869d1503934702dce5bdde9da0090e [file] [log] [blame]
Sabina Davis1b84afa2019-02-09 01:20:21 -08001load("//frc971:downloader.bzl", "robot_downloader")
Alex Perrycb7da4b2019-08-28 19:35:56 -07002load("//aos:config.bzl", "aos_config")
Michael Schuh5a1a7582019-03-01 13:03:47 -08003load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
Alex Perrycb7da4b2019-08-28 19:35:56 -07004load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Sabina Davis1b84afa2019-02-09 01:20:21 -08005
6robot_downloader(
Austin Schuhed5b26d2019-12-05 20:51:59 -08007 data = [
8 ":config.json",
9 ],
Austin Schuh635e8bf2019-03-23 18:53:15 -070010 dirs = [
11 "//y2019/vision/server:www_files",
12 ],
Sabina Davis1b84afa2019-02-09 01:20:21 -080013 start_binaries = [
14 ":joystick_reader",
15 ":wpilib_interface",
16 "//y2019/control_loops/drivetrain:drivetrain",
Austin Schuh355f3272019-02-15 23:09:29 -080017 "//y2019/control_loops/superstructure:superstructure",
Austin Schuh986091a2019-03-22 20:35:12 -070018 "//y2019/actors:binaries",
Austin Schuh635e8bf2019-03-23 18:53:15 -070019 "//y2019/vision/server",
Sabina Davis1b84afa2019-02-09 01:20:21 -080020 ],
21)
22
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080023cc_library(
24 name = "constants",
25 srcs = [
26 "constants.cc",
27 ],
28 hdrs = [
29 "constants.h",
30 ],
31 visibility = ["//visibility:public"],
32 deps = [
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080033 "//aos/logging",
34 "//aos/mutex",
35 "//aos/network:team_number",
36 "//frc971:constants",
James Kuszmaul22c5ab32019-02-09 14:45:58 -080037 "//frc971/control_loops:pose",
Theo Bafrali00e42272019-02-12 01:07:46 -080038 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
James Kuszmaul22c5ab32019-02-09 14:45:58 -080039 "//y2019/control_loops/drivetrain:camera",
Sabina Davis7be49f32019-02-02 00:30:19 -080040 "//y2019/control_loops/drivetrain:polydrivetrain_plants",
Alex Perry5fb5ff22019-02-09 21:53:17 -080041 "//y2019/control_loops/superstructure/elevator:elevator_plants",
42 "//y2019/control_loops/superstructure/intake:intake_plants",
43 "//y2019/control_loops/superstructure/stilts:stilts_plants",
Austin Schuhc1d6f832019-02-15 23:22:17 -080044 "//y2019/control_loops/superstructure/wrist:wrist_plants",
James Kuszmaule2c71ea2019-03-04 08:14:21 -080045 "//y2019/vision:constants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080046 "@com_google_absl//absl/base",
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080047 ],
48)
49
Sabina Davisabeae332019-02-01 21:12:57 -080050cc_binary(
51 name = "wpilib_interface",
52 srcs = [
53 "wpilib_interface.cc",
54 ],
55 restricted_to = ["//tools:roborio"],
56 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -080057 ":camera_log_fbs",
Sabina Davis7be49f32019-02-02 00:30:19 -080058 ":constants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080059 ":status_light_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080060 "//aos:init",
61 "//aos:make_unique",
62 "//aos:math",
63 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070064 "//aos/events:shm_event_loop",
Sabina Davisabeae332019-02-01 21:12:57 -080065 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -070066 "//aos/robot_state:robot_state_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080067 "//aos/stl_mutex",
68 "//aos/time",
69 "//aos/util:log_interval",
70 "//aos/util:phased_loop",
71 "//aos/util:wrapping_counter",
Austin Schuhed5b26d2019-12-05 20:51:59 -080072 "//frc971/autonomous:auto_mode_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -070073 "//frc971/control_loops:control_loops_fbs",
74 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080075 "//frc971/wpilib:ADIS16448",
Austin Schuhc1d6f832019-02-15 23:22:17 -080076 "//frc971/wpilib:buffered_pcm",
Sabina Davisd004fd62019-02-02 23:51:46 -080077 "//frc971/wpilib:drivetrain_writer",
Sabina Davisabeae332019-02-01 21:12:57 -080078 "//frc971/wpilib:encoder_and_potentiometer",
79 "//frc971/wpilib:interrupt_edge_counting",
80 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -070081 "//frc971/wpilib:logging_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080082 "//frc971/wpilib:loop_output_handler",
83 "//frc971/wpilib:pdp_fetcher",
Sabina Davisadc58542019-02-01 22:23:00 -080084 "//frc971/wpilib:sensor_reader",
Sabina Davisabeae332019-02-01 21:12:57 -080085 "//frc971/wpilib:wpilib_interface",
86 "//frc971/wpilib:wpilib_robot_base",
Austin Schuhf6b94632019-02-02 22:11:27 -080087 "//third_party:phoenix",
Sabina Davisabeae332019-02-01 21:12:57 -080088 "//third_party:wpilib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070089 "//y2019/control_loops/drivetrain:camera_fbs",
90 "//y2019/control_loops/superstructure:superstructure_output_fbs",
91 "//y2019/control_loops/superstructure:superstructure_position_fbs",
Brian Silvermanf8b75252019-02-24 16:13:58 -080092 "//y2019/jevois:spi",
Sabina Davisabeae332019-02-01 21:12:57 -080093 ],
94)
Sabina Davis1b84afa2019-02-09 01:20:21 -080095
Tyler Chatowd28951f2019-02-16 20:12:28 -080096cc_library(
97 name = "joystick_angle",
98 srcs = [
99 "joystick_angle.cc",
100 ],
101 hdrs = [
102 "joystick_angle.h",
103 ],
104 deps = [
105 "//aos/input:drivetrain_input",
Tyler Chatowc8012ca2019-02-18 22:33:01 -0800106 "//frc971/zeroing:wrap",
Tyler Chatowd28951f2019-02-16 20:12:28 -0800107 ],
108)
109
110cc_test(
111 name = "joystick_angle_test",
112 srcs = [
113 "joystick_angle_test.cc",
114 ],
115 deps = [
116 ":joystick_angle",
117 "//aos/testing:googletest",
118 ],
119)
120
Sabina Davis1b84afa2019-02-09 01:20:21 -0800121cc_binary(
Sabina Davis91b23602019-01-21 00:06:01 -0800122 name = "joystick_reader",
123 srcs = [
124 ":joystick_reader.cc",
125 ],
126 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800127 ":camera_log_fbs",
Tyler Chatowe0241452019-03-08 21:07:50 -0800128 ":vision_proto",
Sabina Davis91b23602019-01-21 00:06:01 -0800129 "//aos:init",
130 "//aos/actions:action_lib",
Sabina Davis1b84afa2019-02-09 01:20:21 -0800131 "//aos/input:action_joystick_input",
Sabina Davis91b23602019-01-21 00:06:01 -0800132 "//aos/input:drivetrain_input",
133 "//aos/input:joystick_input",
Sabina Davis91b23602019-01-21 00:06:01 -0800134 "//aos/logging",
135 "//aos/network:team_number",
136 "//aos/stl_mutex",
137 "//aos/time",
138 "//aos/util:log_interval",
139 "//aos/vision/events:udp",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700140 "//frc971/autonomous:auto_fbs",
Sabina Davis91b23602019-01-21 00:06:01 -0800141 "//frc971/autonomous:base_autonomous_actor",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700142 "//frc971/control_loops:profiled_subsystem_fbs",
143 "//frc971/control_loops/drivetrain:localizer_fbs",
Sabina Davis91b23602019-01-21 00:06:01 -0800144 "//y2019/control_loops/drivetrain:drivetrain_base",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700145 "//y2019/control_loops/drivetrain:target_selector_fbs",
146 "//y2019/control_loops/superstructure:superstructure_goal_fbs",
147 "//y2019/control_loops/superstructure:superstructure_position_fbs",
148 "//y2019/control_loops/superstructure:superstructure_status_fbs",
Tyler Chatowe0241452019-03-08 21:07:50 -0800149 "@com_google_protobuf//:protobuf",
Sabina Davis91b23602019-01-21 00:06:01 -0800150 ],
151)
Sabina Davisabeae332019-02-01 21:12:57 -0800152
Alex Perrycb7da4b2019-08-28 19:35:56 -0700153flatbuffer_cc_library(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800154 name = "camera_log_fbs",
155 srcs = [
156 "camera_log.fbs",
157 ],
158 gen_reflections = 1,
159 visibility = ["//visibility:public"],
160)
161
162flatbuffer_cc_library(
163 name = "status_light_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -0800164 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700165 "status_light.fbs",
166 ],
167 gen_reflections = 1,
168 visibility = ["//visibility:public"],
169)
170
171aos_config(
172 name = "config",
173 src = "y2019.json",
174 flatbuffers = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800175 ":status_light_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700176 "//y2019/control_loops/drivetrain:camera_fbs",
177 "//y2019/control_loops/drivetrain:target_selector_fbs",
178 "//y2019/control_loops/superstructure:superstructure_goal_fbs",
179 "//y2019/control_loops/superstructure:superstructure_output_fbs",
180 "//y2019/control_loops/superstructure:superstructure_position_fbs",
181 "//y2019/control_loops/superstructure:superstructure_status_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800182 ":camera_log_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -0800183 ],
184 visibility = ["//visibility:public"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700185 deps = [
186 "//aos/robot_state:config",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800187 "//frc971/autonomous:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700188 "//frc971/control_loops/drivetrain:config",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800189 "//frc971/wpilib:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700190 ],
Sabina Davisc6329342019-03-01 20:44:42 -0800191)
192
Michael Schuh5a1a7582019-03-01 13:03:47 -0800193cc_proto_library(
194 name = "vision_proto",
195 srcs = ["vision.proto"],
196 visibility = ["//visibility:public"],
197)
198
Michael Schuhab42b0a2019-01-07 16:33:43 -0800199py_library(
200 name = "python_init",
201 srcs = ["__init__.py"],
202 visibility = ["//visibility:public"],
Sabina Davisabeae332019-02-01 21:12:57 -0800203)