blob: 34fa70bec074ffaceb3784a70de5464c909ab5a8 [file] [log] [blame]
James Kuszmaul7077d342021-06-09 20:23:58 -07001load("//aos:config.bzl", "aos_config")
Austin Schuh8f99c822024-05-05 22:43:40 -07002load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
James Kuszmaul7077d342021-06-09 20:23:58 -07003
Philipp Schradercc016b32021-12-30 08:59:58 -08004package(default_visibility = ["//visibility:public"])
5
Brian Silverman100534c2015-09-07 15:51:23 -04006cc_library(
Austin Schuh3e45c752019-02-02 12:19:11 -08007 name = "joystick_input",
8 srcs = [
9 "joystick_input.cc",
10 ],
11 hdrs = [
12 "joystick_input.h",
13 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080014 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e45c752019-02-02 12:19:11 -080015 deps = [
James Kuszmaul7077d342021-06-09 20:23:58 -070016 ":robot_state_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -070017 "//aos/events:event_loop",
Austin Schuh3e45c752019-02-02 12:19:11 -080018 "//aos/logging",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070019 "//frc971/input:driver_station_data",
Austin Schuh3e45c752019-02-02 12:19:11 -080020 ],
Brian Silverman100534c2015-09-07 15:51:23 -040021)
Sabina Davis92d2efa2017-11-04 22:35:25 -070022
23cc_library(
Austin Schuh3e45c752019-02-02 12:19:11 -080024 name = "drivetrain_input",
25 srcs = [
26 "drivetrain_input.cc",
27 ],
28 hdrs = [
29 "drivetrain_input.h",
30 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080031 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e45c752019-02-02 12:19:11 -080032 deps = [
James Kuszmaul7077d342021-06-09 20:23:58 -070033 ":robot_state_fbs",
Austin Schuh3e45c752019-02-02 12:19:11 -080034 "//aos:math",
Austin Schuh3e45c752019-02-02 12:19:11 -080035 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -070036 "//frc971/control_loops:control_loops_fbs",
Austin Schuh3e45c752019-02-02 12:19:11 -080037 "//frc971/control_loops/drivetrain:drivetrain_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -070038 "//frc971/control_loops/drivetrain:drivetrain_goal_fbs",
39 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaul75a18c52021-03-10 22:02:07 -080040 "//frc971/control_loops/drivetrain:spline_goal_fbs",
Nikolai Sohmers0991b1f2024-10-20 14:24:34 -070041 "//frc971/control_loops/swerve:swerve_drivetrain_goal_fbs",
42 "//frc971/control_loops/swerve:swerve_drivetrain_joystick_goal_fbs",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070043 "//frc971/input:driver_station_data",
Austin Schuh3e45c752019-02-02 12:19:11 -080044 ],
Sabina Davis92d2efa2017-11-04 22:35:25 -070045)
John Park33858a32018-09-28 23:05:48 -070046
47cc_library(
Austin Schuh3e45c752019-02-02 12:19:11 -080048 name = "driver_station_data",
49 srcs = [
50 "driver_station_data.cc",
51 ],
52 hdrs = [
53 "driver_station_data.h",
54 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080055 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e45c752019-02-02 12:19:11 -080056 deps = [
James Kuszmaul7077d342021-06-09 20:23:58 -070057 ":joystick_state_fbs",
Austin Schuh99f7c6a2024-06-25 22:07:44 -070058 "@com_google_absl//absl/log",
59 "@com_google_absl//absl/log:check",
Austin Schuh3e45c752019-02-02 12:19:11 -080060 ],
John Park33858a32018-09-28 23:05:48 -070061)
Sabina Davis91b23602019-01-21 00:06:01 -080062
63cc_library(
Ravago Jones8c65c432023-03-25 17:35:39 -070064 name = "redundant_joystick_data",
65 srcs = [
66 "redundant_joystick_data.cc",
67 ],
68 hdrs = [
69 "redundant_joystick_data.h",
70 ],
71 target_compatible_with = ["@platforms//os:linux"],
72 deps = [
73 ":driver_station_data",
74 "//aos/events:event_loop",
75 ],
76)
77
78cc_library(
Sabina Davis91b23602019-01-21 00:06:01 -080079 name = "action_joystick_input",
80 srcs = ["action_joystick_input.cc"],
81 hdrs = ["action_joystick_input.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080082 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis91b23602019-01-21 00:06:01 -080083 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070084 ":drivetrain_input",
Ravago Jones8c65c432023-03-25 17:35:39 -070085 ":redundant_joystick_data",
Sabina Davis91b23602019-01-21 00:06:01 -080086 "//aos:init",
87 "//aos/actions:action_lib",
Sabina Davis91b23602019-01-21 00:06:01 -080088 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -070089 "//frc971/autonomous:auto_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -080090 "//frc971/autonomous:auto_mode_fbs",
Sabina Davis91b23602019-01-21 00:06:01 -080091 "//frc971/autonomous:base_autonomous_actor",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070092 "//frc971/input:joystick_input",
Sabina Davis91b23602019-01-21 00:06:01 -080093 ],
94)
James Kuszmaul7077d342021-06-09 20:23:58 -070095
Nikolai Sohmers0991b1f2024-10-20 14:24:34 -070096cc_library(
97 name = "swerve_joystick_input",
98 srcs = ["swerve_joystick_input.cc"],
99 hdrs = ["swerve_joystick_input.h"],
100 target_compatible_with = ["@platforms//os:linux"],
101 deps = [
102 ":drivetrain_input",
103 ":redundant_joystick_data",
104 "//aos:init",
105 "//aos/actions:action_lib",
106 "//aos/logging",
107 "//frc971/input:joystick_input",
108 ],
109)
110
James Kuszmaulf01da392023-12-14 11:22:14 -0800111static_flatbuffer(
James Kuszmaul7077d342021-06-09 20:23:58 -0700112 name = "robot_state_fbs",
113 srcs = ["robot_state.fbs"],
James Kuszmaul7077d342021-06-09 20:23:58 -0700114 target_compatible_with = ["@platforms//os:linux"],
115)
116
James Kuszmaulf01da392023-12-14 11:22:14 -0800117static_flatbuffer(
James Kuszmaul7077d342021-06-09 20:23:58 -0700118 name = "joystick_state_fbs",
119 srcs = ["joystick_state.fbs"],
James Kuszmaul7077d342021-06-09 20:23:58 -0700120 target_compatible_with = ["@platforms//os:linux"],
121)
122
123aos_config(
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800124 name = "aos_config",
James Kuszmaul7077d342021-06-09 20:23:58 -0700125 src = "robot_state_config.json",
126 flatbuffers = [
127 ":joystick_state_fbs",
128 ":robot_state_fbs",
129 ],
130 target_compatible_with = ["@platforms//os:linux"],
131 visibility = ["//visibility:public"],
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800132 deps = ["//aos/events:aos_config"],
James Kuszmaul7077d342021-06-09 20:23:58 -0700133)