Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 1 | load("//aos:config.bzl", "aos_config") |
Ravago Jones | 2060ee6 | 2023-02-03 18:12:24 -0800 | [diff] [blame] | 2 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 3 | |
| 4 | genrule( |
| 5 | name = "genrule_drivetrain", |
| 6 | outs = [ |
| 7 | "drivetrain_dog_motor_plant.h", |
| 8 | "drivetrain_dog_motor_plant.cc", |
| 9 | "kalman_drivetrain_motor_plant.h", |
| 10 | "kalman_drivetrain_motor_plant.cc", |
| 11 | ], |
| 12 | cmd = "$(location //y2023/control_loops/python:drivetrain) $(OUTS)", |
| 13 | target_compatible_with = ["@platforms//os:linux"], |
| 14 | tools = [ |
| 15 | "//y2023/control_loops/python:drivetrain", |
| 16 | ], |
| 17 | ) |
| 18 | |
| 19 | genrule( |
| 20 | name = "genrule_polydrivetrain", |
| 21 | outs = [ |
| 22 | "polydrivetrain_dog_motor_plant.h", |
| 23 | "polydrivetrain_dog_motor_plant.cc", |
| 24 | "polydrivetrain_cim_plant.h", |
| 25 | "polydrivetrain_cim_plant.cc", |
| 26 | "hybrid_velocity_drivetrain.h", |
| 27 | "hybrid_velocity_drivetrain.cc", |
| 28 | ], |
| 29 | cmd = "$(location //y2023/control_loops/python:polydrivetrain) $(OUTS)", |
| 30 | target_compatible_with = ["@platforms//os:linux"], |
| 31 | tools = [ |
| 32 | "//y2023/control_loops/python:polydrivetrain", |
| 33 | ], |
| 34 | ) |
| 35 | |
| 36 | cc_library( |
| 37 | name = "polydrivetrain_plants", |
| 38 | srcs = [ |
| 39 | "drivetrain_dog_motor_plant.cc", |
| 40 | "hybrid_velocity_drivetrain.cc", |
| 41 | "kalman_drivetrain_motor_plant.cc", |
| 42 | "polydrivetrain_dog_motor_plant.cc", |
| 43 | ], |
| 44 | hdrs = [ |
| 45 | "drivetrain_dog_motor_plant.h", |
| 46 | "hybrid_velocity_drivetrain.h", |
| 47 | "kalman_drivetrain_motor_plant.h", |
| 48 | "polydrivetrain_dog_motor_plant.h", |
| 49 | ], |
| 50 | target_compatible_with = ["@platforms//os:linux"], |
| 51 | visibility = ["//visibility:public"], |
| 52 | deps = [ |
| 53 | "//frc971/control_loops:hybrid_state_feedback_loop", |
| 54 | "//frc971/control_loops:state_feedback_loop", |
| 55 | ], |
| 56 | ) |
| 57 | |
| 58 | cc_library( |
| 59 | name = "drivetrain_base", |
| 60 | srcs = [ |
| 61 | "drivetrain_base.cc", |
| 62 | ], |
| 63 | hdrs = [ |
| 64 | "drivetrain_base.h", |
| 65 | ], |
| 66 | target_compatible_with = ["@platforms//os:linux"], |
| 67 | visibility = ["//visibility:public"], |
| 68 | deps = [ |
| 69 | ":polydrivetrain_plants", |
| 70 | "//frc971:shifter_hall_effect", |
| 71 | "//frc971/control_loops/drivetrain:drivetrain_config", |
| 72 | ], |
| 73 | ) |
| 74 | |
| 75 | cc_binary( |
| 76 | name = "drivetrain", |
| 77 | srcs = [ |
| 78 | "drivetrain_main.cc", |
| 79 | ], |
| 80 | target_compatible_with = ["@platforms//os:linux"], |
| 81 | visibility = ["//visibility:public"], |
| 82 | deps = [ |
| 83 | ":drivetrain_base", |
| 84 | "//aos:init", |
| 85 | "//aos/events:shm_event_loop", |
| 86 | "//frc971/control_loops/drivetrain:drivetrain_lib", |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame^] | 87 | "//frc971/control_loops/drivetrain/localization:puppet_localizer", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 88 | ], |
| 89 | ) |
| 90 | |
| 91 | aos_config( |
| 92 | name = "simulation_config", |
| 93 | src = "drivetrain_simulation_config.json", |
| 94 | target_compatible_with = ["@platforms//os:linux"], |
| 95 | visibility = ["//visibility:public"], |
| 96 | deps = [ |
| 97 | "//frc971/control_loops/drivetrain:simulation_channels", |
| 98 | "//y2023:aos_config", |
| 99 | ], |
| 100 | ) |
| 101 | |
| 102 | cc_binary( |
| 103 | name = "trajectory_generator", |
| 104 | srcs = [ |
| 105 | "trajectory_generator_main.cc", |
| 106 | ], |
| 107 | target_compatible_with = ["@platforms//os:linux"], |
| 108 | visibility = ["//visibility:public"], |
| 109 | deps = [ |
| 110 | ":drivetrain_base", |
| 111 | "//aos:init", |
| 112 | "//aos/events:shm_event_loop", |
| 113 | "//frc971/control_loops/drivetrain:trajectory_generator", |
| 114 | ], |
| 115 | ) |
Ravago Jones | 2060ee6 | 2023-02-03 18:12:24 -0800 | [diff] [blame] | 116 | |
| 117 | flatbuffer_cc_library( |
| 118 | name = "drivetrain_can_position_fbs", |
| 119 | srcs = [ |
| 120 | "drivetrain_can_position.fbs", |
| 121 | ], |
| 122 | gen_reflections = 1, |
| 123 | visibility = ["//visibility:public"], |
| 124 | ) |