Replace .to<double>() and .template to<double>() with .value() (#3667)

It's a less verbose way to do the same thing.
This commit is contained in:
Tyler Veness
2021-10-25 08:58:12 -07:00
committed by GitHub
parent 6bc1db44bc
commit 181723e573
134 changed files with 782 additions and 826 deletions

View File

@@ -310,20 +310,20 @@ void MecanumControllerCommand::Execute() {
(rearRightSpeedSetpoint - m_prevSpeeds.rearRight) / dt);
auto frontLeftOutput = volt_t(m_frontLeftController->Calculate(
m_currentWheelSpeeds().frontLeft.to<double>(),
frontLeftSpeedSetpoint.to<double>())) +
m_currentWheelSpeeds().frontLeft.value(),
frontLeftSpeedSetpoint.value())) +
frontLeftFeedforward;
auto rearLeftOutput = volt_t(m_rearLeftController->Calculate(
m_currentWheelSpeeds().rearLeft.to<double>(),
rearLeftSpeedSetpoint.to<double>())) +
m_currentWheelSpeeds().rearLeft.value(),
rearLeftSpeedSetpoint.value())) +
rearLeftFeedforward;
auto frontRightOutput = volt_t(m_frontRightController->Calculate(
m_currentWheelSpeeds().frontRight.to<double>(),
frontRightSpeedSetpoint.to<double>())) +
m_currentWheelSpeeds().frontRight.value(),
frontRightSpeedSetpoint.value())) +
frontRightFeedforward;
auto rearRightOutput = volt_t(m_rearRightController->Calculate(
m_currentWheelSpeeds().rearRight.to<double>(),
rearRightSpeedSetpoint.to<double>())) +
m_currentWheelSpeeds().rearRight.value(),
rearRightSpeedSetpoint.value())) +
rearRightFeedforward;
m_outputVolts(frontLeftOutput, rearLeftOutput, frontRightOutput,

View File

@@ -126,15 +126,15 @@ void RamseteCommand::Execute() {
targetWheelSpeeds.right,
(targetWheelSpeeds.right - m_prevSpeeds.right) / dt);
auto leftOutput = volt_t(m_leftController->Calculate(
m_speeds().left.to<double>(),
targetWheelSpeeds.left.to<double>())) +
leftFeedforward;
auto leftOutput =
volt_t(m_leftController->Calculate(m_speeds().left.value(),
targetWheelSpeeds.left.value())) +
leftFeedforward;
auto rightOutput = volt_t(m_rightController->Calculate(
m_speeds().right.to<double>(),
targetWheelSpeeds.right.to<double>())) +
rightFeedforward;
auto rightOutput =
volt_t(m_rightController->Calculate(m_speeds().right.value(),
targetWheelSpeeds.right.value())) +
rightFeedforward;
m_outputVolts(leftOutput, rightOutput);
} else {