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