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