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