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