blob: 768a54e5b6cfe187010e68dda5fc764cb1991450 [file] [log] [blame]
Maxwell Hendersonb392b742023-03-05 07:53:51 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2
milind-u37385182023-02-20 15:07:28 -08003cc_library(
4 name = "arm",
5 srcs = [
6 "arm.cc",
7 ],
8 hdrs = [
9 "arm.h",
10 ],
11 target_compatible_with = ["@platforms//os:linux"],
12 visibility = ["//visibility:public"],
13 deps = [
14 ":generated_graph",
milind-u37385182023-02-20 15:07:28 -080015 "//frc971/control_loops/double_jointed_arm:ekf",
16 "//frc971/control_loops/double_jointed_arm:graph",
Maxwell Hendersoncef6f042023-05-26 14:38:09 -070017 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
milind-u37385182023-02-20 15:07:28 -080018 "//frc971/zeroing",
James Kuszmaulec635d22023-08-12 18:39:24 -070019 "//frc971/zeroing:pot_and_absolute_encoder",
milind-u37385182023-02-20 15:07:28 -080020 "//y2023:constants",
21 "//y2023/control_loops/superstructure:superstructure_position_fbs",
22 "//y2023/control_loops/superstructure:superstructure_status_fbs",
23 "//y2023/control_loops/superstructure/arm:arm_constants",
milind-u18a901d2023-02-17 21:51:55 -080024 "//y2023/control_loops/superstructure/arm:trajectory",
25 "//y2023/control_loops/superstructure/roll:roll_plants",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080026 "//y2023/vision:game_pieces_fbs",
milind-u37385182023-02-20 15:07:28 -080027 ],
28)
29
30genrule(
Maxwell Hendersonb392b742023-03-05 07:53:51 -080031 name = "generated_arm_trajectory_genrule",
32 outs = [
33 "arm_trajectories_generated.bfbs",
34 ],
35 cmd = "$(location //y2023/control_loops/superstructure/arm:arm_trajectory_generator) --output $(OUTS)",
36 target_compatible_with = ["@platforms//os:linux"],
37 tools = [
38 "//y2023/control_loops/superstructure/arm:arm_trajectory_generator",
39 ],
40 visibility = ["//visibility:public"],
41)
42
43cc_binary(
44 name = "arm_trajectory_generator",
45 srcs = [
46 "arm_trajectory_gen.cc",
47 ],
48 target_compatible_with = ["@platforms//os:linux"],
49 visibility = ["//visibility:public"],
50 deps = [
51 ":arm_constants",
52 ":arm_trajectories_fbs",
53 "//aos:flatbuffers",
54 "//aos:json_to_flatbuffer",
55 "//frc971/control_loops/double_jointed_arm:graph",
56 "//y2023:constants",
57 "//y2023/control_loops/superstructure/arm:generated_graph",
58 "//y2023/control_loops/superstructure/arm:trajectory",
59 "//y2023/control_loops/superstructure/roll:roll_plants",
60 ],
61)
62
63genrule(
milind-u37385182023-02-20 15:07:28 -080064 name = "generated_graph_genrule",
65 outs = [
66 "generated_graph.h",
67 "generated_graph.cc",
68 ],
69 cmd = "$(location //y2023/control_loops/python:graph_codegen) $(OUTS)",
70 target_compatible_with = ["@platforms//os:linux"],
71 tools = [
72 "//y2023/control_loops/python:graph_codegen",
73 ],
74)
75
Maxwell Hendersonb392b742023-03-05 07:53:51 -080076flatbuffer_cc_library(
77 name = "arm_trajectories_fbs",
78 srcs = [
79 "arm_trajectories.fbs",
80 ],
81 gen_reflections = 1,
82 visibility = ["//visibility:public"],
83)
84
milind-u37385182023-02-20 15:07:28 -080085cc_library(
86 name = "generated_graph",
87 srcs = [
88 "generated_graph.cc",
89 ],
90 hdrs = ["generated_graph.h"],
91 copts = [
92 "-O1",
93 ],
94 target_compatible_with = ["@platforms//os:linux"],
95 visibility = ["//visibility:public"],
96 deps = [
97 ":arm_constants",
98 "//frc971/control_loops/double_jointed_arm:graph",
milind-u18a901d2023-02-17 21:51:55 -080099 "//y2023/control_loops/superstructure/arm:trajectory",
100 "//y2023/control_loops/superstructure/roll:roll_plants",
milind-u37385182023-02-20 15:07:28 -0800101 ],
102)
103
104cc_library(
105 name = "arm_constants",
106 hdrs = ["arm_constants.h"],
107 target_compatible_with = ["@platforms//os:linux"],
108 visibility = ["//visibility:public"],
109 deps = [
110 "//frc971/control_loops/double_jointed_arm:dynamics",
111 ],
112)
milind-u0a7d28d2023-02-20 17:44:37 -0800113
114cc_binary(
115 name = "arm_design",
116 srcs = [
117 "arm_design.cc",
118 ],
119 target_compatible_with = ["@platforms//os:linux"],
120 deps = [
121 ":arm_constants",
122 "//aos:init",
123 "//frc971/analysis:in_process_plotter",
124 "//frc971/control_loops:dlqr",
125 "//frc971/control_loops:jacobian",
126 "//frc971/control_loops/double_jointed_arm:dynamics",
127 ],
128)
Austin Schuhb83e1c72023-02-20 21:41:51 -0800129
130cc_library(
131 name = "trajectory",
132 srcs = ["trajectory.cc"],
133 hdrs = ["trajectory.h"],
134 target_compatible_with = ["@platforms//os:linux"],
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800135 visibility = ["//visibility:public"],
Austin Schuhb83e1c72023-02-20 21:41:51 -0800136 deps = [
137 "//frc971/control_loops:binomial",
138 "//frc971/control_loops:dlqr",
139 "//frc971/control_loops:fixed_quadrature",
140 "//frc971/control_loops:hybrid_state_feedback_loop",
141 "//frc971/control_loops/double_jointed_arm:dynamics",
142 "//frc971/control_loops/double_jointed_arm:ekf",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800143 "//y2023/control_loops/superstructure/arm:arm_trajectories_fbs",
Austin Schuhb83e1c72023-02-20 21:41:51 -0800144 "@org_tuxfamily_eigen//:eigen",
145 ],
146)
147
148cc_test(
149 name = "trajectory_test",
150 srcs = ["trajectory_test.cc"],
151 target_compatible_with = ["@platforms//os:linux"],
152 deps = [
153 ":arm_constants",
154 ":trajectory",
155 "//aos/testing:googletest",
156 "//y2023/control_loops/superstructure/roll:roll_plants",
157 ],
158)
159
160cc_binary(
161 name = "trajectory_plot",
162 srcs = [
163 "trajectory_plot.cc",
164 ],
165 target_compatible_with = ["@platforms//cpu:x86_64"],
166 deps = [
167 ":arm_constants",
Austin Schuha32a1892023-02-21 14:04:07 -0800168 ":generated_graph",
Austin Schuhb83e1c72023-02-20 21:41:51 -0800169 ":trajectory",
170 "//frc971/analysis:in_process_plotter",
171 "//frc971/control_loops:binomial",
172 "//frc971/control_loops:fixed_quadrature",
173 "//frc971/control_loops/double_jointed_arm:ekf",
174 "//y2023/control_loops/superstructure/roll:roll_plants",
175 "@com_github_gflags_gflags//:gflags",
176 "@org_tuxfamily_eigen//:eigen",
177 ],
178)