blob: c458208e28c72ed24687eae7122fffe388a0f419 [file] [log] [blame]
Austin Schuh2314c812018-12-21 13:42:33 +11001package(default_visibility = ["//visibility:public"])
Brian Silverman8c374e02015-09-06 23:02:21 -04002
Austin Schuh572ff402015-11-08 12:17:50 -08003genrule(
Austin Schuh2314c812018-12-21 13:42:33 +11004 name = "genrule_drivetrain",
5 outs = [
6 "drivetrain_dog_motor_plant.h",
7 "drivetrain_dog_motor_plant.cc",
8 "kalman_drivetrain_motor_plant.h",
9 "kalman_drivetrain_motor_plant.cc",
10 ],
11 cmd = "$(location //y2014/control_loops/python:drivetrain) $(OUTS)",
12 tools = [
13 "//y2014/control_loops/python:drivetrain",
14 ],
15 visibility = ["//visibility:private"],
Austin Schuh572ff402015-11-08 12:17:50 -080016)
17
Austin Schuh0e997732015-11-08 15:14:53 -080018genrule(
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",
23 "polydrivetrain_cim_plant.h",
24 "polydrivetrain_cim_plant.cc",
Austin Schuh74425152018-12-21 11:37:14 +110025 "hybrid_velocity_drivetrain.h",
26 "hybrid_velocity_drivetrain.cc",
Austin Schuh2314c812018-12-21 13:42:33 +110027 ],
28 cmd = "$(location //y2014/control_loops/python:polydrivetrain) $(OUTS)",
29 tools = [
30 "//y2014/control_loops/python:polydrivetrain",
31 ],
32 visibility = ["//visibility:private"],
Austin Schuh0e997732015-11-08 15:14:53 -080033)
34
Brian Silverman8c374e02015-09-06 23:02:21 -040035cc_library(
Austin Schuh2314c812018-12-21 13:42:33 +110036 name = "polydrivetrain_plants",
37 srcs = [
38 "drivetrain_dog_motor_plant.cc",
Austin Schuh74425152018-12-21 11:37:14 +110039 "hybrid_velocity_drivetrain.cc",
Austin Schuh2314c812018-12-21 13:42:33 +110040 "kalman_drivetrain_motor_plant.cc",
41 "polydrivetrain_dog_motor_plant.cc",
42 ],
43 hdrs = [
44 "drivetrain_dog_motor_plant.h",
Austin Schuh74425152018-12-21 11:37:14 +110045 "hybrid_velocity_drivetrain.h",
Austin Schuh2314c812018-12-21 13:42:33 +110046 "kalman_drivetrain_motor_plant.h",
47 "polydrivetrain_dog_motor_plant.h",
48 ],
49 deps = [
Austin Schuh74425152018-12-21 11:37:14 +110050 "//frc971/control_loops:hybrid_state_feedback_loop",
Austin Schuh2314c812018-12-21 13:42:33 +110051 "//frc971/control_loops:state_feedback_loop",
52 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040053)
54
55cc_library(
Austin Schuh2314c812018-12-21 13:42:33 +110056 name = "drivetrain_base",
57 srcs = [
58 "drivetrain_base.cc",
59 ],
60 hdrs = [
61 "drivetrain_base.h",
62 ],
63 deps = [
64 ":polydrivetrain_plants",
65 "//frc971/control_loops/drivetrain:drivetrain_config",
66 "//y2014:constants",
67 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040068)
69
70cc_binary(
Austin Schuh2314c812018-12-21 13:42:33 +110071 name = "drivetrain",
72 srcs = [
73 "drivetrain_main.cc",
74 ],
75 deps = [
76 ":drivetrain_base",
77 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -070078 "//aos/events:shm_event_loop",
Austin Schuh2314c812018-12-21 13:42:33 +110079 "//frc971/control_loops/drivetrain:drivetrain_lib",
80 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040081)