blob: 8feaac49c840d7ad8732e2b861a4a2ea7f43a285 [file] [log] [blame]
Lee Mracek6821fe02018-11-01 17:27:30 -04001load("//frc971:downloader.bzl", "robot_downloader")
Alex Perrycb7da4b2019-08-28 19:35:56 -07002load("//aos:config.bzl", "aos_config")
Austin Schuhf9724442018-10-28 20:30:21 -07003load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
Alex Perrycb7da4b2019-08-28 19:35:56 -07004load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Neil Balchacfca5b2018-01-28 14:04:08 -08005
Lee Mracek6821fe02018-11-01 17:27:30 -04006robot_downloader(
7 start_binaries = [
Austin Schuh2a3e0632018-02-19 16:24:49 -08008 ":joystick_reader",
9 ":wpilib_interface",
Austin Schuh8d5fff42018-05-30 20:44:12 -070010 "//y2018/vision:vision_status",
Austin Schuha3c148e2018-03-09 21:04:05 -080011 "//y2018/actors:autonomous_action",
Lee Mracek6821fe02018-11-01 17:27:30 -040012 "//y2018/control_loops/drivetrain:drivetrain",
Austin Schuha3c148e2018-03-09 21:04:05 -080013 "//y2018/control_loops/superstructure:superstructure",
Austin Schuh2a3e0632018-02-19 16:24:49 -080014 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080015 target_compatible_with = ["@platforms//os:linux"],
Neil Balchacfca5b2018-01-28 14:04:08 -080016)
17
Neil Balchacfca5b2018-01-28 14:04:08 -080018cc_binary(
Austin Schuh2a3e0632018-02-19 16:24:49 -080019 name = "joystick_reader",
20 srcs = [
21 "joystick_reader.cc",
22 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080023 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2a3e0632018-02-19 16:24:49 -080024 deps = [
Austin Schuh8d5fff42018-05-30 20:44:12 -070025 ":vision_proto",
Austin Schuhf9724442018-10-28 20:30:21 -070026 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070027 "//aos/actions:action_lib",
Austin Schuhf9724442018-10-28 20:30:21 -070028 "//aos/logging",
29 "//aos/network:team_number",
30 "//aos/stl_mutex",
31 "//aos/time",
32 "//aos/util:log_interval",
Austin Schuh8d5fff42018-05-30 20:44:12 -070033 "//aos/vision/events:udp",
Alex Perrycb7da4b2019-08-28 19:35:56 -070034 "//frc971/autonomous:auto_fbs",
Austin Schuha3c148e2018-03-09 21:04:05 -080035 "//frc971/autonomous:base_autonomous_actor",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070036 "//frc971/input:action_joystick_input",
37 "//frc971/input:drivetrain_input",
Austin Schuh2a3e0632018-02-19 16:24:49 -080038 "//y2018/control_loops/drivetrain:drivetrain_base",
Alex Perrycb7da4b2019-08-28 19:35:56 -070039 "//y2018/control_loops/superstructure:superstructure_goal_fbs",
40 "//y2018/control_loops/superstructure:superstructure_position_fbs",
41 "//y2018/control_loops/superstructure:superstructure_status_fbs",
Austin Schuhab15c4d2018-03-09 21:21:03 -080042 "//y2018/control_loops/superstructure/arm:generated_graph",
Austin Schuh2a3e0632018-02-19 16:24:49 -080043 ],
44)
45
46cc_library(
47 name = "constants",
48 srcs = [
49 "constants.cc",
50 ],
51 hdrs = [
52 "constants.h",
53 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080054 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2a3e0632018-02-19 16:24:49 -080055 visibility = ["//visibility:public"],
56 deps = [
John Park33858a32018-09-28 23:05:48 -070057 "//aos/network:team_number",
Brian Silverman1463c092020-10-30 17:28:24 -070058 "//aos/stl_mutex",
Austin Schuh2a3e0632018-02-19 16:24:49 -080059 "//frc971:constants",
Maxwell Henderson8f0e07f2023-02-08 21:10:58 -080060 "//frc971/control_loops/double_jointed_arm:dynamics",
Austin Schuh2a3e0632018-02-19 16:24:49 -080061 "//frc971/shooter_interpolation:interpolation",
62 "//y2018/control_loops/drivetrain:polydrivetrain_plants",
Maxwell Henderson8f0e07f2023-02-08 21:10:58 -080063 "//y2018/control_loops/superstructure/arm:arm_constants",
Austin Schuh2a3e0632018-02-19 16:24:49 -080064 "//y2018/control_loops/superstructure/intake:intake_plants",
Brian Silvermanf4d329c2021-11-04 19:32:10 -070065 "@com_github_google_glog//:glog",
Austin Schuh2a3e0632018-02-19 16:24:49 -080066 ],
67)
68
69cc_binary(
70 name = "wpilib_interface",
71 srcs = [
72 "wpilib_interface.cc",
73 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080074 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Austin Schuh2a3e0632018-02-19 16:24:49 -080075 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070076 ":status_light_fbs",
Austin Schuhf9724442018-10-28 20:30:21 -070077 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070078 "//aos:math",
John Park33858a32018-09-28 23:05:48 -070079 "//aos/logging",
Austin Schuhf9724442018-10-28 20:30:21 -070080 "//aos/time",
John Park33858a32018-09-28 23:05:48 -070081 "//aos/util:log_interval",
82 "//aos/util:phased_loop",
83 "//aos/util:wrapping_counter",
Alex Perrycb7da4b2019-08-28 19:35:56 -070084 "//frc971/autonomous:auto_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070085 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070086 "//frc971/control_loops:control_loops_fbs",
87 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
88 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070089 "//frc971/input:robot_state_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -080090 "//frc971/wpilib:ADIS16448",
91 "//frc971/wpilib:buffered_pcm",
92 "//frc971/wpilib:dma",
93 "//frc971/wpilib:dma_edge_counting",
Sabina Daviscaa2a6b2019-02-03 01:15:37 -080094 "//frc971/wpilib:drivetrain_writer",
Austin Schuh2a3e0632018-02-19 16:24:49 -080095 "//frc971/wpilib:encoder_and_potentiometer",
Austin Schuh2a3e0632018-02-19 16:24:49 -080096 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -070097 "//frc971/wpilib:logging_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -080098 "//frc971/wpilib:loop_output_handler",
99 "//frc971/wpilib:pdp_fetcher",
Austin Schuh6abf5b72019-02-02 20:20:54 -0800100 "//frc971/wpilib:sensor_reader",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800101 "//frc971/wpilib:wpilib_robot_base",
Austin Schuhf6b94632019-02-02 22:11:27 -0800102 "//third_party:phoenix",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800103 "//third_party:wpilib",
104 "//y2018:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700105 "//y2018/control_loops/superstructure:superstructure_output_fbs",
106 "//y2018/control_loops/superstructure:superstructure_position_fbs",
107 "//y2018/vision:vision_fbs",
Austin Schuh2a3e0632018-02-19 16:24:49 -0800108 ],
Neil Balchacfca5b2018-01-28 14:04:08 -0800109)
Brian Silverman37281fc2018-03-11 18:42:17 -0700110
Alex Perrycb7da4b2019-08-28 19:35:56 -0700111flatbuffer_cc_library(
112 name = "status_light_fbs",
Brian Silverman37281fc2018-03-11 18:42:17 -0700113 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114 "status_light.fbs",
115 ],
116 gen_reflections = 1,
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
Austin Schuhf9724442018-10-28 20:30:21 -0700140cc_proto_library(
Austin Schuh8d5fff42018-05-30 20:44:12 -0700141 name = "vision_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
147py_library(
148 name = "python_init",
149 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800150 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700151 visibility = ["//visibility:public"],
152)