blob: e286fc78e8dfcf5406c75d811a2e64a73e3f3808 [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 Kuszmaulf4ede202020-02-14 08:47:40 -080039 "//frc971/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 ],
Brian Silverman7be68ba2020-01-08 22:08:40 -080055 # This library uses some deprecated parts of the SPI API.
56 copts = ["-Wno-deprecated-declarations"],
Sabina Davisabeae332019-02-01 21:12:57 -080057 restricted_to = ["//tools:roborio"],
58 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -080059 ":camera_log_fbs",
Sabina Davis7be49f32019-02-02 00:30:19 -080060 ":constants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080061 ":status_light_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080062 "//aos:init",
63 "//aos:make_unique",
64 "//aos:math",
65 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070066 "//aos/events:shm_event_loop",
Sabina Davisabeae332019-02-01 21:12:57 -080067 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -070068 "//aos/robot_state:robot_state_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080069 "//aos/stl_mutex",
70 "//aos/time",
71 "//aos/util:log_interval",
72 "//aos/util:phased_loop",
73 "//aos/util:wrapping_counter",
Austin Schuhed5b26d2019-12-05 20:51:59 -080074 "//frc971/autonomous:auto_mode_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -070075 "//frc971/control_loops:control_loops_fbs",
76 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080077 "//frc971/wpilib:ADIS16448",
Austin Schuhc1d6f832019-02-15 23:22:17 -080078 "//frc971/wpilib:buffered_pcm",
Sabina Davisd004fd62019-02-02 23:51:46 -080079 "//frc971/wpilib:drivetrain_writer",
Sabina Davisabeae332019-02-01 21:12:57 -080080 "//frc971/wpilib:encoder_and_potentiometer",
81 "//frc971/wpilib:interrupt_edge_counting",
82 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -070083 "//frc971/wpilib:logging_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080084 "//frc971/wpilib:loop_output_handler",
85 "//frc971/wpilib:pdp_fetcher",
Sabina Davisadc58542019-02-01 22:23:00 -080086 "//frc971/wpilib:sensor_reader",
Sabina Davisabeae332019-02-01 21:12:57 -080087 "//frc971/wpilib:wpilib_interface",
88 "//frc971/wpilib:wpilib_robot_base",
Austin Schuhf6b94632019-02-02 22:11:27 -080089 "//third_party:phoenix",
Sabina Davisabeae332019-02-01 21:12:57 -080090 "//third_party:wpilib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070091 "//y2019/control_loops/drivetrain:camera_fbs",
92 "//y2019/control_loops/superstructure:superstructure_output_fbs",
93 "//y2019/control_loops/superstructure:superstructure_position_fbs",
Brian Silvermanf8b75252019-02-24 16:13:58 -080094 "//y2019/jevois:spi",
Sabina Davisabeae332019-02-01 21:12:57 -080095 ],
96)
Sabina Davis1b84afa2019-02-09 01:20:21 -080097
Tyler Chatowd28951f2019-02-16 20:12:28 -080098cc_library(
99 name = "joystick_angle",
100 srcs = [
101 "joystick_angle.cc",
102 ],
103 hdrs = [
104 "joystick_angle.h",
105 ],
106 deps = [
107 "//aos/input:drivetrain_input",
Tyler Chatowc8012ca2019-02-18 22:33:01 -0800108 "//frc971/zeroing:wrap",
Tyler Chatowd28951f2019-02-16 20:12:28 -0800109 ],
110)
111
112cc_test(
113 name = "joystick_angle_test",
114 srcs = [
115 "joystick_angle_test.cc",
116 ],
117 deps = [
118 ":joystick_angle",
119 "//aos/testing:googletest",
120 ],
121)
122
Sabina Davis1b84afa2019-02-09 01:20:21 -0800123cc_binary(
Sabina Davis91b23602019-01-21 00:06:01 -0800124 name = "joystick_reader",
125 srcs = [
126 ":joystick_reader.cc",
127 ],
128 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800129 ":camera_log_fbs",
Tyler Chatowe0241452019-03-08 21:07:50 -0800130 ":vision_proto",
Sabina Davis91b23602019-01-21 00:06:01 -0800131 "//aos:init",
132 "//aos/actions:action_lib",
Sabina Davis1b84afa2019-02-09 01:20:21 -0800133 "//aos/input:action_joystick_input",
Sabina Davis91b23602019-01-21 00:06:01 -0800134 "//aos/input:drivetrain_input",
135 "//aos/input:joystick_input",
Sabina Davis91b23602019-01-21 00:06:01 -0800136 "//aos/logging",
137 "//aos/network:team_number",
138 "//aos/stl_mutex",
139 "//aos/time",
140 "//aos/util:log_interval",
141 "//aos/vision/events:udp",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700142 "//frc971/autonomous:auto_fbs",
Sabina Davis91b23602019-01-21 00:06:01 -0800143 "//frc971/autonomous:base_autonomous_actor",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700144 "//frc971/control_loops:profiled_subsystem_fbs",
145 "//frc971/control_loops/drivetrain:localizer_fbs",
Sabina Davis91b23602019-01-21 00:06:01 -0800146 "//y2019/control_loops/drivetrain:drivetrain_base",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700147 "//y2019/control_loops/drivetrain:target_selector_fbs",
148 "//y2019/control_loops/superstructure:superstructure_goal_fbs",
149 "//y2019/control_loops/superstructure:superstructure_position_fbs",
150 "//y2019/control_loops/superstructure:superstructure_status_fbs",
Tyler Chatowe0241452019-03-08 21:07:50 -0800151 "@com_google_protobuf//:protobuf",
Sabina Davis91b23602019-01-21 00:06:01 -0800152 ],
153)
Sabina Davisabeae332019-02-01 21:12:57 -0800154
Alex Perrycb7da4b2019-08-28 19:35:56 -0700155flatbuffer_cc_library(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800156 name = "camera_log_fbs",
157 srcs = [
158 "camera_log.fbs",
159 ],
160 gen_reflections = 1,
161 visibility = ["//visibility:public"],
162)
163
164flatbuffer_cc_library(
165 name = "status_light_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -0800166 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700167 "status_light.fbs",
168 ],
169 gen_reflections = 1,
170 visibility = ["//visibility:public"],
171)
172
173aos_config(
174 name = "config",
175 src = "y2019.json",
176 flatbuffers = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800177 ":status_light_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700178 "//y2019/control_loops/drivetrain:camera_fbs",
179 "//y2019/control_loops/drivetrain:target_selector_fbs",
180 "//y2019/control_loops/superstructure:superstructure_goal_fbs",
181 "//y2019/control_loops/superstructure:superstructure_output_fbs",
182 "//y2019/control_loops/superstructure:superstructure_position_fbs",
183 "//y2019/control_loops/superstructure:superstructure_status_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800184 ":camera_log_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -0800185 ],
186 visibility = ["//visibility:public"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700187 deps = [
188 "//aos/robot_state:config",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800189 "//frc971/autonomous:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700190 "//frc971/control_loops/drivetrain:config",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800191 "//frc971/wpilib:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700192 ],
Sabina Davisc6329342019-03-01 20:44:42 -0800193)
194
Michael Schuh5a1a7582019-03-01 13:03:47 -0800195cc_proto_library(
196 name = "vision_proto",
197 srcs = ["vision.proto"],
198 visibility = ["//visibility:public"],
199)
200
Michael Schuhab42b0a2019-01-07 16:33:43 -0800201py_library(
202 name = "python_init",
203 srcs = ["__init__.py"],
204 visibility = ["//visibility:public"],
Sabina Davisabeae332019-02-01 21:12:57 -0800205)