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