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