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