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