blob: d38881999863098b4f3876174ca33ce2de34900b [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 = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -08008 ":aos_config",
Austin Schuhde605f12022-02-23 23:08:19 -08009 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
10 "@ctre_phoenix_cci_athena//:shared_libraries",
Austin Schuhed5b26d2019-12-05 20:51:59 -080011 ],
Austin Schuh635e8bf2019-03-23 18:53:15 -070012 dirs = [
13 "//y2019/vision/server:www_files",
14 ],
Sabina Davis1b84afa2019-02-09 01:20:21 -080015 start_binaries = [
16 ":joystick_reader",
17 ":wpilib_interface",
18 "//y2019/control_loops/drivetrain:drivetrain",
James Kuszmaul75a18c52021-03-10 22:02:07 -080019 "//y2019/control_loops/drivetrain:trajectory_generator",
Austin Schuh355f3272019-02-15 23:09:29 -080020 "//y2019/control_loops/superstructure:superstructure",
Austin Schuh986091a2019-03-22 20:35:12 -070021 "//y2019/actors:binaries",
Austin Schuh635e8bf2019-03-23 18:53:15 -070022 "//y2019/vision/server",
Sabina Davis1b84afa2019-02-09 01:20:21 -080023 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080024 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis1b84afa2019-02-09 01:20:21 -080025)
26
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080027cc_library(
28 name = "constants",
29 srcs = [
30 "constants.cc",
31 ],
32 hdrs = [
33 "constants.h",
34 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080035 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080036 visibility = ["//visibility:public"],
37 deps = [
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080038 "//aos/network:team_number",
Brian Silverman1463c092020-10-30 17:28:24 -070039 "//aos/stl_mutex",
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080040 "//frc971:constants",
James Kuszmaul22c5ab32019-02-09 14:45:58 -080041 "//frc971/control_loops:pose",
Theo Bafrali00e42272019-02-12 01:07:46 -080042 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
James Kuszmaulf4ede202020-02-14 08:47:40 -080043 "//frc971/control_loops/drivetrain:camera",
James Kuszmaulec635d22023-08-12 18:39:24 -070044 "//frc971/zeroing:absolute_encoder",
45 "//frc971/zeroing:pot_and_absolute_encoder",
Sabina Davis7be49f32019-02-02 00:30:19 -080046 "//y2019/control_loops/drivetrain:polydrivetrain_plants",
Alex Perry5fb5ff22019-02-09 21:53:17 -080047 "//y2019/control_loops/superstructure/elevator:elevator_plants",
48 "//y2019/control_loops/superstructure/intake:intake_plants",
49 "//y2019/control_loops/superstructure/stilts:stilts_plants",
Austin Schuhc1d6f832019-02-15 23:22:17 -080050 "//y2019/control_loops/superstructure/wrist:wrist_plants",
James Kuszmaule2c71ea2019-03-04 08:14:21 -080051 "//y2019/vision:constants",
Brian Silvermanf4d329c2021-11-04 19:32:10 -070052 "@com_github_google_glog//:glog",
Austin Schuhed5b26d2019-12-05 20:51:59 -080053 "@com_google_absl//absl/base",
Tyler Chatow37ecdcd2019-01-26 20:18:42 -080054 ],
55)
56
Sabina Davisabeae332019-02-01 21:12:57 -080057cc_binary(
58 name = "wpilib_interface",
59 srcs = [
60 "wpilib_interface.cc",
61 ],
Brian Silverman7be68ba2020-01-08 22:08:40 -080062 # This library uses some deprecated parts of the SPI API.
63 copts = ["-Wno-deprecated-declarations"],
Philipp Schraderdada1072020-11-24 11:34:46 -080064 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Sabina Davisabeae332019-02-01 21:12:57 -080065 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -080066 ":camera_log_fbs",
Sabina Davis7be49f32019-02-02 00:30:19 -080067 ":constants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080068 ":status_light_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080069 "//aos:init",
Sabina Davisabeae332019-02-01 21:12:57 -080070 "//aos:math",
Alex Perrycb7da4b2019-08-28 19:35:56 -070071 "//aos/events:shm_event_loop",
Sabina Davisabeae332019-02-01 21:12:57 -080072 "//aos/logging",
Sabina Davisabeae332019-02-01 21:12:57 -080073 "//aos/stl_mutex",
74 "//aos/time",
75 "//aos/util:log_interval",
76 "//aos/util:phased_loop",
77 "//aos/util:wrapping_counter",
Austin Schuhed5b26d2019-12-05 20:51:59 -080078 "//frc971/autonomous:auto_mode_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070079 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070080 "//frc971/control_loops:control_loops_fbs",
81 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070082 "//frc971/input:robot_state_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080083 "//frc971/wpilib:ADIS16448",
Austin Schuhc1d6f832019-02-15 23:22:17 -080084 "//frc971/wpilib:buffered_pcm",
Sabina Davisd004fd62019-02-02 23:51:46 -080085 "//frc971/wpilib:drivetrain_writer",
Sabina Davisabeae332019-02-01 21:12:57 -080086 "//frc971/wpilib:encoder_and_potentiometer",
87 "//frc971/wpilib:interrupt_edge_counting",
88 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -070089 "//frc971/wpilib:logging_fbs",
Sabina Davisabeae332019-02-01 21:12:57 -080090 "//frc971/wpilib:loop_output_handler",
91 "//frc971/wpilib:pdp_fetcher",
Sabina Davisadc58542019-02-01 22:23:00 -080092 "//frc971/wpilib:sensor_reader",
Sabina Davisabeae332019-02-01 21:12:57 -080093 "//frc971/wpilib:wpilib_interface",
94 "//frc971/wpilib:wpilib_robot_base",
Austin Schuhf6b94632019-02-02 22:11:27 -080095 "//third_party:phoenix",
Sabina Davisabeae332019-02-01 21:12:57 -080096 "//third_party:wpilib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070097 "//y2019/control_loops/drivetrain:camera_fbs",
98 "//y2019/control_loops/superstructure:superstructure_output_fbs",
99 "//y2019/control_loops/superstructure:superstructure_position_fbs",
Brian Silvermanf8b75252019-02-24 16:13:58 -0800100 "//y2019/jevois:spi",
Sabina Davisabeae332019-02-01 21:12:57 -0800101 ],
102)
Sabina Davis1b84afa2019-02-09 01:20:21 -0800103
Tyler Chatowd28951f2019-02-16 20:12:28 -0800104cc_library(
105 name = "joystick_angle",
106 srcs = [
107 "joystick_angle.cc",
108 ],
109 hdrs = [
110 "joystick_angle.h",
111 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800112 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowd28951f2019-02-16 20:12:28 -0800113 deps = [
James Kuszmaul7077d342021-06-09 20:23:58 -0700114 "//frc971/input:drivetrain_input",
Tyler Chatowc8012ca2019-02-18 22:33:01 -0800115 "//frc971/zeroing:wrap",
Tyler Chatowd28951f2019-02-16 20:12:28 -0800116 ],
117)
118
119cc_test(
120 name = "joystick_angle_test",
121 srcs = [
122 "joystick_angle_test.cc",
123 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800124 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowd28951f2019-02-16 20:12:28 -0800125 deps = [
126 ":joystick_angle",
127 "//aos/testing:googletest",
128 ],
129)
130
Sabina Davis1b84afa2019-02-09 01:20:21 -0800131cc_binary(
Sabina Davis91b23602019-01-21 00:06:01 -0800132 name = "joystick_reader",
133 srcs = [
134 ":joystick_reader.cc",
135 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800136 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis91b23602019-01-21 00:06:01 -0800137 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800138 ":camera_log_fbs",
Tyler Chatowe0241452019-03-08 21:07:50 -0800139 ":vision_proto",
Sabina Davis91b23602019-01-21 00:06:01 -0800140 "//aos:init",
141 "//aos/actions:action_lib",
Sabina Davis91b23602019-01-21 00:06:01 -0800142 "//aos/logging",
143 "//aos/network:team_number",
144 "//aos/stl_mutex",
145 "//aos/time",
146 "//aos/util:log_interval",
147 "//aos/vision/events:udp",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700148 "//frc971/autonomous:auto_fbs",
Sabina Davis91b23602019-01-21 00:06:01 -0800149 "//frc971/autonomous:base_autonomous_actor",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700150 "//frc971/control_loops:profiled_subsystem_fbs",
151 "//frc971/control_loops/drivetrain:localizer_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700152 "//frc971/input:action_joystick_input",
153 "//frc971/input:drivetrain_input",
154 "//frc971/input:joystick_input",
Sabina Davis91b23602019-01-21 00:06:01 -0800155 "//y2019/control_loops/drivetrain:drivetrain_base",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700156 "//y2019/control_loops/drivetrain:target_selector_fbs",
157 "//y2019/control_loops/superstructure:superstructure_goal_fbs",
158 "//y2019/control_loops/superstructure:superstructure_position_fbs",
159 "//y2019/control_loops/superstructure:superstructure_status_fbs",
Tyler Chatowe0241452019-03-08 21:07:50 -0800160 "@com_google_protobuf//:protobuf",
Sabina Davis91b23602019-01-21 00:06:01 -0800161 ],
162)
Sabina Davisabeae332019-02-01 21:12:57 -0800163
Alex Perrycb7da4b2019-08-28 19:35:56 -0700164flatbuffer_cc_library(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800165 name = "camera_log_fbs",
166 srcs = [
167 "camera_log.fbs",
168 ],
169 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800170 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhed5b26d2019-12-05 20:51:59 -0800171 visibility = ["//visibility:public"],
172)
173
174flatbuffer_cc_library(
175 name = "status_light_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -0800176 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700177 "status_light.fbs",
178 ],
179 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800180 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700181 visibility = ["//visibility:public"],
182)
183
184aos_config(
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800185 name = "aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700186 src = "y2019.json",
187 flatbuffers = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800188 ":status_light_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700189 "//y2019/control_loops/drivetrain:camera_fbs",
190 "//y2019/control_loops/drivetrain:target_selector_fbs",
191 "//y2019/control_loops/superstructure:superstructure_goal_fbs",
192 "//y2019/control_loops/superstructure:superstructure_output_fbs",
193 "//y2019/control_loops/superstructure:superstructure_position_fbs",
194 "//y2019/control_loops/superstructure:superstructure_status_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800195 ":camera_log_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -0800196 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800197 target_compatible_with = ["@platforms//os:linux"],
Sabina Davisc6329342019-03-01 20:44:42 -0800198 visibility = ["//visibility:public"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700199 deps = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800200 "//frc971/autonomous:aos_config",
201 "//frc971/control_loops/drivetrain:aos_config",
202 "//frc971/input:aos_config",
203 "//frc971/wpilib:aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700204 ],
Sabina Davisc6329342019-03-01 20:44:42 -0800205)
206
Michael Schuh5a1a7582019-03-01 13:03:47 -0800207cc_proto_library(
208 name = "vision_proto",
209 srcs = ["vision.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800210 target_compatible_with = ["@platforms//os:linux"],
Michael Schuh5a1a7582019-03-01 13:03:47 -0800211 visibility = ["//visibility:public"],
212)
213
Michael Schuhab42b0a2019-01-07 16:33:43 -0800214py_library(
215 name = "python_init",
216 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800217 target_compatible_with = ["@platforms//os:linux"],
Michael Schuhab42b0a2019-01-07 16:33:43 -0800218 visibility = ["//visibility:public"],
Sabina Davisabeae332019-02-01 21:12:57 -0800219)