blob: 9ae4916fb285142a6d0287f22cd2221797c3af5d [file] [log] [blame]
Sabina Davisf4c5e762018-01-24 10:18:43 -08001genrule(
Austin Schuh2314c812018-12-21 13:42:33 +11002 name = "genrule_drivetrain",
3 outs = [
4 "drivetrain_dog_motor_plant.h",
5 "drivetrain_dog_motor_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -08006 "drivetrain_dog_motor_plant.json",
Austin Schuh2314c812018-12-21 13:42:33 +11007 "kalman_drivetrain_motor_plant.h",
8 "kalman_drivetrain_motor_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -08009 "kalman_drivetrain_motor_plant.json",
Austin Schuh2314c812018-12-21 13:42:33 +110010 ],
11 cmd = "$(location //y2018/control_loops/python:drivetrain) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080012 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2314c812018-12-21 13:42:33 +110013 tools = [
14 "//y2018/control_loops/python:drivetrain",
15 ],
Sabina Davisf4c5e762018-01-24 10:18:43 -080016)
17
18genrule(
Austin Schuh2314c812018-12-21 13:42:33 +110019 name = "genrule_polydrivetrain",
20 outs = [
21 "polydrivetrain_dog_motor_plant.h",
22 "polydrivetrain_dog_motor_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -080023 "polydrivetrain_dog_motor_plant.json",
Austin Schuh2314c812018-12-21 13:42:33 +110024 "polydrivetrain_cim_plant.h",
25 "polydrivetrain_cim_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -080026 "polydrivetrain_cim_plant.json",
Austin Schuh74425152018-12-21 11:37:14 +110027 "hybrid_velocity_drivetrain.h",
28 "hybrid_velocity_drivetrain.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -080029 "hybrid_velocity_drivetrain.json",
Austin Schuh2314c812018-12-21 13:42:33 +110030 ],
31 cmd = "$(location //y2018/control_loops/python:polydrivetrain) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -080032 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2314c812018-12-21 13:42:33 +110033 tools = [
34 "//y2018/control_loops/python:polydrivetrain",
35 ],
Sabina Davisf4c5e762018-01-24 10:18:43 -080036)
37
38cc_library(
Austin Schuh2314c812018-12-21 13:42:33 +110039 name = "polydrivetrain_plants",
40 srcs = [
41 "drivetrain_dog_motor_plant.cc",
Austin Schuh74425152018-12-21 11:37:14 +110042 "hybrid_velocity_drivetrain.cc",
Austin Schuh2314c812018-12-21 13:42:33 +110043 "kalman_drivetrain_motor_plant.cc",
44 "polydrivetrain_dog_motor_plant.cc",
45 ],
46 hdrs = [
47 "drivetrain_dog_motor_plant.h",
Austin Schuh74425152018-12-21 11:37:14 +110048 "hybrid_velocity_drivetrain.h",
Austin Schuh2314c812018-12-21 13:42:33 +110049 "kalman_drivetrain_motor_plant.h",
50 "polydrivetrain_dog_motor_plant.h",
51 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080052 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2314c812018-12-21 13:42:33 +110053 visibility = ["//visibility:public"],
54 deps = [
Austin Schuh74425152018-12-21 11:37:14 +110055 "//frc971/control_loops:hybrid_state_feedback_loop",
Austin Schuh2314c812018-12-21 13:42:33 +110056 "//frc971/control_loops:state_feedback_loop",
57 ],
Sabina Davisf4c5e762018-01-24 10:18:43 -080058)
59
60cc_library(
Austin Schuh2314c812018-12-21 13:42:33 +110061 name = "drivetrain_base",
62 srcs = [
63 "drivetrain_base.cc",
64 ],
65 hdrs = [
66 "drivetrain_base.h",
67 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080068 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2314c812018-12-21 13:42:33 +110069 visibility = ["//visibility:public"],
70 deps = [
71 ":polydrivetrain_plants",
72 "//frc971:shifter_hall_effect",
73 "//frc971/control_loops/drivetrain:drivetrain_config",
74 ],
Sabina Davisf4c5e762018-01-24 10:18:43 -080075)
76
77cc_binary(
Austin Schuh2314c812018-12-21 13:42:33 +110078 name = "drivetrain",
79 srcs = [
80 "drivetrain_main.cc",
81 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080082 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh2314c812018-12-21 13:42:33 +110083 visibility = ["//visibility:public"],
84 deps = [
85 ":drivetrain_base",
86 "//aos:init",
87 "//frc971/control_loops/drivetrain:drivetrain_lib",
88 ],
Sabina Davisf4c5e762018-01-24 10:18:43 -080089)