blob: ade83c59853344aed8498b89bf85008080b85744 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001load("//aos:config.bzl", "aos_config")
Austin Schuh8f99c822024-05-05 22:43:40 -07002load("//frc971:downloader.bzl", "robot_downloader")
Austin Schuh7b9a3ba2017-02-19 23:11:45 -08003
Tyler Chatow6107aba2017-01-22 01:39:40 +00004cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -07005 name = "constants",
6 srcs = [
7 "constants.cc",
8 ],
9 hdrs = [
10 "constants.h",
11 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080012 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070013 visibility = ["//visibility:public"],
14 deps = [
John Park33858a32018-09-28 23:05:48 -070015 "//aos/network:team_number",
Brian Silverman1463c092020-10-30 17:28:24 -070016 "//aos/stl_mutex",
Brian Silverman6470f442018-08-05 12:08:16 -070017 "//frc971:constants",
18 "//frc971/shooter_interpolation:interpolation",
19 "//y2017/control_loops/drivetrain:polydrivetrain_plants",
20 "//y2017/control_loops/superstructure/column:column_plants",
21 "//y2017/control_loops/superstructure/hood:hood_plants",
22 "//y2017/control_loops/superstructure/intake:intake_plants",
23 "//y2017/control_loops/superstructure/shooter:shooter_plants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080024 "@com_google_absl//absl/base",
Austin Schuh99f7c6a2024-06-25 22:07:44 -070025 "@com_google_absl//absl/log",
26 "@com_google_absl//absl/log:check",
Brian Silverman6470f442018-08-05 12:08:16 -070027 ],
Tyler Chatow6107aba2017-01-22 01:39:40 +000028)
Brian Silverman06016bc2017-02-11 16:34:34 -080029
30cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -070031 name = "joystick_reader",
32 srcs = [
33 "joystick_reader.cc",
34 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080035 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070036 deps = [
37 ":constants",
Brian Silvermanf819b442019-01-20 16:51:04 -080038 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070039 "//aos/actions:action_lib",
Brian Silvermanf819b442019-01-20 16:51:04 -080040 "//aos/logging",
41 "//aos/time",
42 "//aos/util:log_interval",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070043 "//frc971/input:action_joystick_input",
44 "//frc971/input:drivetrain_input",
Brian Silverman6470f442018-08-05 12:08:16 -070045 "//y2017/actors:autonomous_action_lib",
46 "//y2017/control_loops/drivetrain:drivetrain_base",
Alex Perrycb7da4b2019-08-28 19:35:56 -070047 "//y2017/control_loops/superstructure:superstructure_goal_fbs",
48 "//y2017/control_loops/superstructure:superstructure_status_fbs",
49 ],
50)
51
52aos_config(
Austin Schuhc5fa6d92022-02-25 14:36:28 -080053 name = "aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -070054 src = "y2017.json",
55 flatbuffers = [
56 "//y2017/control_loops/superstructure:superstructure_goal_fbs",
57 "//y2017/control_loops/superstructure:superstructure_output_fbs",
58 "//y2017/control_loops/superstructure:superstructure_position_fbs",
59 "//y2017/control_loops/superstructure:superstructure_status_fbs",
60 "//y2017/vision:vision_fbs",
61 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080062 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070063 visibility = ["//visibility:public"],
64 deps = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -080065 "//frc971/control_loops/drivetrain:aos_config",
66 "//frc971/input:aos_config",
Brian Silverman6470f442018-08-05 12:08:16 -070067 ],
Campbell Crowley71b5f132017-02-18 13:16:08 -080068)
69
70cc_binary(
Brian Silverman6470f442018-08-05 12:08:16 -070071 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"],
Brian Silverman6470f442018-08-05 12:08:16 -070076 deps = [
77 ":constants",
Brian Silvermanf819b442019-01-20 16:51:04 -080078 "//aos:init",
John Park33858a32018-09-28 23:05:48 -070079 "//aos:math",
John Park33858a32018-09-28 23:05:48 -070080 "//aos/logging",
Brian Silvermanf819b442019-01-20 16:51:04 -080081 "//aos/stl_mutex",
82 "//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 Schuhed5b26d2019-12-05 20:51:59 -080087 "//frc971/autonomous:auto_mode_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070088 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070089 "//frc971/control_loops:control_loops_fbs",
90 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
91 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070092 "//frc971/input:robot_state_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -070093 "//frc971/wpilib:ADIS16448",
94 "//frc971/wpilib:buffered_pcm",
95 "//frc971/wpilib:dma",
96 "//frc971/wpilib:dma_edge_counting",
Sabina Davis7af11ad2019-02-03 01:16:45 -080097 "//frc971/wpilib:drivetrain_writer",
Brian Silverman6470f442018-08-05 12:08:16 -070098 "//frc971/wpilib:encoder_and_potentiometer",
99 "//frc971/wpilib:interrupt_edge_counting",
100 "//frc971/wpilib:joystick_sender",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700101 "//frc971/wpilib:logging_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700102 "//frc971/wpilib:loop_output_handler",
103 "//frc971/wpilib:pdp_fetcher",
Austin Schuhbf29b6f2019-02-02 21:45:27 -0800104 "//frc971/wpilib:sensor_reader",
Brian Silverman6470f442018-08-05 12:08:16 -0700105 "//frc971/wpilib:wpilib_robot_base",
106 "//third_party:wpilib",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700107 "//y2017/control_loops/superstructure:superstructure_output_fbs",
108 "//y2017/control_loops/superstructure:superstructure_position_fbs",
Brian Silverman6470f442018-08-05 12:08:16 -0700109 ],
Brian Silverman06016bc2017-02-11 16:34:34 -0800110)
Austin Schuh7b9a3ba2017-02-19 23:11:45 -0800111
Lee Mracek6821fe02018-11-01 17:27:30 -0400112robot_downloader(
Brian Silvermanf819b442019-01-20 16:51:04 -0800113 start_binaries = [
114 ":joystick_reader",
115 ":wpilib_interface",
116 "//y2017/control_loops/drivetrain:drivetrain",
117 "//y2017/control_loops/superstructure:superstructure",
118 "//y2017/actors:autonomous_action",
119 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800120 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700121)
122
123py_library(
124 name = "python_init",
125 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800126 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700127 visibility = ["//visibility:public"],
Austin Schuh7b9a3ba2017-02-19 23:11:45 -0800128)