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