Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 1 | load("//aos:config.bzl", "aos_config") |
| 2 | load("//aos/util:config_validator_macro.bzl", "config_validator_test") |
Austin Schuh | 8f99c82 | 2024-05-05 22:43:40 -0700 | [diff] [blame] | 3 | load("//frc971:downloader.bzl", "robot_downloader") |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 4 | |
| 5 | config_validator_test( |
| 6 | name = "config_validator_test", |
Nikolai Sohmers | 3cc1fc2 | 2024-05-04 12:27:58 -0700 | [diff] [blame] | 7 | config = "//y2024_swerve:aos_config", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | robot_downloader( |
| 11 | binaries = [ |
| 12 | "//aos/network:web_proxy_main", |
| 13 | "//aos/events/logging:log_cat", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 14 | "//y2024_swerve/constants:constants_sender", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 15 | "//aos/events:aos_timing_report_streamer", |
| 16 | ], |
| 17 | data = [ |
| 18 | ":aos_config", |
James Kuszmaul | eaba6d9 | 2024-07-31 20:42:20 -0700 | [diff] [blame] | 19 | ":swerve_publisher_goal_json", |
Nikolai Sohmers | c4fce5d | 2024-06-15 19:46:46 -0500 | [diff] [blame] | 20 | "//y2024_swerve/constants:constants.json", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 21 | "@ctre_phoenix6_api_cpp_athena//:shared_libraries", |
| 22 | "@ctre_phoenix6_tools_athena//:shared_libraries", |
| 23 | "@ctre_phoenix_api_cpp_athena//:shared_libraries", |
| 24 | "@ctre_phoenix_cci_athena//:shared_libraries", |
| 25 | ], |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 26 | dirs = [ |
| 27 | "//y2024/www:www_files", |
| 28 | ], |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 29 | start_binaries = [ |
| 30 | "//aos/events/logging:logger_main", |
| 31 | "//aos/network:web_proxy_main", |
| 32 | "//aos/starter:irq_affinity", |
| 33 | ":wpilib_interface", |
| 34 | ":swerve_publisher", |
| 35 | "//frc971/can_logger", |
| 36 | "//aos/network:message_bridge_client", |
| 37 | "//aos/network:message_bridge_server", |
| 38 | ], |
| 39 | target_compatible_with = ["@platforms//os:linux"], |
| 40 | ) |
| 41 | |
| 42 | robot_downloader( |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 43 | name = "orin_download", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 44 | binaries = [ |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 45 | "//aos/events:aos_timing_report_streamer", |
| 46 | "//aos/events/logging:log_cat", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 47 | "//aos:aos_jitter", |
| 48 | "//aos/network:web_proxy_main", |
| 49 | "//aos/starter:irq_affinity", |
| 50 | "//aos/util:foxglove_websocket", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 51 | "//frc971/image_streamer:image_streamer", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 52 | "//frc971/orin:hardware_monitor", |
| 53 | "//frc971/orin:argus_monitor", |
| 54 | "//frc971/vision:intrinsics_calibration", |
| 55 | "//aos/util:filesystem_monitor", |
| 56 | "//y2024_swerve/constants:constants_sender", |
| 57 | "//frc971/vision:foxglove_image_converter", |
| 58 | ], |
| 59 | data = [ |
| 60 | ":aos_config", |
| 61 | "//frc971/orin:orin_irq_config.json", |
| 62 | "//y2024/www:www_files", |
| 63 | "//y2024_swerve/constants:constants.json", |
| 64 | ], |
| 65 | dirs = [ |
| 66 | "//y2024/www:www_files", |
| 67 | ], |
| 68 | start_binaries = [ |
| 69 | "//aos/events/logging:logger_main", |
| 70 | "//frc971/imu_fdcan:can_translator", |
| 71 | "//frc971/imu_fdcan:dual_imu_blender", |
James Kuszmaul | 5e53ab5 | 2024-06-22 14:08:42 -0700 | [diff] [blame] | 72 | "//frc971/orin:localizer_logger", |
James Kuszmaul | d7c028f | 2024-06-19 19:59:56 -0700 | [diff] [blame] | 73 | "//frc971/can_logger", |
James Kuszmaul | cf2cf53 | 2024-06-22 14:02:48 -0700 | [diff] [blame] | 74 | "//frc971/wpilib:joystick_republish", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 75 | "//aos/network:message_bridge_client", |
| 76 | "//aos/network:message_bridge_server", |
| 77 | "//aos/network:web_proxy_main", |
| 78 | "//aos/starter:irq_affinity", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 79 | "//frc971/orin:argus_camera", |
| 80 | "//y2024_swerve/vision:apriltag_detector", |
| 81 | "//frc971/vision:image_logger", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 82 | ], |
| 83 | target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"], |
| 84 | target_type = "pi", |
| 85 | ) |
| 86 | |
| 87 | filegroup( |
James Kuszmaul | eaba6d9 | 2024-07-31 20:42:20 -0700 | [diff] [blame] | 88 | name = "swerve_publisher_goal_json", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 89 | srcs = [ |
James Kuszmaul | eaba6d9 | 2024-07-31 20:42:20 -0700 | [diff] [blame] | 90 | "swerve_drivetrain_goal.json", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 91 | ], |
Nikolai Sohmers | 3cc1fc2 | 2024-05-04 12:27:58 -0700 | [diff] [blame] | 92 | visibility = ["//y2024_swerve:__subpackages__"], |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 93 | ) |
| 94 | |
| 95 | cc_library( |
| 96 | name = "constants", |
| 97 | srcs = ["constants.cc"], |
| 98 | hdrs = [ |
| 99 | "constants.h", |
| 100 | ], |
| 101 | visibility = ["//visibility:public"], |
| 102 | deps = [ |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 103 | "//aos/mutex", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 104 | "//aos/network:team_number", |
| 105 | "//frc971:constants", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 106 | "//y2024_swerve/constants:constants_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 107 | "@com_google_absl//absl/base", |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 108 | "@com_google_absl//absl/log", |
| 109 | "@com_google_absl//absl/log:check", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 110 | ], |
| 111 | ) |
| 112 | |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 113 | cc_binary( |
| 114 | name = "swerve_publisher", |
| 115 | srcs = ["swerve_publisher_main.cc"], |
| 116 | deps = [ |
| 117 | ":swerve_publisher_lib", |
| 118 | "//aos/events:shm_event_loop", |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 119 | "@com_google_absl//absl/flags:flag", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 120 | ], |
| 121 | ) |
| 122 | |
| 123 | cc_library( |
| 124 | name = "swerve_publisher_lib", |
| 125 | srcs = ["swerve_publisher_lib.cc"], |
| 126 | hdrs = ["swerve_publisher_lib.h"], |
| 127 | deps = [ |
| 128 | "//aos:init", |
| 129 | "//aos/events:event_loop", |
James Kuszmaul | eaba6d9 | 2024-07-31 20:42:20 -0700 | [diff] [blame] | 130 | "//frc971/control_loops/swerve:swerve_drivetrain_goal_fbs", |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 131 | "@com_google_absl//absl/log", |
| 132 | "@com_google_absl//absl/log:check", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 133 | ], |
| 134 | ) |
| 135 | |
| 136 | cc_test( |
| 137 | name = "swerve_publisher_lib_test", |
| 138 | srcs = [ |
| 139 | "swerve_publisher_lib_test.cc", |
| 140 | ], |
| 141 | data = [ |
| 142 | ":aos_config", |
James Kuszmaul | eaba6d9 | 2024-07-31 20:42:20 -0700 | [diff] [blame] | 143 | ":swerve_publisher_goal_json", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 144 | ], |
| 145 | deps = [ |
| 146 | ":swerve_publisher_lib", |
| 147 | "//aos/events:simulated_event_loop", |
| 148 | "//aos/testing:googletest", |
| 149 | ], |
| 150 | ) |
| 151 | |
| 152 | cc_binary( |
| 153 | name = "wpilib_interface", |
| 154 | srcs = ["wpilib_interface.cc"], |
| 155 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 156 | deps = [ |
| 157 | ":constants", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 158 | "//aos:init", |
| 159 | "//aos/events:shm_event_loop", |
Nikolai Sohmers | ce9ee6e | 2024-07-06 17:16:20 -0700 | [diff] [blame] | 160 | "//frc971/constants:constants_sender_lib", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 161 | "//frc971/control_loops:control_loops_fbs", |
Nikolai Sohmers | 3f2a507 | 2024-06-08 14:05:59 -0700 | [diff] [blame] | 162 | "//frc971/control_loops/swerve:swerve_drivetrain_can_position_fbs", |
James Kuszmaul | d938d33 | 2024-05-15 20:47:19 -0700 | [diff] [blame] | 163 | "//frc971/control_loops/swerve:swerve_drivetrain_position_fbs", |
James Kuszmaul | 6e445c4 | 2024-07-06 13:06:23 -0700 | [diff] [blame^] | 164 | "//frc971/queues:gyro_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 165 | "//frc971/wpilib:can_sensor_reader", |
James Kuszmaul | f40b677 | 2024-06-22 16:04:03 -0700 | [diff] [blame] | 166 | "//frc971/wpilib:joystick_sender", |
| 167 | "//frc971/wpilib:pdp_fetcher", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 168 | "//frc971/wpilib:sensor_reader", |
Maxwell Henderson | 10ed5c3 | 2024-01-09 12:40:54 -0800 | [diff] [blame] | 169 | "//frc971/wpilib:talonfx", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 170 | "//frc971/wpilib:wpilib_robot_base", |
| 171 | "//frc971/wpilib/swerve:swerve_drivetrain_writer", |
Nikolai Sohmers | ce9ee6e | 2024-07-06 17:16:20 -0700 | [diff] [blame] | 172 | "//y2024_swerve/constants:constants_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 173 | ], |
| 174 | ) |
| 175 | |
| 176 | aos_config( |
| 177 | name = "aos_config", |
Nikolai Sohmers | 3cc1fc2 | 2024-05-04 12:27:58 -0700 | [diff] [blame] | 178 | src = "y2024_swerve.json", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 179 | flatbuffers = [ |
| 180 | "//aos/network:message_bridge_client_fbs", |
| 181 | "//aos/network:message_bridge_server_fbs", |
| 182 | "//aos/network:timestamp_fbs", |
| 183 | "//frc971/input:robot_state_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 184 | "//frc971/vision:vision_fbs", |
| 185 | "//frc971/vision:target_map_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 186 | ], |
| 187 | target_compatible_with = ["@platforms//os:linux"], |
| 188 | visibility = ["//visibility:public"], |
| 189 | deps = [ |
| 190 | ":config_imu", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 191 | ":config_orin1", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 192 | ":config_roborio", |
| 193 | ], |
| 194 | ) |
| 195 | |
| 196 | aos_config( |
| 197 | name = "config_roborio", |
Nikolai Sohmers | 3cc1fc2 | 2024-05-04 12:27:58 -0700 | [diff] [blame] | 198 | src = "y2024_swerve_roborio.json", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 199 | flatbuffers = [ |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 200 | "//frc971:can_configuration_fbs", |
Nikolai Sohmers | c4fce5d | 2024-06-15 19:46:46 -0500 | [diff] [blame] | 201 | "//frc971/queues:gyro_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 202 | "//aos/network:remote_message_fbs", |
| 203 | "//aos/network:message_bridge_client_fbs", |
| 204 | "//aos/network:message_bridge_server_fbs", |
| 205 | "//aos/network:timestamp_fbs", |
Nikolai Sohmers | c4fce5d | 2024-06-15 19:46:46 -0500 | [diff] [blame] | 206 | "//frc971/control_loops/swerve:swerve_drivetrain_goal_fbs", |
| 207 | "//frc971/control_loops/swerve:swerve_drivetrain_status_fbs", |
James Kuszmaul | d938d33 | 2024-05-15 20:47:19 -0700 | [diff] [blame] | 208 | "//frc971/control_loops/swerve:swerve_drivetrain_output_fbs", |
| 209 | "//frc971/control_loops/swerve:swerve_drivetrain_position_fbs", |
Nikolai Sohmers | c4fce5d | 2024-06-15 19:46:46 -0500 | [diff] [blame] | 210 | "//y2024_swerve/constants:constants_fbs", |
Nikolai Sohmers | 3f2a507 | 2024-06-08 14:05:59 -0700 | [diff] [blame] | 211 | "//frc971/control_loops/swerve:swerve_drivetrain_can_position_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 212 | "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs", |
| 213 | "//frc971/can_logger:can_logging_fbs", |
| 214 | ], |
| 215 | target_compatible_with = ["@platforms//os:linux"], |
| 216 | deps = [ |
| 217 | "//aos/events:aos_config", |
| 218 | "//frc971/autonomous:aos_config", |
| 219 | "//frc971/control_loops/drivetrain:aos_config", |
| 220 | "//frc971/input:aos_config", |
| 221 | "//frc971/wpilib:aos_config", |
| 222 | ], |
| 223 | ) |
| 224 | |
| 225 | aos_config( |
| 226 | name = "config_imu", |
Nikolai Sohmers | 3cc1fc2 | 2024-05-04 12:27:58 -0700 | [diff] [blame] | 227 | src = "y2024_swerve_imu.json", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 228 | flatbuffers = [ |
| 229 | "//aos/network:message_bridge_client_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 230 | "//y2024_swerve/constants:constants_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 231 | "//aos/network:message_bridge_server_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 232 | "//frc971/imu_fdcan:dual_imu_fbs", |
| 233 | "//frc971/imu_fdcan:can_translator_status_fbs", |
| 234 | "//frc971/imu_fdcan:dual_imu_blender_status_fbs", |
| 235 | "//frc971/can_logger:can_logging_fbs", |
| 236 | "//frc971/orin:hardware_stats_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 237 | "//aos/network:timestamp_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 238 | "//aos/util:filesystem_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 239 | "//aos/network:remote_message_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 240 | "//frc971/vision:calibration_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 241 | "//frc971/vision:target_map_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 242 | "//frc971/vision:vision_fbs", |
| 243 | "@com_github_foxglove_schemas//:schemas", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 244 | ], |
| 245 | target_compatible_with = ["@platforms//os:linux"], |
| 246 | visibility = ["//visibility:public"], |
| 247 | deps = [ |
| 248 | "//aos/events:aos_config", |
| 249 | "//frc971/control_loops/drivetrain:aos_config", |
| 250 | ], |
| 251 | ) |
| 252 | |
| 253 | aos_config( |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 254 | name = "config_orin1", |
| 255 | src = "y2024_swerve_orin1.json", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 256 | flatbuffers = [ |
| 257 | "//aos/network:message_bridge_client_fbs", |
| 258 | "//aos/network:message_bridge_server_fbs", |
| 259 | "//aos/network:timestamp_fbs", |
| 260 | "//aos/network:remote_message_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 261 | "//y2024_swerve/constants:constants_fbs", |
| 262 | "//frc971/orin:hardware_stats_fbs", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 263 | "//frc971/vision:calibration_fbs", |
| 264 | "//frc971/vision:target_map_fbs", |
Nikolai Sohmers | 74e52ef | 2024-05-29 10:12:23 -0700 | [diff] [blame] | 265 | "//frc971/vision:vision_fbs", |
| 266 | "//aos/util:filesystem_fbs", |
| 267 | "@com_github_foxglove_schemas//:schemas", |
Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame] | 268 | ], |
| 269 | target_compatible_with = ["@platforms//os:linux"], |
| 270 | visibility = ["//visibility:public"], |
| 271 | deps = [ |
| 272 | "//aos/events:aos_config", |
| 273 | "//frc971/control_loops/drivetrain:aos_config", |
| 274 | "//frc971/input:aos_config", |
| 275 | ], |
| 276 | ) |