| load("//aos:config.bzl", "aos_config") |
| |
| genrule( |
| name = "genrule_drivetrain", |
| outs = [ |
| "drivetrain_dog_motor_plant.h", |
| "drivetrain_dog_motor_plant.cc", |
| "kalman_drivetrain_motor_plant.h", |
| "kalman_drivetrain_motor_plant.cc", |
| ], |
| cmd = "$(location //y2022/control_loops/python:drivetrain) $(OUTS)", |
| target_compatible_with = ["@platforms//os:linux"], |
| tools = [ |
| "//y2022/control_loops/python:drivetrain", |
| ], |
| ) |
| |
| genrule( |
| name = "genrule_polydrivetrain", |
| outs = [ |
| "polydrivetrain_dog_motor_plant.h", |
| "polydrivetrain_dog_motor_plant.cc", |
| "polydrivetrain_cim_plant.h", |
| "polydrivetrain_cim_plant.cc", |
| "hybrid_velocity_drivetrain.h", |
| "hybrid_velocity_drivetrain.cc", |
| ], |
| cmd = "$(location //y2022/control_loops/python:polydrivetrain) $(OUTS)", |
| target_compatible_with = ["@platforms//os:linux"], |
| tools = [ |
| "//y2022/control_loops/python:polydrivetrain", |
| ], |
| ) |
| |
| cc_library( |
| name = "polydrivetrain_plants", |
| srcs = [ |
| "drivetrain_dog_motor_plant.cc", |
| "hybrid_velocity_drivetrain.cc", |
| "kalman_drivetrain_motor_plant.cc", |
| "polydrivetrain_dog_motor_plant.cc", |
| ], |
| hdrs = [ |
| "drivetrain_dog_motor_plant.h", |
| "hybrid_velocity_drivetrain.h", |
| "kalman_drivetrain_motor_plant.h", |
| "polydrivetrain_dog_motor_plant.h", |
| ], |
| target_compatible_with = ["@platforms//os:linux"], |
| visibility = ["//visibility:public"], |
| deps = [ |
| "//frc971/control_loops:hybrid_state_feedback_loop", |
| "//frc971/control_loops:state_feedback_loop", |
| ], |
| ) |
| |
| cc_library( |
| name = "drivetrain_base", |
| srcs = [ |
| "drivetrain_base.cc", |
| ], |
| hdrs = [ |
| "drivetrain_base.h", |
| ], |
| target_compatible_with = ["@platforms//os:linux"], |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":polydrivetrain_plants", |
| "//frc971:shifter_hall_effect", |
| "//frc971/control_loops/drivetrain:drivetrain_config", |
| ], |
| ) |
| |
| cc_library( |
| name = "localizer", |
| srcs = ["localizer.cc"], |
| hdrs = ["localizer.h"], |
| deps = [ |
| "//aos/events:event_loop", |
| "//aos/network:message_bridge_server_fbs", |
| "//frc971/control_loops/drivetrain:hybrid_ekf", |
| "//frc971/control_loops/drivetrain:localizer", |
| "//y2022/localizer:localizer_output_fbs", |
| ], |
| ) |
| |
| cc_binary( |
| name = "drivetrain", |
| srcs = [ |
| "drivetrain_main.cc", |
| ], |
| target_compatible_with = ["@platforms//os:linux"], |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":drivetrain_base", |
| ":localizer", |
| "//aos:init", |
| "//aos/events:shm_event_loop", |
| "//frc971/control_loops/drivetrain:drivetrain_lib", |
| ], |
| ) |
| |
| aos_config( |
| name = "simulation_config", |
| src = "drivetrain_simulation_config.json", |
| target_compatible_with = ["@platforms//os:linux"], |
| visibility = ["//visibility:public"], |
| deps = [ |
| "//frc971/control_loops/drivetrain:simulation_channels", |
| "//y2022:aos_config", |
| ], |
| ) |
| |
| cc_test( |
| name = "localizer_test", |
| srcs = ["localizer_test.cc"], |
| data = [":simulation_config"], |
| target_compatible_with = ["@platforms//os:linux"], |
| deps = [ |
| ":drivetrain_base", |
| ":localizer", |
| "//aos/events:simulated_event_loop", |
| "//aos/events/logging:log_writer", |
| "//aos/network:team_number", |
| "//aos/network:testing_time_converter", |
| "//frc971/control_loops:control_loop_test", |
| "//frc971/control_loops:team_number_test_environment", |
| "//frc971/control_loops/drivetrain:drivetrain_lib", |
| "//frc971/control_loops/drivetrain:drivetrain_test_lib", |
| "//y2022/localizer:localizer_output_fbs", |
| ], |
| ) |
| |
| cc_binary( |
| name = "trajectory_generator", |
| srcs = [ |
| "trajectory_generator_main.cc", |
| ], |
| target_compatible_with = ["@platforms//os:linux"], |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":drivetrain_base", |
| "//aos:init", |
| "//aos/events:shm_event_loop", |
| "//frc971/control_loops/drivetrain:trajectory_generator", |
| ], |
| ) |