[wpimath] Refactor WheelVoltages inner class to a separate file (#4203)

This commit is contained in:
Tyler Veness
2022-05-01 11:01:20 -07:00
committed by GitHub
parent 87bf70fa8e
commit ce1a7d698a
8 changed files with 63 additions and 70 deletions

View File

@@ -94,8 +94,7 @@ void LTVDifferentialDriveController::SetTolerance(
leftVelocityTolerance.value(), rightVelocityTolerance.value()};
}
LTVDifferentialDriveController::WheelVoltages
LTVDifferentialDriveController::Calculate(
DifferentialDriveWheelVoltages LTVDifferentialDriveController::Calculate(
const Pose2d& currentPose, units::meters_per_second_t leftVelocity,
units::meters_per_second_t rightVelocity, const Pose2d& poseRef,
units::meters_per_second_t leftVelocityRef,
@@ -124,11 +123,11 @@ LTVDifferentialDriveController::Calculate(
Vectord<2> u = K * inRobotFrame * m_error;
return WheelVoltages{units::volt_t{u(0)}, units::volt_t{u(1)}};
return DifferentialDriveWheelVoltages{units::volt_t{u(0)},
units::volt_t{u(1)}};
}
LTVDifferentialDriveController::WheelVoltages
LTVDifferentialDriveController::Calculate(
DifferentialDriveWheelVoltages LTVDifferentialDriveController::Calculate(
const Pose2d& currentPose, units::meters_per_second_t leftVelocity,
units::meters_per_second_t rightVelocity,
const Trajectory::State& desiredState) {