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