Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 1 | load("//frc971:downloader.bzl", "robot_downloader") |
| 2 | load("//aos:config.bzl", "aos_config") |
| 3 | load("//tools/build_rules:template.bzl", "jinja2_template") |
| 4 | |
| 5 | robot_downloader( |
| 6 | name = "pi_download", |
| 7 | binaries = [ |
James Kuszmaul | 7e95881 | 2023-02-11 15:34:31 -0800 | [diff] [blame] | 8 | "//frc971/vision:intrinsics_calibration", |
James Kuszmaul | 77d536c | 2023-02-11 17:30:59 -0800 | [diff] [blame] | 9 | "//aos/util:foxglove_websocket", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 10 | "//y2023/vision:viewer", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 11 | "//y2023/vision:aprilrobotics", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 12 | "//y2022/localizer:localizer_main", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 13 | "//y2023/constants:constants_sender", |
James Kuszmaul | 77d536c | 2023-02-11 17:30:59 -0800 | [diff] [blame] | 14 | "//y2023/vision:foxglove_image_converter", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 15 | "//aos/network:web_proxy_main", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 16 | "//aos/events/logging:log_cat", |
Austin Schuh | b07dd5b | 2023-02-05 22:29:11 -0800 | [diff] [blame] | 17 | "//y2023/rockpi:imu_main", |
milind-u | 8e98cb9 | 2023-02-05 16:07:10 -0800 | [diff] [blame^] | 18 | "//frc971/image_streamer:image_streamer", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 19 | ], |
| 20 | data = [ |
| 21 | ":aos_config", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 22 | "//y2023/constants:constants.json", |
milind-u | 8e98cb9 | 2023-02-05 16:07:10 -0800 | [diff] [blame^] | 23 | "//y2023/vision:image_streamer_start", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 24 | "//y2023/www:www_files", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 25 | ], |
| 26 | dirs = [ |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 27 | "//y2023/www:www_files", |
milind-u | 8e98cb9 | 2023-02-05 16:07:10 -0800 | [diff] [blame^] | 28 | "//frc971/image_streamer/www:www_files", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 29 | ], |
| 30 | start_binaries = [ |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 31 | "//aos/network:message_bridge_client", |
| 32 | "//aos/network:message_bridge_server", |
| 33 | "//aos/network:web_proxy_main", |
Austin Schuh | 3e1d3b6 | 2023-01-08 13:52:31 -0800 | [diff] [blame] | 34 | "//aos/starter:irq_affinity", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 35 | "//y2023/vision:camera_reader", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 36 | "//aos/events/logging:logger_main", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 37 | ], |
| 38 | target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"], |
| 39 | target_type = "pi", |
| 40 | ) |
| 41 | |
| 42 | aos_config( |
| 43 | name = "aos_config", |
| 44 | src = "y2023.json", |
| 45 | flatbuffers = [ |
| 46 | "//aos/network:message_bridge_client_fbs", |
| 47 | "//aos/network:message_bridge_server_fbs", |
| 48 | "//aos/network:timestamp_fbs", |
| 49 | "//frc971/input:robot_state_fbs", |
| 50 | "//frc971/vision:vision_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 51 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 52 | ], |
| 53 | target_compatible_with = ["@platforms//os:linux"], |
| 54 | visibility = ["//visibility:public"], |
| 55 | deps = [ |
| 56 | ":config_imu", |
| 57 | ":config_logger", |
| 58 | ":config_pi1", |
| 59 | ":config_pi2", |
| 60 | ":config_pi3", |
| 61 | ":config_pi4", |
| 62 | ":config_roborio", |
| 63 | ], |
| 64 | ) |
| 65 | |
| 66 | [ |
| 67 | aos_config( |
| 68 | name = "config_" + pi, |
| 69 | src = "y2023_" + pi + ".json", |
| 70 | flatbuffers = [ |
| 71 | "//aos/network:message_bridge_client_fbs", |
| 72 | "//aos/network:message_bridge_server_fbs", |
| 73 | "//aos/network:timestamp_fbs", |
| 74 | "//aos/network:remote_message_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 75 | "//y2023/constants:constants_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 76 | "//y2022/localizer:localizer_output_fbs", |
milind-u | 2f101fc | 2023-01-21 12:28:49 -0800 | [diff] [blame] | 77 | "//frc971/vision:calibration_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 78 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 79 | "//frc971/vision:vision_fbs", |
Yash Chainani | 728ae22 | 2023-02-04 19:48:12 -0800 | [diff] [blame] | 80 | "//y2023/vision:april_debug_fbs", |
James Kuszmaul | f3ec4db | 2023-02-12 14:18:41 -0800 | [diff] [blame] | 81 | "@com_github_foxglove_schemas//:schemas", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 82 | ], |
| 83 | target_compatible_with = ["@platforms//os:linux"], |
| 84 | visibility = ["//visibility:public"], |
| 85 | deps = [ |
| 86 | "//aos/events:aos_config", |
| 87 | "//frc971/control_loops/drivetrain:aos_config", |
| 88 | "//frc971/input:aos_config", |
| 89 | ], |
| 90 | ) |
| 91 | for pi in [ |
| 92 | "pi1", |
| 93 | "pi2", |
| 94 | "pi3", |
| 95 | "pi4", |
| 96 | ] |
| 97 | ] |
| 98 | |
| 99 | aos_config( |
| 100 | name = "config_imu", |
| 101 | src = "y2023_imu.json", |
| 102 | flatbuffers = [ |
| 103 | "//aos/network:message_bridge_client_fbs", |
| 104 | "//aos/network:message_bridge_server_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 105 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 106 | "//aos/network:timestamp_fbs", |
| 107 | "//aos/network:remote_message_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 108 | "//y2022/localizer:localizer_status_fbs", |
| 109 | "//y2022/localizer:localizer_output_fbs", |
| 110 | "//y2022/localizer:localizer_visualization_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 111 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 112 | ], |
| 113 | target_compatible_with = ["@platforms//os:linux"], |
| 114 | visibility = ["//visibility:public"], |
| 115 | deps = [ |
| 116 | "//aos/events:aos_config", |
| 117 | "//frc971/control_loops/drivetrain:aos_config", |
| 118 | ], |
| 119 | ) |
| 120 | |
| 121 | aos_config( |
| 122 | name = "config_logger", |
| 123 | src = "y2023_logger.json", |
| 124 | flatbuffers = [ |
| 125 | "//aos/network:message_bridge_client_fbs", |
| 126 | "//aos/network:message_bridge_server_fbs", |
| 127 | "//aos/network:timestamp_fbs", |
| 128 | "//aos/network:remote_message_fbs", |
milind-u | 2f101fc | 2023-01-21 12:28:49 -0800 | [diff] [blame] | 129 | "//frc971/vision:calibration_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 130 | "//frc971/vision:vision_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 131 | "//frc971/vision:target_map_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 132 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 133 | ], |
| 134 | target_compatible_with = ["@platforms//os:linux"], |
| 135 | visibility = ["//visibility:public"], |
| 136 | deps = [ |
| 137 | "//aos/events:aos_config", |
| 138 | "//frc971/control_loops/drivetrain:aos_config", |
| 139 | "//frc971/input:aos_config", |
| 140 | ], |
| 141 | ) |
| 142 | |
| 143 | aos_config( |
| 144 | name = "config_roborio", |
| 145 | src = "y2023_roborio.json", |
| 146 | flatbuffers = [ |
| 147 | "//aos/network:remote_message_fbs", |
| 148 | "//aos/network:message_bridge_client_fbs", |
| 149 | "//aos/network:message_bridge_server_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 150 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 151 | "//aos/network:timestamp_fbs", |
| 152 | "//y2019/control_loops/drivetrain:target_selector_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 153 | "//y2023/control_loops/superstructure:superstructure_goal_fbs", |
| 154 | "//y2023/control_loops/superstructure:superstructure_output_fbs", |
| 155 | "//y2023/control_loops/superstructure:superstructure_position_fbs", |
| 156 | "//y2023/control_loops/superstructure:superstructure_status_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 157 | ], |
| 158 | target_compatible_with = ["@platforms//os:linux"], |
| 159 | deps = [ |
| 160 | "//aos/events:aos_config", |
| 161 | "//frc971/autonomous:aos_config", |
| 162 | "//frc971/control_loops/drivetrain:aos_config", |
| 163 | "//frc971/input:aos_config", |
| 164 | "//frc971/wpilib:aos_config", |
| 165 | ], |
| 166 | ) |
| 167 | |
| 168 | [ |
| 169 | jinja2_template( |
| 170 | name = "y2023_pi" + str(num) + ".json", |
| 171 | src = "y2023_pi_template.json", |
| 172 | parameters = {"NUM": str(num)}, |
| 173 | target_compatible_with = ["@platforms//os:linux"], |
| 174 | ) |
| 175 | for num in range(1, 6) |
| 176 | ] |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 177 | |
| 178 | cc_library( |
| 179 | name = "constants", |
| 180 | srcs = [ |
| 181 | "constants.cc", |
| 182 | ], |
| 183 | hdrs = [ |
| 184 | "constants.h", |
| 185 | ], |
| 186 | visibility = ["//visibility:public"], |
| 187 | deps = [ |
| 188 | "//aos/mutex", |
| 189 | "//aos/network:team_number", |
| 190 | "//frc971:constants", |
| 191 | "//frc971/control_loops:pose", |
| 192 | "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem", |
| 193 | "//frc971/shooter_interpolation:interpolation", |
| 194 | "//y2023/control_loops/drivetrain:polydrivetrain_plants", |
| 195 | "@com_github_google_glog//:glog", |
| 196 | "@com_google_absl//absl/base", |
| 197 | ], |
| 198 | ) |
| 199 | |
| 200 | cc_binary( |
| 201 | name = "wpilib_interface", |
| 202 | srcs = [ |
| 203 | "wpilib_interface.cc", |
| 204 | ], |
| 205 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 206 | deps = [ |
| 207 | ":constants", |
| 208 | "//aos:init", |
| 209 | "//aos:math", |
| 210 | "//aos/events:shm_event_loop", |
| 211 | "//aos/logging", |
| 212 | "//aos/stl_mutex", |
| 213 | "//aos/time", |
| 214 | "//aos/util:log_interval", |
| 215 | "//aos/util:phased_loop", |
| 216 | "//aos/util:wrapping_counter", |
| 217 | "//frc971/autonomous:auto_mode_fbs", |
| 218 | "//frc971/control_loops:control_loop", |
| 219 | "//frc971/control_loops:control_loops_fbs", |
| 220 | "//frc971/control_loops/drivetrain:drivetrain_position_fbs", |
| 221 | "//frc971/input:robot_state_fbs", |
| 222 | "//frc971/queues:gyro_fbs", |
| 223 | "//frc971/wpilib:ADIS16448", |
| 224 | "//frc971/wpilib:buffered_pcm", |
| 225 | "//frc971/wpilib:drivetrain_writer", |
| 226 | "//frc971/wpilib:encoder_and_potentiometer", |
| 227 | "//frc971/wpilib:interrupt_edge_counting", |
| 228 | "//frc971/wpilib:joystick_sender", |
| 229 | "//frc971/wpilib:logging_fbs", |
| 230 | "//frc971/wpilib:loop_output_handler", |
| 231 | "//frc971/wpilib:pdp_fetcher", |
| 232 | "//frc971/wpilib:sensor_reader", |
| 233 | "//frc971/wpilib:wpilib_interface", |
| 234 | "//frc971/wpilib:wpilib_robot_base", |
| 235 | "//third_party:phoenix", |
| 236 | "//third_party:wpilib", |
| 237 | "//y2023/control_loops/superstructure:superstructure_output_fbs", |
| 238 | "//y2023/control_loops/superstructure:superstructure_position_fbs", |
| 239 | ], |
| 240 | ) |
| 241 | |
| 242 | cc_binary( |
| 243 | name = "joystick_reader", |
| 244 | srcs = [ |
| 245 | ":joystick_reader.cc", |
| 246 | ], |
| 247 | deps = [ |
| 248 | ":constants", |
| 249 | "//aos:init", |
| 250 | "//aos/actions:action_lib", |
| 251 | "//aos/logging", |
| 252 | "//frc971/autonomous:auto_fbs", |
| 253 | "//frc971/autonomous:base_autonomous_actor", |
| 254 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 255 | "//frc971/input:action_joystick_input", |
| 256 | "//frc971/input:drivetrain_input", |
| 257 | "//frc971/input:joystick_input", |
| 258 | "//y2023/control_loops/drivetrain:drivetrain_base", |
| 259 | "//y2023/control_loops/superstructure:superstructure_goal_fbs", |
| 260 | "//y2023/control_loops/superstructure:superstructure_status_fbs", |
| 261 | ], |
| 262 | ) |
| 263 | |
| 264 | py_library( |
| 265 | name = "python_init", |
| 266 | srcs = ["__init__.py"], |
| 267 | target_compatible_with = ["@platforms//os:linux"], |
| 268 | visibility = ["//visibility:public"], |
| 269 | ) |
| 270 | |
| 271 | sh_binary( |
| 272 | name = "log_web_proxy", |
| 273 | srcs = ["log_web_proxy.sh"], |
| 274 | data = [ |
| 275 | ":aos_config", |
| 276 | "//aos/network:log_web_proxy_main", |
| 277 | "//y2023/www:field_main_bundle.min.js", |
| 278 | "//y2023/www:files", |
| 279 | ], |
| 280 | target_compatible_with = ["@platforms//os:linux"], |
| 281 | ) |
Austin Schuh | e6b2b88 | 2023-02-04 11:42:40 -0800 | [diff] [blame] | 282 | |
| 283 | cc_binary( |
| 284 | name = "ssd_profiler", |
| 285 | srcs = [ |
| 286 | "ssd_profiler.cc", |
| 287 | ], |
| 288 | deps = [ |
| 289 | "//aos:init", |
| 290 | "//aos/time", |
| 291 | "@com_github_google_glog//:glog", |
| 292 | ], |
| 293 | ) |