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