Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 2 | |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 3 | genrule( |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 4 | name = "genrule_drivetrain", |
| 5 | outs = [ |
| 6 | "drivetrain_dog_motor_plant.h", |
| 7 | "drivetrain_dog_motor_plant.cc", |
James Kuszmaul | eeb98e9 | 2024-01-14 22:15:32 -0800 | [diff] [blame] | 8 | "drivetrain_dog_motor_plant.json", |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 9 | "kalman_drivetrain_motor_plant.h", |
| 10 | "kalman_drivetrain_motor_plant.cc", |
James Kuszmaul | eeb98e9 | 2024-01-14 22:15:32 -0800 | [diff] [blame] | 11 | "kalman_drivetrain_motor_plant.json", |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 12 | ], |
| 13 | cmd = "$(location //y2014/control_loops/python:drivetrain) $(OUTS)", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 14 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 15 | tools = [ |
| 16 | "//y2014/control_loops/python:drivetrain", |
| 17 | ], |
| 18 | visibility = ["//visibility:private"], |
Austin Schuh | 572ff40 | 2015-11-08 12:17:50 -0800 | [diff] [blame] | 19 | ) |
| 20 | |
Austin Schuh | 0e99773 | 2015-11-08 15:14:53 -0800 | [diff] [blame] | 21 | genrule( |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 22 | name = "genrule_polydrivetrain", |
| 23 | outs = [ |
| 24 | "polydrivetrain_dog_motor_plant.h", |
| 25 | "polydrivetrain_dog_motor_plant.cc", |
James Kuszmaul | eeb98e9 | 2024-01-14 22:15:32 -0800 | [diff] [blame] | 26 | "polydrivetrain_dog_motor_plant.json", |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 27 | "polydrivetrain_cim_plant.h", |
| 28 | "polydrivetrain_cim_plant.cc", |
James Kuszmaul | eeb98e9 | 2024-01-14 22:15:32 -0800 | [diff] [blame] | 29 | "polydrivetrain_cim_plant.json", |
Austin Schuh | 7442515 | 2018-12-21 11:37:14 +1100 | [diff] [blame] | 30 | "hybrid_velocity_drivetrain.h", |
| 31 | "hybrid_velocity_drivetrain.cc", |
James Kuszmaul | eeb98e9 | 2024-01-14 22:15:32 -0800 | [diff] [blame] | 32 | "hybrid_velocity_drivetrain.json", |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 33 | ], |
| 34 | cmd = "$(location //y2014/control_loops/python:polydrivetrain) $(OUTS)", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 35 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 36 | tools = [ |
| 37 | "//y2014/control_loops/python:polydrivetrain", |
| 38 | ], |
| 39 | visibility = ["//visibility:private"], |
Austin Schuh | 0e99773 | 2015-11-08 15:14:53 -0800 | [diff] [blame] | 40 | ) |
| 41 | |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 42 | cc_library( |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 43 | name = "polydrivetrain_plants", |
| 44 | srcs = [ |
| 45 | "drivetrain_dog_motor_plant.cc", |
Austin Schuh | 7442515 | 2018-12-21 11:37:14 +1100 | [diff] [blame] | 46 | "hybrid_velocity_drivetrain.cc", |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 47 | "kalman_drivetrain_motor_plant.cc", |
| 48 | "polydrivetrain_dog_motor_plant.cc", |
| 49 | ], |
| 50 | hdrs = [ |
| 51 | "drivetrain_dog_motor_plant.h", |
Austin Schuh | 7442515 | 2018-12-21 11:37:14 +1100 | [diff] [blame] | 52 | "hybrid_velocity_drivetrain.h", |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 53 | "kalman_drivetrain_motor_plant.h", |
| 54 | "polydrivetrain_dog_motor_plant.h", |
| 55 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 56 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 57 | deps = [ |
Austin Schuh | 7442515 | 2018-12-21 11:37:14 +1100 | [diff] [blame] | 58 | "//frc971/control_loops:hybrid_state_feedback_loop", |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 59 | "//frc971/control_loops:state_feedback_loop", |
| 60 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 61 | ) |
| 62 | |
| 63 | cc_library( |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 64 | name = "drivetrain_base", |
| 65 | srcs = [ |
| 66 | "drivetrain_base.cc", |
| 67 | ], |
| 68 | hdrs = [ |
| 69 | "drivetrain_base.h", |
| 70 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 71 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 72 | deps = [ |
| 73 | ":polydrivetrain_plants", |
| 74 | "//frc971/control_loops/drivetrain:drivetrain_config", |
| 75 | "//y2014:constants", |
| 76 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 77 | ) |
| 78 | |
| 79 | cc_binary( |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 80 | name = "drivetrain", |
| 81 | srcs = [ |
| 82 | "drivetrain_main.cc", |
| 83 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 84 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 85 | deps = [ |
| 86 | ":drivetrain_base", |
| 87 | "//aos:init", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 88 | "//aos/events:shm_event_loop", |
Austin Schuh | 2314c81 | 2018-12-21 13:42:33 +1100 | [diff] [blame] | 89 | "//frc971/control_loops/drivetrain:drivetrain_lib", |
| 90 | ], |
Brian Silverman | 8c374e0 | 2015-09-06 23:02:21 -0400 | [diff] [blame] | 91 | ) |