blob: a17df89325aae0fec81742920545e41eaaa7e64a [file] [log] [blame]
Adam Snaider13d48d92023-08-03 12:20:15 -07001load("@rules_cc//cc:defs.bzl", "cc_proto_library")
2load("@rules_proto//proto:defs.bzl", "proto_library")
Austin Schuh8f99c822024-05-05 22:43:40 -07003load("//aos:config.bzl", "aos_config")
4load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
5load("//frc971:downloader.bzl", "robot_downloader")
Neil Balchacfca5b2018-01-28 14:04:08 -08006
Lee Mracek6821fe02018-11-01 17:27:30 -04007robot_downloader(
8 start_binaries = [
Austin Schuh2a3e0632018-02-19 16:24:49 -08009 ":joystick_reader",
10 ":wpilib_interface",
Austin Schuh8d5fff42018-05-30 20:44:12 -070011 "//y2018/vision:vision_status",
Austin Schuha3c148e2018-03-09 21:04:05 -080012 "//y2018/actors:autonomous_action",
Lee Mracek6821fe02018-11-01 17:27:30 -040013 "//y2018/control_loops/drivetrain:drivetrain",
Austin Schuha3c148e2018-03-09 21:04:05 -080014 "//y2018/control_loops/superstructure:superstructure",
Austin Schuh2a3e0632018-02-19 16:24:49 -080015 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080016 target_compatible_with = ["@platforms//os:linux"],
Neil Balchacfca5b2018-01-28 14:04:08 -080017)
18
Neil Balchacfca5b2018-01-28 14:04:08 -080019cc_binary(
Austin Schuh2a3e0632018-02-19 16:24:49 -080020 name = "joystick_reader",
21 srcs = [
22 "joystick_reader.cc",
23 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080024 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2a3e0632018-02-19 16:24:49 -080025 deps = [
Austin Schuh8d5fff42018-05-30 20:44:12 -070026 ":vision_proto",
Austin Schuhf9724442018-10-28 20:30:21 -070027 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070028 "//aos/actions:action_lib",
Austin Schuhf9724442018-10-28 20:30:21 -070029 "//aos/logging",
30 "//aos/network:team_number",
31 "//aos/stl_mutex",
32 "//aos/time",
33 "//aos/util:log_interval",
Austin Schuh8d5fff42018-05-30 20:44:12 -070034 "//aos/vision/events:udp",
Alex Perrycb7da4b2019-08-28 19:35:56 -070035 "//frc971/autonomous:auto_fbs",
Austin Schuha3c148e2018-03-09 21:04:05 -080036 "//frc971/autonomous:base_autonomous_actor",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070037 "//frc971/input:action_joystick_input",
38 "//frc971/input:drivetrain_input",
Austin Schuh2a3e0632018-02-19 16:24:49 -080039 "//y2018/control_loops/drivetrain:drivetrain_base",
Alex Perrycb7da4b2019-08-28 19:35:56 -070040 "//y2018/control_loops/superstructure:superstructure_goal_fbs",
41 "//y2018/control_loops/superstructure:superstructure_position_fbs",
42 "//y2018/control_loops/superstructure:superstructure_status_fbs",
Austin Schuhab15c4d2018-03-09 21:21:03 -080043 "//y2018/control_loops/superstructure/arm:generated_graph",
Austin Schuh2a3e0632018-02-19 16:24:49 -080044 ],
45)
46
47cc_library(
48 name = "constants",
49 srcs = [
50 "constants.cc",
51 ],
52 hdrs = [
53 "constants.h",
54 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080055 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2a3e0632018-02-19 16:24:49 -080056 visibility = ["//visibility:public"],
57 deps = [
John Park33858a32018-09-28 23:05:48 -070058 "//aos/network:team_number",
Brian Silverman1463c092020-10-30 17:28:24 -070059 "//aos/stl_mutex",
Austin Schuh2a3e0632018-02-19 16:24:49 -080060 "//frc971:constants",
Maxwell Henderson8f0e07f2023-02-08 21:10:58 -080061 "//frc971/control_loops/double_jointed_arm:dynamics",
Austin Schuh2a3e0632018-02-19 16:24:49 -080062 "//frc971/shooter_interpolation:interpolation",
63 "//y2018/control_loops/drivetrain:polydrivetrain_plants",
Maxwell Henderson8f0e07f2023-02-08 21:10:58 -080064 "//y2018/control_loops/superstructure/arm:arm_constants",
Austin Schuh2a3e0632018-02-19 16:24:49 -080065 "//y2018/control_loops/superstructure/intake:intake_plants",
Austin Schuh99f7c6a2024-06-25 22:07:44 -070066 "@com_google_absl//absl/log",
67 "@com_google_absl//absl/log:check",
Austin Schuh2a3e0632018-02-19 16:24:49 -080068 ],
69)
70
71cc_binary(
72 name = "wpilib_interface",
73 srcs = [
74 "wpilib_interface.cc",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Austin Schuh2a3e0632018-02-19 16:24:49 -080077 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070078 ":status_light_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070079 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070080 "//aos:math",
John Park33858a32018-09-28 23:05:48 -070081 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070082 "//aos/time",
John Park33858a32018-09-28 23:05:48 -070083 "//aos/util:log_interval",
84 "//aos/util:phased_loop",
85 "//aos/util:wrapping_counter",
Alex Perrycb7da4b2019-08-28 19:35:56 -070086 "//frc971/autonomous:auto_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070087 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070088 "//frc971/control_loops:control_loops_fbs",
89 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
90 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070091 "//frc971/input:robot_state_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -080092 "//frc971/wpilib:ADIS16448",
93 "//frc971/wpilib:buffered_pcm",
94 "//frc971/wpilib:dma",
95 "//frc971/wpilib:dma_edge_counting",
Sabina Daviscaa2a6b2019-02-03 01:15:37 -080096 "//frc971/wpilib:drivetrain_writer",
Austin Schuh2a3e0632018-02-19 16:24:49 -080097 "//frc971/wpilib:encoder_and_potentiometer",
Austin Schuh2a3e0632018-02-19 16:24:49 -080098 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -070099 "//frc971/wpilib:logging_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800100 "//frc971/wpilib:loop_output_handler",
101 "//frc971/wpilib:pdp_fetcher",
Austin Schuh6abf5b72019-02-02 20:20:54 -0800102 "//frc971/wpilib:sensor_reader",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800103 "//frc971/wpilib:wpilib_robot_base",
Austin Schuhf6b94632019-02-02 22:11:27 -0800104 "//third_party:phoenix",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800105 "//third_party:wpilib",
106 "//y2018:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700107 "//y2018/control_loops/superstructure:superstructure_output_fbs",
108 "//y2018/control_loops/superstructure:superstructure_position_fbs",
109 "//y2018/vision:vision_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800110 ],
Neil Balchacfca5b2018-01-28 14:04:08 -0800111)
Brian Silverman37281fc2018-03-11 18:42:17 -0700112
James Kuszmaulf01da392023-12-14 11:22:14 -0800113static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114 name = "status_light_fbs",
Brian Silverman37281fc2018-03-11 18:42:17 -0700115 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700116 "status_light.fbs",
117 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800118 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700119 visibility = ["//visibility:public"],
120)
121
122aos_config(
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800123 name = "aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700124 src = "y2018.json",
125 flatbuffers = [
126 ":status_light_fbs",
127 "//y2018/control_loops/superstructure:superstructure_goal_fbs",
128 "//y2018/control_loops/superstructure:superstructure_output_fbs",
129 "//y2018/control_loops/superstructure:superstructure_position_fbs",
130 "//y2018/control_loops/superstructure:superstructure_status_fbs",
131 "//y2018/vision:vision_fbs",
Brian Silverman37281fc2018-03-11 18:42:17 -0700132 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800133 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8d5fff42018-05-30 20:44:12 -0700134 visibility = ["//visibility:public"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700135 deps = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800136 "//frc971/control_loops/drivetrain:aos_config",
137 "//frc971/input:aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700138 ],
Austin Schuh8d5fff42018-05-30 20:44:12 -0700139)
140
Adam Snaider13d48d92023-08-03 12:20:15 -0700141proto_library(
142 name = "vision_proto_proto",
Austin Schuhf9724442018-10-28 20:30:21 -0700143 srcs = ["vision.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800144 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8d5fff42018-05-30 20:44:12 -0700145 visibility = ["//visibility:public"],
Brian Silverman37281fc2018-03-11 18:42:17 -0700146)
Brian Silverman6470f442018-08-05 12:08:16 -0700147
Adam Snaider13d48d92023-08-03 12:20:15 -0700148cc_proto_library(
149 name = "vision_proto",
150 target_compatible_with = ["@platforms//os:linux"],
151 visibility = ["//visibility:public"],
152 deps = ["vision_proto_proto"],
153)
154
Brian Silverman6470f442018-08-05 12:08:16 -0700155py_library(
156 name = "python_init",
157 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700159 visibility = ["//visibility:public"],
160)