blob: 129cd8450491fea4a84bc47b013799f5d8ee1ce1 [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",
Brian Silvermanf4d329c2021-11-04 19:32:10 -070066 "@com_github_google_glog//:glog",
Austin Schuh2a3e0632018-02-19 16:24:49 -080067 ],
68)
69
70cc_binary(
71 name = "wpilib_interface",
72 srcs = [
73 "wpilib_interface.cc",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Austin Schuh2a3e0632018-02-19 16:24:49 -080076 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070077 ":status_light_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070078 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070079 "//aos:math",
John Park33858a32018-09-28 23:05:48 -070080 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070081 "//aos/time",
John Park33858a32018-09-28 23:05:48 -070082 "//aos/util:log_interval",
83 "//aos/util:phased_loop",
84 "//aos/util:wrapping_counter",
Alex Perrycb7da4b2019-08-28 19:35:56 -070085 "//frc971/autonomous:auto_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070086 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070087 "//frc971/control_loops:control_loops_fbs",
88 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
89 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070090 "//frc971/input:robot_state_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -080091 "//frc971/wpilib:ADIS16448",
92 "//frc971/wpilib:buffered_pcm",
93 "//frc971/wpilib:dma",
94 "//frc971/wpilib:dma_edge_counting",
Sabina Daviscaa2a6b2019-02-03 01:15:37 -080095 "//frc971/wpilib:drivetrain_writer",
Austin Schuh2a3e0632018-02-19 16:24:49 -080096 "//frc971/wpilib:encoder_and_potentiometer",
Austin Schuh2a3e0632018-02-19 16:24:49 -080097 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -070098 "//frc971/wpilib:logging_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -080099 "//frc971/wpilib:loop_output_handler",
100 "//frc971/wpilib:pdp_fetcher",
Austin Schuh6abf5b72019-02-02 20:20:54 -0800101 "//frc971/wpilib:sensor_reader",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800102 "//frc971/wpilib:wpilib_robot_base",
Austin Schuhf6b94632019-02-02 22:11:27 -0800103 "//third_party:phoenix",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800104 "//third_party:wpilib",
105 "//y2018:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700106 "//y2018/control_loops/superstructure:superstructure_output_fbs",
107 "//y2018/control_loops/superstructure:superstructure_position_fbs",
108 "//y2018/vision:vision_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800109 ],
Neil Balchacfca5b2018-01-28 14:04:08 -0800110)
Brian Silverman37281fc2018-03-11 18:42:17 -0700111
James Kuszmaulf01da392023-12-14 11:22:14 -0800112static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700113 name = "status_light_fbs",
Brian Silverman37281fc2018-03-11 18:42:17 -0700114 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700115 "status_light.fbs",
116 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800117 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700118 visibility = ["//visibility:public"],
119)
120
121aos_config(
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800122 name = "aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700123 src = "y2018.json",
124 flatbuffers = [
125 ":status_light_fbs",
126 "//y2018/control_loops/superstructure:superstructure_goal_fbs",
127 "//y2018/control_loops/superstructure:superstructure_output_fbs",
128 "//y2018/control_loops/superstructure:superstructure_position_fbs",
129 "//y2018/control_loops/superstructure:superstructure_status_fbs",
130 "//y2018/vision:vision_fbs",
Brian Silverman37281fc2018-03-11 18:42:17 -0700131 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800132 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8d5fff42018-05-30 20:44:12 -0700133 visibility = ["//visibility:public"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700134 deps = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800135 "//frc971/control_loops/drivetrain:aos_config",
136 "//frc971/input:aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700137 ],
Austin Schuh8d5fff42018-05-30 20:44:12 -0700138)
139
Adam Snaider13d48d92023-08-03 12:20:15 -0700140proto_library(
141 name = "vision_proto_proto",
Austin Schuhf9724442018-10-28 20:30:21 -0700142 srcs = ["vision.proto"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800143 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8d5fff42018-05-30 20:44:12 -0700144 visibility = ["//visibility:public"],
Brian Silverman37281fc2018-03-11 18:42:17 -0700145)
Brian Silverman6470f442018-08-05 12:08:16 -0700146
Adam Snaider13d48d92023-08-03 12:20:15 -0700147cc_proto_library(
148 name = "vision_proto",
149 target_compatible_with = ["@platforms//os:linux"],
150 visibility = ["//visibility:public"],
151 deps = ["vision_proto_proto"],
152)
153
Brian Silverman6470f442018-08-05 12:08:16 -0700154py_library(
155 name = "python_init",
156 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800157 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700158 visibility = ["//visibility:public"],
159)