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