blob: c3357aad0c6c872bc9dc99a272929beeca75672a [file] [log] [blame]
Comran Morshed5323ecb2015-12-26 20:50:55 +00001#include "y2014/control_loops/drivetrain/drivetrain_base.h"
2
3#include "frc971/control_loops/drivetrain/drivetrain_config.h"
4
5#include "y2014/control_loops/drivetrain/drivetrain_dog_motor_plant.h"
6#include "y2014/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h"
7#include "y2014/control_loops/drivetrain/kalman_drivetrain_motor_plant.h"
8#include "y2014/constants.h"
9
10using ::frc971::control_loops::drivetrain::DrivetrainConfig;
11
12namespace y2014 {
13namespace control_loops {
14
Austin Schuhbcce26a2018-03-26 23:41:24 -070015const DrivetrainConfig<double> &GetDrivetrainConfig() {
Brian Silverman3853f552016-05-15 14:11:58 -070016 // TODO(austin): Switch over to using the profile.
Austin Schuhbcce26a2018-03-26 23:41:24 -070017 static DrivetrainConfig<double> kDrivetrainConfig{
Comran Morshed5323ecb2015-12-26 20:50:55 +000018 ::frc971::control_loops::drivetrain::ShifterType::HALL_EFFECT_SHIFTER,
Comran Morshed76ca8f52016-02-21 17:26:28 +000019 ::frc971::control_loops::drivetrain::LoopType::CLOSED_LOOP,
Campbell Crowley2527ed22017-02-17 21:10:02 -080020 ::frc971::control_loops::drivetrain::GyroType::SPARTAN_GYRO,
Diana Burgessd0180f12018-03-21 21:24:17 -070021 ::frc971::control_loops::drivetrain::IMUType::IMU_X,
Comran Morshed5323ecb2015-12-26 20:50:55 +000022
23 ::y2014::control_loops::drivetrain::MakeDrivetrainLoop,
24 ::y2014::control_loops::drivetrain::MakeVelocityDrivetrainLoop,
25 ::y2014::control_loops::drivetrain::MakeKFDrivetrainLoop,
26
Comran Morshed3708f092016-02-20 16:23:51 +000027 drivetrain::kDt,
28 drivetrain::kRobotRadius,
29 drivetrain::kWheelRadius,
30 drivetrain::kV,
Comran Morshed5323ecb2015-12-26 20:50:55 +000031
Austin Schuh3130b372016-02-17 00:34:51 -080032 constants::GetValues().high_gear_ratio,
Comran Morshed5323ecb2015-12-26 20:50:55 +000033 constants::GetValues().low_gear_ratio,
Sabina Davis415bb6c2017-10-16 23:30:52 -070034 constants::GetValues().left_drive.shifter_hall_effect,
35 constants::GetValues().right_drive.shifter_hall_effect,
Austin Schuhe8a54c02018-03-05 00:25:58 -080036 true /* default_high_gear */,
Adam Snaider94a52372016-10-19 20:06:01 -070037 0,
Austin Schuhe8a54c02018-03-05 00:25:58 -080038 0.25 /* wheel_non_linearity */,
39 1.0 /* quickturn_wheel_multiplier */,
40 1.0 /* wheel_multiplier */,
41 };
Comran Morshed5323ecb2015-12-26 20:50:55 +000042
43 return kDrivetrainConfig;
44};
45
46} // namespace control_loops
47} // namespace y2014