Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 1 | load("//frc971:downloader.bzl", "robot_downloader") |
| 2 | load("//aos:config.bzl", "aos_config") |
Maxwell Henderson | 440e3f1 | 2024-01-17 19:44:13 -0800 | [diff] [blame] | 3 | load("//tools/build_rules:template.bzl", "jinja2_template") |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 4 | load("//aos/util:config_validator_macro.bzl", "config_validator_test") |
| 5 | |
| 6 | config_validator_test( |
| 7 | name = "config_validator_test", |
| 8 | config = "//y2024:aos_config", |
| 9 | ) |
| 10 | |
| 11 | robot_downloader( |
| 12 | binaries = [ |
| 13 | "//aos/network:web_proxy_main", |
| 14 | "//aos/events/logging:log_cat", |
| 15 | "//y2024/constants:constants_sender", |
| 16 | "//aos/events:aos_timing_report_streamer", |
| 17 | ], |
| 18 | data = [ |
| 19 | ":aos_config", |
| 20 | "//aos/starter:roborio_irq_config.json", |
| 21 | "//y2024/constants:constants.json", |
| 22 | "@ctre_phoenix6_tools_athena//:shared_libraries", |
| 23 | "@ctre_phoenix_cci_athena//:shared_libraries", |
| 24 | ], |
| 25 | dirs = [ |
| 26 | "//y2024/www:www_files", |
| 27 | "//y2024/autonomous:splines", |
| 28 | ], |
| 29 | start_binaries = [ |
| 30 | "//aos/events/logging:logger_main", |
| 31 | "//aos/network:web_proxy_main", |
| 32 | "//aos/starter:irq_affinity", |
| 33 | "//y2024/autonomous:binaries", |
| 34 | ":joystick_reader", |
| 35 | ":wpilib_interface", |
| 36 | "//frc971/can_logger", |
| 37 | "//aos/network:message_bridge_client", |
| 38 | "//aos/network:message_bridge_server", |
| 39 | "//y2024/control_loops/drivetrain:drivetrain", |
| 40 | "//y2024/control_loops/drivetrain:trajectory_generator", |
| 41 | "//y2024/control_loops/superstructure:superstructure", |
| 42 | ], |
| 43 | target_compatible_with = ["@platforms//os:linux"], |
| 44 | ) |
| 45 | |
| 46 | robot_downloader( |
| 47 | name = "orin_download", |
| 48 | binaries = [ |
Jim Ostrowski | 8a1480f | 2024-01-20 00:31:51 -0800 | [diff] [blame] | 49 | ":joystick_republish", |
| 50 | "//aos/events:aos_timing_report_streamer", |
| 51 | "//aos/events/logging:log_cat", |
| 52 | "//aos/network:web_proxy_main", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 53 | "//aos/starter:irq_affinity", |
| 54 | "//aos/util:foxglove_websocket", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 55 | "//frc971/image_streamer:image_streamer", |
Jim Ostrowski | cb8b408 | 2024-01-21 02:23:46 -0800 | [diff] [blame] | 56 | "//frc971/vision:intrinsics_calibration", |
Jim Ostrowski | 9bf206a | 2024-01-26 23:31:58 -0800 | [diff] [blame] | 57 | "//y2024/vision:viewer", |
Jim Ostrowski | 8a1480f | 2024-01-20 00:31:51 -0800 | [diff] [blame] | 58 | "//y2024/constants:constants_sender", |
Jim Ostrowski | 855b744 | 2024-01-20 18:03:09 -0800 | [diff] [blame] | 59 | "//y2024/vision:foxglove_image_converter", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 60 | ], |
| 61 | data = [ |
| 62 | ":aos_config", |
Jim Ostrowski | 855b744 | 2024-01-20 18:03:09 -0800 | [diff] [blame] | 63 | "//frc971/rockpi:rockpi_config.json", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 64 | "//y2024/constants:constants.json", |
| 65 | "//y2024/vision:image_streamer_start", |
| 66 | "//y2024/www:www_files", |
| 67 | ], |
| 68 | dirs = [ |
| 69 | "//y2024/www:www_files", |
| 70 | "//frc971/image_streamer/www:www_files", |
| 71 | ], |
| 72 | start_binaries = [ |
Jim Ostrowski | 8a1480f | 2024-01-20 00:31:51 -0800 | [diff] [blame] | 73 | "//aos/events/logging:logger_main", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 74 | "//aos/network:message_bridge_client", |
| 75 | "//aos/network:message_bridge_server", |
| 76 | "//aos/network:web_proxy_main", |
| 77 | "//aos/starter:irq_affinity", |
Maxwell Henderson | 440e3f1 | 2024-01-17 19:44:13 -0800 | [diff] [blame] | 78 | "//frc971/orin:argus_camera", |
Jim Ostrowski | 8a1480f | 2024-01-20 00:31:51 -0800 | [diff] [blame] | 79 | "//y2024/orin:can_logger", |
Jim Ostrowski | cb8b408 | 2024-01-21 02:23:46 -0800 | [diff] [blame] | 80 | "//y2024/vision:apriltag_detector", |
Jim Ostrowski | 8a1480f | 2024-01-20 00:31:51 -0800 | [diff] [blame] | 81 | "//y2024/vision:image_logger", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 82 | ], |
| 83 | target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"], |
Maxwell Henderson | e5d758f | 2024-01-20 13:30:42 -0800 | [diff] [blame] | 84 | target_type = "pi", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 85 | ) |
| 86 | |
| 87 | aos_config( |
| 88 | name = "aos_config", |
| 89 | src = "y2024.json", |
| 90 | flatbuffers = [ |
| 91 | "//aos/network:message_bridge_client_fbs", |
| 92 | "//aos/network:message_bridge_server_fbs", |
| 93 | "//aos/network:timestamp_fbs", |
| 94 | "//frc971/input:robot_state_fbs", |
| 95 | "//frc971/vision:vision_fbs", |
| 96 | "//frc971/vision:target_map_fbs", |
| 97 | ], |
| 98 | target_compatible_with = ["@platforms//os:linux"], |
| 99 | visibility = ["//visibility:public"], |
| 100 | deps = [ |
| 101 | ":config_imu", |
Maxwell Henderson | 440e3f1 | 2024-01-17 19:44:13 -0800 | [diff] [blame] | 102 | ":config_orin1", |
| 103 | ":config_orin2", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 104 | ":config_roborio", |
| 105 | ], |
| 106 | ) |
| 107 | |
| 108 | aos_config( |
| 109 | name = "config_imu", |
| 110 | src = "y2024_imu.json", |
| 111 | flatbuffers = [ |
| 112 | "//aos/network:message_bridge_client_fbs", |
| 113 | "//aos/network:message_bridge_server_fbs", |
| 114 | "//y2024/constants:constants_fbs", |
Maxwell Henderson | 0604e6f | 2024-01-15 15:24:44 -0800 | [diff] [blame] | 115 | "//frc971/can_logger:can_logging_fbs", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 116 | "//aos/network:timestamp_fbs", |
| 117 | "//aos/network:remote_message_fbs", |
| 118 | ], |
| 119 | target_compatible_with = ["@platforms//os:linux"], |
| 120 | visibility = ["//visibility:public"], |
| 121 | deps = [ |
| 122 | "//aos/events:aos_config", |
| 123 | "//frc971/control_loops/drivetrain:aos_config", |
| 124 | ], |
| 125 | ) |
| 126 | |
| 127 | aos_config( |
| 128 | name = "config_roborio", |
| 129 | src = "y2024_roborio.json", |
| 130 | flatbuffers = [ |
| 131 | "//frc971:can_configuration_fbs", |
| 132 | "//aos/network:remote_message_fbs", |
| 133 | "//aos/network:message_bridge_client_fbs", |
| 134 | "//aos/network:message_bridge_server_fbs", |
| 135 | #y2019 stuff shouldn't be here (e.g. target selector) |
| 136 | "//y2024/constants:constants_fbs", |
| 137 | "//aos/network:timestamp_fbs", |
| 138 | "//y2024/control_loops/superstructure:superstructure_goal_fbs", |
| 139 | "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs", |
Niko Sohmers | 1259b2a | 2024-01-29 18:00:37 -0800 | [diff] [blame] | 140 | "//y2024/control_loops/superstructure:superstructure_can_position_fbs", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 141 | "//y2024/control_loops/superstructure:superstructure_output_fbs", |
| 142 | "//y2024/control_loops/superstructure:superstructure_position_fbs", |
| 143 | "//y2024/control_loops/superstructure:superstructure_status_fbs", |
| 144 | "//frc971/can_logger:can_logging_fbs", |
| 145 | ], |
| 146 | target_compatible_with = ["@platforms//os:linux"], |
| 147 | deps = [ |
| 148 | "//aos/events:aos_config", |
| 149 | "//frc971/autonomous:aos_config", |
| 150 | "//frc971/control_loops/drivetrain:aos_config", |
| 151 | "//frc971/input:aos_config", |
| 152 | ], |
| 153 | ) |
| 154 | |
Maxwell Henderson | 440e3f1 | 2024-01-17 19:44:13 -0800 | [diff] [blame] | 155 | [ |
| 156 | aos_config( |
| 157 | name = "config_" + orin, |
| 158 | src = "y2024_" + orin + ".json", |
| 159 | flatbuffers = [ |
| 160 | "//aos/network:message_bridge_client_fbs", |
| 161 | "//aos/network:message_bridge_server_fbs", |
| 162 | "//aos/network:timestamp_fbs", |
| 163 | "//aos/network:remote_message_fbs", |
| 164 | "//y2024/constants:constants_fbs", |
| 165 | "//frc971/control_loops/drivetrain/localization:localizer_output_fbs", |
| 166 | "//frc971/vision:calibration_fbs", |
| 167 | "//frc971/vision:target_map_fbs", |
| 168 | "//frc971/vision:vision_fbs", |
| 169 | "@com_github_foxglove_schemas//:schemas", |
| 170 | ], |
| 171 | target_compatible_with = ["@platforms//os:linux"], |
| 172 | visibility = ["//visibility:public"], |
| 173 | deps = [ |
| 174 | "//aos/events:aos_config", |
| 175 | "//frc971/control_loops/drivetrain:aos_config", |
| 176 | "//frc971/input:aos_config", |
| 177 | ], |
| 178 | ) |
| 179 | for orin in [ |
| 180 | "orin1", |
| 181 | "orin2", |
| 182 | ] |
| 183 | ] |
| 184 | |
| 185 | [ |
| 186 | jinja2_template( |
| 187 | name = "y2024_orin" + str(num) + ".json", |
| 188 | src = "y2024_orin_template.json", |
| 189 | parameters = {"NUM": str(num)}, |
| 190 | target_compatible_with = ["@platforms//os:linux"], |
| 191 | ) |
| 192 | for num in range(1, 3) |
| 193 | ] |
| 194 | |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 195 | cc_library( |
| 196 | name = "constants", |
| 197 | srcs = [ |
| 198 | "constants.cc", |
| 199 | ], |
| 200 | hdrs = [ |
| 201 | "constants.h", |
| 202 | ], |
| 203 | visibility = ["//visibility:public"], |
| 204 | deps = [ |
| 205 | "//aos/mutex", |
| 206 | "//aos/network:team_number", |
| 207 | "//frc971:constants", |
| 208 | "//frc971/control_loops:pose", |
| 209 | "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem", |
| 210 | "//frc971/shooter_interpolation:interpolation", |
| 211 | "//frc971/zeroing:absolute_encoder", |
| 212 | "//frc971/zeroing:pot_and_absolute_encoder", |
| 213 | "//y2024/control_loops/drivetrain:polydrivetrain_plants", |
Filip Kujawa | 37aa0bc | 2024-01-31 20:59:49 -0800 | [diff] [blame] | 214 | "//y2024/control_loops/superstructure/climber:climber_plants", |
Austin Schuh | 3db875a | 2024-02-18 20:02:40 -0800 | [diff] [blame^] | 215 | "//y2024/control_loops/superstructure/extend:extend_plants", |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 216 | "//y2024/control_loops/superstructure/intake_pivot:intake_pivot_plants", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 217 | "@com_github_google_glog//:glog", |
| 218 | "@com_google_absl//absl/base", |
| 219 | ], |
| 220 | ) |
| 221 | |
| 222 | cc_binary( |
| 223 | name = "wpilib_interface", |
| 224 | srcs = [ |
| 225 | "wpilib_interface.cc", |
| 226 | ], |
| 227 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 228 | deps = [ |
| 229 | ":constants", |
| 230 | "//aos:init", |
| 231 | "//aos:math", |
| 232 | "//aos/containers:sized_array", |
| 233 | "//aos/events:shm_event_loop", |
| 234 | "//aos/logging", |
| 235 | "//aos/stl_mutex", |
| 236 | "//aos/time", |
| 237 | "//aos/util:log_interval", |
| 238 | "//aos/util:phased_loop", |
| 239 | "//aos/util:wrapping_counter", |
| 240 | "//frc971:can_configuration_fbs", |
| 241 | "//frc971/autonomous:auto_mode_fbs", |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 242 | "//frc971/constants:constants_sender_lib", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 243 | "//frc971/control_loops:control_loop", |
| 244 | "//frc971/control_loops:control_loops_fbs", |
| 245 | "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs", |
| 246 | "//frc971/control_loops/drivetrain:drivetrain_position_fbs", |
| 247 | "//frc971/input:robot_state_fbs", |
| 248 | "//frc971/queues:gyro_fbs", |
| 249 | "//frc971/wpilib:ADIS16448", |
| 250 | "//frc971/wpilib:buffered_pcm", |
Maxwell Henderson | f75800f | 2024-01-12 19:52:05 -0800 | [diff] [blame] | 251 | "//frc971/wpilib:can_drivetrain_writer", |
| 252 | "//frc971/wpilib:can_sensor_reader", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 253 | "//frc971/wpilib:dma", |
| 254 | "//frc971/wpilib:drivetrain_writer", |
| 255 | "//frc971/wpilib:encoder_and_potentiometer", |
Niko Sohmers | 1259b2a | 2024-01-29 18:00:37 -0800 | [diff] [blame] | 256 | "//frc971/wpilib:generic_can_writer", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 257 | "//frc971/wpilib:joystick_sender", |
| 258 | "//frc971/wpilib:logging_fbs", |
| 259 | "//frc971/wpilib:pdp_fetcher", |
| 260 | "//frc971/wpilib:sensor_reader", |
Maxwell Henderson | f75800f | 2024-01-12 19:52:05 -0800 | [diff] [blame] | 261 | "//frc971/wpilib:talonfx", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 262 | "//frc971/wpilib:wpilib_robot_base", |
| 263 | "//third_party:phoenix", |
| 264 | "//third_party:phoenix6", |
| 265 | "//third_party:wpilib", |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 266 | "//y2024/constants:constants_fbs", |
Niko Sohmers | 1259b2a | 2024-01-29 18:00:37 -0800 | [diff] [blame] | 267 | "//y2024/control_loops/superstructure:superstructure_can_position_fbs", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 268 | "//y2024/control_loops/superstructure:superstructure_output_fbs", |
| 269 | "//y2024/control_loops/superstructure:superstructure_position_fbs", |
| 270 | ], |
| 271 | ) |
| 272 | |
| 273 | cc_binary( |
| 274 | name = "joystick_reader", |
| 275 | srcs = [ |
| 276 | ":joystick_reader.cc", |
| 277 | ], |
| 278 | deps = [ |
| 279 | ":constants", |
| 280 | "//aos:init", |
| 281 | "//aos/actions:action_lib", |
| 282 | "//aos/logging", |
| 283 | "//frc971/autonomous:auto_fbs", |
| 284 | "//frc971/autonomous:base_autonomous_actor", |
| 285 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 286 | "//frc971/input:action_joystick_input", |
| 287 | "//frc971/input:drivetrain_input", |
| 288 | "//frc971/input:joystick_input", |
| 289 | "//frc971/input:redundant_joystick_data", |
| 290 | "//y2024/control_loops/drivetrain:drivetrain_base", |
| 291 | "//y2024/control_loops/superstructure:superstructure_goal_fbs", |
| 292 | "//y2024/control_loops/superstructure:superstructure_status_fbs", |
| 293 | ], |
| 294 | ) |
| 295 | |
| 296 | cc_binary( |
| 297 | name = "joystick_republish", |
| 298 | srcs = [ |
| 299 | "joystick_republish.cc", |
| 300 | ], |
| 301 | target_compatible_with = ["@platforms//os:linux"], |
| 302 | visibility = ["//visibility:public"], |
| 303 | deps = [ |
| 304 | "//aos:configuration", |
| 305 | "//aos:flatbuffer_merge", |
| 306 | "//aos:init", |
| 307 | "//aos/events:shm_event_loop", |
| 308 | "//frc971/input:joystick_state_fbs", |
| 309 | "@com_github_google_glog//:glog", |
| 310 | ], |
| 311 | ) |
| 312 | |
| 313 | py_library( |
| 314 | name = "python_init", |
| 315 | srcs = ["__init__.py"], |
| 316 | target_compatible_with = ["@platforms//os:linux"], |
| 317 | visibility = ["//visibility:public"], |
| 318 | ) |
| 319 | |
| 320 | sh_binary( |
| 321 | name = "log_web_proxy", |
| 322 | srcs = ["log_web_proxy.sh"], |
| 323 | data = [ |
| 324 | ":aos_config", |
| 325 | "//aos/network:log_web_proxy_main", |
Niko Sohmers | 2d10876 | 2024-02-02 20:21:14 -0800 | [diff] [blame] | 326 | "//y2024/www:field_main_bundle.min.js", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 327 | "//y2024/www:files", |
| 328 | ], |
| 329 | target_compatible_with = ["@platforms//os:linux"], |
| 330 | ) |