Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame^] | 1 | load("//aos:config.bzl", "aos_config") |
| 2 | |
| 3 | genrule( |
| 4 | 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 //y2024/control_loops/python:drivetrain) $(OUTS)", |
| 12 | target_compatible_with = ["@platforms//os:linux"], |
| 13 | tools = [ |
| 14 | "//y2024/control_loops/python:drivetrain", |
| 15 | ], |
| 16 | ) |
| 17 | |
| 18 | genrule( |
| 19 | 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", |
| 25 | "hybrid_velocity_drivetrain.h", |
| 26 | "hybrid_velocity_drivetrain.cc", |
| 27 | ], |
| 28 | cmd = "$(location //y2024/control_loops/python:polydrivetrain) $(OUTS)", |
| 29 | target_compatible_with = ["@platforms//os:linux"], |
| 30 | tools = [ |
| 31 | "//y2024/control_loops/python:polydrivetrain", |
| 32 | ], |
| 33 | ) |
| 34 | |
| 35 | cc_library( |
| 36 | name = "polydrivetrain_plants", |
| 37 | srcs = [ |
| 38 | "drivetrain_dog_motor_plant.cc", |
| 39 | "hybrid_velocity_drivetrain.cc", |
| 40 | "kalman_drivetrain_motor_plant.cc", |
| 41 | "polydrivetrain_dog_motor_plant.cc", |
| 42 | ], |
| 43 | hdrs = [ |
| 44 | "drivetrain_dog_motor_plant.h", |
| 45 | "hybrid_velocity_drivetrain.h", |
| 46 | "kalman_drivetrain_motor_plant.h", |
| 47 | "polydrivetrain_dog_motor_plant.h", |
| 48 | ], |
| 49 | target_compatible_with = ["@platforms//os:linux"], |
| 50 | visibility = ["//visibility:public"], |
| 51 | deps = [ |
| 52 | "//frc971/control_loops:hybrid_state_feedback_loop", |
| 53 | "//frc971/control_loops:state_feedback_loop", |
| 54 | ], |
| 55 | ) |
| 56 | |
| 57 | cc_library( |
| 58 | name = "drivetrain_base", |
| 59 | srcs = [ |
| 60 | "drivetrain_base.cc", |
| 61 | ], |
| 62 | hdrs = [ |
| 63 | "drivetrain_base.h", |
| 64 | ], |
| 65 | target_compatible_with = ["@platforms//os:linux"], |
| 66 | visibility = ["//visibility:public"], |
| 67 | deps = [ |
| 68 | ":polydrivetrain_plants", |
| 69 | "//frc971:shifter_hall_effect", |
| 70 | "//frc971/control_loops/drivetrain:drivetrain_config", |
| 71 | ], |
| 72 | ) |
| 73 | |
| 74 | cc_binary( |
| 75 | name = "drivetrain", |
| 76 | srcs = [ |
| 77 | "drivetrain_main.cc", |
| 78 | ], |
| 79 | target_compatible_with = ["@platforms//os:linux"], |
| 80 | visibility = ["//visibility:public"], |
| 81 | deps = [ |
| 82 | ":drivetrain_base", |
| 83 | "//aos:init", |
| 84 | "//aos/events:shm_event_loop", |
| 85 | "//frc971/constants:constants_sender_lib", |
| 86 | "//frc971/control_loops/drivetrain:drivetrain_lib", |
| 87 | "//frc971/control_loops/drivetrain/localization:puppet_localizer", |
| 88 | "//y2024/constants:constants_fbs", |
| 89 | ], |
| 90 | ) |
| 91 | |
| 92 | aos_config( |
| 93 | name = "simulation_config", |
| 94 | src = "drivetrain_simulation_config.json", |
| 95 | target_compatible_with = ["@platforms//os:linux"], |
| 96 | visibility = ["//visibility:public"], |
| 97 | deps = [ |
| 98 | "//frc971/control_loops/drivetrain:simulation_channels", |
| 99 | "//y2024:aos_config", |
| 100 | ], |
| 101 | ) |
| 102 | |
| 103 | cc_binary( |
| 104 | name = "trajectory_generator", |
| 105 | srcs = [ |
| 106 | "trajectory_generator_main.cc", |
| 107 | ], |
| 108 | target_compatible_with = ["@platforms//os:linux"], |
| 109 | visibility = ["//visibility:public"], |
| 110 | deps = [ |
| 111 | ":drivetrain_base", |
| 112 | "//aos:init", |
| 113 | "//aos/events:shm_event_loop", |
| 114 | "//frc971/control_loops/drivetrain:trajectory_generator", |
| 115 | ], |
| 116 | ) |