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