Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 1 | load("//frc971:downloader.bzl", "robot_downloader") |
| 2 | load("//aos:config.bzl", "aos_config") |
| 3 | load("//tools/build_rules:template.bzl", "jinja2_template") |
| 4 | |
| 5 | robot_downloader( |
Ravago Jones | 2060ee6 | 2023-02-03 18:12:24 -0800 | [diff] [blame^] | 6 | binaries = [ |
| 7 | "//aos/network:web_proxy_main", |
| 8 | "//aos/events/logging:log_cat", |
| 9 | ], |
| 10 | data = [ |
| 11 | ":aos_config", |
| 12 | ":message_bridge_client.sh", |
| 13 | "@ctre_phoenix_api_cpp_athena//:shared_libraries", |
| 14 | "@ctre_phoenix_cci_athena//:shared_libraries", |
| 15 | "@ctre_phoenixpro_api_cpp_athena//:shared_libraries", |
| 16 | "@ctre_phoenixpro_tools_athena//:shared_libraries", |
| 17 | ], |
| 18 | dirs = [ |
| 19 | "//y2023/www:www_files", |
| 20 | ], |
| 21 | start_binaries = [ |
| 22 | "//aos/events/logging:logger_main", |
| 23 | "//aos/network:web_proxy_main", |
| 24 | ":joystick_reader", |
| 25 | ":wpilib_interface", |
| 26 | "//aos/network:message_bridge_client", |
| 27 | "//aos/network:message_bridge_server", |
| 28 | "//y2023/control_loops/drivetrain:drivetrain", |
| 29 | "//y2023/control_loops/drivetrain:trajectory_generator", |
| 30 | "//y2023/control_loops/superstructure:superstructure", |
| 31 | ], |
| 32 | target_compatible_with = ["@platforms//os:linux"], |
| 33 | ) |
| 34 | |
| 35 | robot_downloader( |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 36 | name = "pi_download", |
| 37 | binaries = [ |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 38 | "//y2020/vision:calibration", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 39 | "//y2023/vision:viewer", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 40 | "//y2023/vision:aprilrobotics", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 41 | "//y2022/localizer:localizer_main", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 42 | "//y2023/constants:constants_sender", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 43 | "//aos/network:web_proxy_main", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 44 | "//aos/events/logging:log_cat", |
Austin Schuh | b07dd5b | 2023-02-05 22:29:11 -0800 | [diff] [blame] | 45 | "//y2023/rockpi:imu_main", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 46 | ], |
| 47 | data = [ |
| 48 | ":aos_config", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 49 | ":message_bridge_client.sh", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 50 | "//y2023/constants:constants.json", |
| 51 | "//y2023/www:www_files", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 52 | ], |
| 53 | dirs = [ |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 54 | "//y2023/www:www_files", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 55 | ], |
| 56 | start_binaries = [ |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 57 | "//aos/network:message_bridge_client", |
| 58 | "//aos/network:message_bridge_server", |
| 59 | "//aos/network:web_proxy_main", |
Austin Schuh | 3e1d3b6 | 2023-01-08 13:52:31 -0800 | [diff] [blame] | 60 | "//aos/starter:irq_affinity", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 61 | "//y2023/vision:camera_reader", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 62 | "//aos/events/logging:logger_main", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 63 | ], |
| 64 | target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"], |
| 65 | target_type = "pi", |
| 66 | ) |
| 67 | |
| 68 | aos_config( |
| 69 | name = "aos_config", |
| 70 | src = "y2023.json", |
| 71 | flatbuffers = [ |
| 72 | "//aos/network:message_bridge_client_fbs", |
| 73 | "//aos/network:message_bridge_server_fbs", |
| 74 | "//aos/network:timestamp_fbs", |
| 75 | "//frc971/input:robot_state_fbs", |
| 76 | "//frc971/vision:vision_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 77 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 78 | ], |
| 79 | target_compatible_with = ["@platforms//os:linux"], |
| 80 | visibility = ["//visibility:public"], |
| 81 | deps = [ |
| 82 | ":config_imu", |
| 83 | ":config_logger", |
| 84 | ":config_pi1", |
| 85 | ":config_pi2", |
| 86 | ":config_pi3", |
| 87 | ":config_pi4", |
| 88 | ":config_roborio", |
| 89 | ], |
| 90 | ) |
| 91 | |
| 92 | [ |
| 93 | aos_config( |
| 94 | name = "config_" + pi, |
| 95 | src = "y2023_" + pi + ".json", |
| 96 | flatbuffers = [ |
| 97 | "//aos/network:message_bridge_client_fbs", |
| 98 | "//aos/network:message_bridge_server_fbs", |
| 99 | "//aos/network:timestamp_fbs", |
| 100 | "//aos/network:remote_message_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 101 | "//y2023/constants:constants_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 102 | "//y2022/localizer:localizer_output_fbs", |
milind-u | 2f101fc | 2023-01-21 12:28:49 -0800 | [diff] [blame] | 103 | "//frc971/vision:calibration_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 104 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 105 | "//frc971/vision:vision_fbs", |
Yash Chainani | 728ae22 | 2023-02-04 19:48:12 -0800 | [diff] [blame] | 106 | "//y2023/vision:april_debug_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 107 | ], |
| 108 | target_compatible_with = ["@platforms//os:linux"], |
| 109 | visibility = ["//visibility:public"], |
| 110 | deps = [ |
| 111 | "//aos/events:aos_config", |
| 112 | "//frc971/control_loops/drivetrain:aos_config", |
| 113 | "//frc971/input:aos_config", |
| 114 | ], |
| 115 | ) |
| 116 | for pi in [ |
| 117 | "pi1", |
| 118 | "pi2", |
| 119 | "pi3", |
| 120 | "pi4", |
| 121 | ] |
| 122 | ] |
| 123 | |
| 124 | aos_config( |
| 125 | name = "config_imu", |
| 126 | src = "y2023_imu.json", |
| 127 | flatbuffers = [ |
| 128 | "//aos/network:message_bridge_client_fbs", |
| 129 | "//aos/network:message_bridge_server_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 130 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 131 | "//aos/network:timestamp_fbs", |
| 132 | "//aos/network:remote_message_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 133 | "//y2022/localizer:localizer_status_fbs", |
| 134 | "//y2022/localizer:localizer_output_fbs", |
| 135 | "//y2022/localizer:localizer_visualization_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 136 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 137 | ], |
| 138 | target_compatible_with = ["@platforms//os:linux"], |
| 139 | visibility = ["//visibility:public"], |
| 140 | deps = [ |
| 141 | "//aos/events:aos_config", |
| 142 | "//frc971/control_loops/drivetrain:aos_config", |
| 143 | ], |
| 144 | ) |
| 145 | |
| 146 | aos_config( |
| 147 | name = "config_logger", |
| 148 | src = "y2023_logger.json", |
| 149 | flatbuffers = [ |
| 150 | "//aos/network:message_bridge_client_fbs", |
| 151 | "//aos/network:message_bridge_server_fbs", |
| 152 | "//aos/network:timestamp_fbs", |
| 153 | "//aos/network:remote_message_fbs", |
milind-u | 2f101fc | 2023-01-21 12:28:49 -0800 | [diff] [blame] | 154 | "//frc971/vision:calibration_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 155 | "//frc971/vision:vision_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 156 | "//frc971/vision:target_map_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 157 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 158 | ], |
| 159 | target_compatible_with = ["@platforms//os:linux"], |
| 160 | visibility = ["//visibility:public"], |
| 161 | deps = [ |
| 162 | "//aos/events:aos_config", |
| 163 | "//frc971/control_loops/drivetrain:aos_config", |
| 164 | "//frc971/input:aos_config", |
| 165 | ], |
| 166 | ) |
| 167 | |
| 168 | aos_config( |
| 169 | name = "config_roborio", |
| 170 | src = "y2023_roborio.json", |
| 171 | flatbuffers = [ |
| 172 | "//aos/network:remote_message_fbs", |
| 173 | "//aos/network:message_bridge_client_fbs", |
| 174 | "//aos/network:message_bridge_server_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 175 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 176 | "//aos/network:timestamp_fbs", |
| 177 | "//y2019/control_loops/drivetrain:target_selector_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 178 | "//y2023/control_loops/superstructure:superstructure_goal_fbs", |
Ravago Jones | 2060ee6 | 2023-02-03 18:12:24 -0800 | [diff] [blame^] | 179 | "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 180 | "//y2023/control_loops/superstructure:superstructure_output_fbs", |
| 181 | "//y2023/control_loops/superstructure:superstructure_position_fbs", |
| 182 | "//y2023/control_loops/superstructure:superstructure_status_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 183 | ], |
| 184 | target_compatible_with = ["@platforms//os:linux"], |
| 185 | deps = [ |
| 186 | "//aos/events:aos_config", |
| 187 | "//frc971/autonomous:aos_config", |
| 188 | "//frc971/control_loops/drivetrain:aos_config", |
| 189 | "//frc971/input:aos_config", |
| 190 | "//frc971/wpilib:aos_config", |
| 191 | ], |
| 192 | ) |
| 193 | |
| 194 | [ |
| 195 | jinja2_template( |
| 196 | name = "y2023_pi" + str(num) + ".json", |
| 197 | src = "y2023_pi_template.json", |
| 198 | parameters = {"NUM": str(num)}, |
| 199 | target_compatible_with = ["@platforms//os:linux"], |
| 200 | ) |
| 201 | for num in range(1, 6) |
| 202 | ] |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 203 | |
| 204 | cc_library( |
| 205 | name = "constants", |
| 206 | srcs = [ |
| 207 | "constants.cc", |
| 208 | ], |
| 209 | hdrs = [ |
| 210 | "constants.h", |
| 211 | ], |
| 212 | visibility = ["//visibility:public"], |
| 213 | deps = [ |
| 214 | "//aos/mutex", |
| 215 | "//aos/network:team_number", |
| 216 | "//frc971:constants", |
| 217 | "//frc971/control_loops:pose", |
| 218 | "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem", |
| 219 | "//frc971/shooter_interpolation:interpolation", |
| 220 | "//y2023/control_loops/drivetrain:polydrivetrain_plants", |
| 221 | "@com_github_google_glog//:glog", |
| 222 | "@com_google_absl//absl/base", |
| 223 | ], |
| 224 | ) |
| 225 | |
| 226 | cc_binary( |
| 227 | name = "wpilib_interface", |
| 228 | srcs = [ |
| 229 | "wpilib_interface.cc", |
| 230 | ], |
| 231 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 232 | deps = [ |
| 233 | ":constants", |
| 234 | "//aos:init", |
| 235 | "//aos:math", |
Ravago Jones | 2060ee6 | 2023-02-03 18:12:24 -0800 | [diff] [blame^] | 236 | "//aos/containers:sized_array", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 237 | "//aos/events:shm_event_loop", |
| 238 | "//aos/logging", |
| 239 | "//aos/stl_mutex", |
| 240 | "//aos/time", |
| 241 | "//aos/util:log_interval", |
| 242 | "//aos/util:phased_loop", |
| 243 | "//aos/util:wrapping_counter", |
| 244 | "//frc971/autonomous:auto_mode_fbs", |
| 245 | "//frc971/control_loops:control_loop", |
| 246 | "//frc971/control_loops:control_loops_fbs", |
| 247 | "//frc971/control_loops/drivetrain:drivetrain_position_fbs", |
| 248 | "//frc971/input:robot_state_fbs", |
| 249 | "//frc971/queues:gyro_fbs", |
| 250 | "//frc971/wpilib:ADIS16448", |
| 251 | "//frc971/wpilib:buffered_pcm", |
| 252 | "//frc971/wpilib:drivetrain_writer", |
| 253 | "//frc971/wpilib:encoder_and_potentiometer", |
| 254 | "//frc971/wpilib:interrupt_edge_counting", |
| 255 | "//frc971/wpilib:joystick_sender", |
| 256 | "//frc971/wpilib:logging_fbs", |
| 257 | "//frc971/wpilib:loop_output_handler", |
| 258 | "//frc971/wpilib:pdp_fetcher", |
| 259 | "//frc971/wpilib:sensor_reader", |
| 260 | "//frc971/wpilib:wpilib_interface", |
| 261 | "//frc971/wpilib:wpilib_robot_base", |
| 262 | "//third_party:phoenix", |
Ravago Jones | 2060ee6 | 2023-02-03 18:12:24 -0800 | [diff] [blame^] | 263 | "//third_party:phoenixpro", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 264 | "//third_party:wpilib", |
Ravago Jones | 2060ee6 | 2023-02-03 18:12:24 -0800 | [diff] [blame^] | 265 | "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 266 | "//y2023/control_loops/superstructure:superstructure_output_fbs", |
| 267 | "//y2023/control_loops/superstructure:superstructure_position_fbs", |
| 268 | ], |
| 269 | ) |
| 270 | |
| 271 | cc_binary( |
| 272 | name = "joystick_reader", |
| 273 | srcs = [ |
| 274 | ":joystick_reader.cc", |
| 275 | ], |
| 276 | deps = [ |
| 277 | ":constants", |
| 278 | "//aos:init", |
| 279 | "//aos/actions:action_lib", |
| 280 | "//aos/logging", |
| 281 | "//frc971/autonomous:auto_fbs", |
| 282 | "//frc971/autonomous:base_autonomous_actor", |
| 283 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 284 | "//frc971/input:action_joystick_input", |
| 285 | "//frc971/input:drivetrain_input", |
| 286 | "//frc971/input:joystick_input", |
| 287 | "//y2023/control_loops/drivetrain:drivetrain_base", |
| 288 | "//y2023/control_loops/superstructure:superstructure_goal_fbs", |
| 289 | "//y2023/control_loops/superstructure:superstructure_status_fbs", |
| 290 | ], |
| 291 | ) |
| 292 | |
| 293 | py_library( |
| 294 | name = "python_init", |
| 295 | srcs = ["__init__.py"], |
| 296 | target_compatible_with = ["@platforms//os:linux"], |
| 297 | visibility = ["//visibility:public"], |
| 298 | ) |
| 299 | |
| 300 | sh_binary( |
| 301 | name = "log_web_proxy", |
| 302 | srcs = ["log_web_proxy.sh"], |
| 303 | data = [ |
| 304 | ":aos_config", |
| 305 | "//aos/network:log_web_proxy_main", |
| 306 | "//y2023/www:field_main_bundle.min.js", |
| 307 | "//y2023/www:files", |
| 308 | ], |
| 309 | target_compatible_with = ["@platforms//os:linux"], |
| 310 | ) |
Austin Schuh | e6b2b88 | 2023-02-04 11:42:40 -0800 | [diff] [blame] | 311 | |
| 312 | cc_binary( |
| 313 | name = "ssd_profiler", |
| 314 | srcs = [ |
| 315 | "ssd_profiler.cc", |
| 316 | ], |
| 317 | deps = [ |
| 318 | "//aos:init", |
| 319 | "//aos/time", |
| 320 | "@com_github_google_glog//:glog", |
| 321 | ], |
| 322 | ) |