mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fix C++ floating point literal formatting (#2114)
Found formatting errors with this regex "([^a-z0-9\.]\.[0-9]|[^a-z0-9\.][0-9]\.[^a-z0-9\.])" and ignored false positives. Fixes #2112.
This commit is contained in:
committed by
Peter Johnson
parent
3d1ca856b2
commit
ffa4b907c0
@@ -35,7 +35,7 @@ void DriveSubsystem::ResetEncoders() {
|
||||
}
|
||||
|
||||
double DriveSubsystem::GetAverageEncoderDistance() {
|
||||
return (m_leftEncoder.GetDistance() + m_rightEncoder.GetDistance()) / 2.;
|
||||
return (m_leftEncoder.GetDistance() + m_rightEncoder.GetDistance()) / 2.0;
|
||||
}
|
||||
|
||||
frc::Encoder& DriveSubsystem::GetLeftEncoder() { return m_leftEncoder; }
|
||||
@@ -47,9 +47,9 @@ void DriveSubsystem::SetMaxOutput(double maxOutput) {
|
||||
}
|
||||
|
||||
double DriveSubsystem::GetHeading() {
|
||||
return std::remainder(m_gyro.GetAngle(), 360) * (kGyroReversed ? -1. : 1.);
|
||||
return std::remainder(m_gyro.GetAngle(), 360) * (kGyroReversed ? -1.0 : 1.0);
|
||||
}
|
||||
|
||||
double DriveSubsystem::GetTurnRate() {
|
||||
return m_gyro.GetRate() * (kGyroReversed ? -1. : 1.);
|
||||
return m_gyro.GetRate() * (kGyroReversed ? -1.0 : 1.0);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ constexpr double kEncoderDistancePerPulse =
|
||||
constexpr bool kGyroReversed = true;
|
||||
|
||||
constexpr double kStabilizationP = 1;
|
||||
constexpr double kStabilizationI = .5;
|
||||
constexpr double kStabilizationI = 0.5;
|
||||
constexpr double kStabilizationD = 0;
|
||||
|
||||
constexpr double kTurnP = 1;
|
||||
@@ -52,7 +52,7 @@ constexpr double kTurnRateToleranceDegPerS = 10; // degrees per second
|
||||
namespace AutoConstants {
|
||||
constexpr double kAutoDriveDistanceInches = 60;
|
||||
constexpr double kAutoBackupDistanceInches = 20;
|
||||
constexpr double kAutoDriveSpeed = .5;
|
||||
constexpr double kAutoDriveSpeed = 0.5;
|
||||
} // namespace AutoConstants
|
||||
|
||||
namespace OIConstants {
|
||||
|
||||
@@ -68,7 +68,7 @@ class RobotContainer {
|
||||
// Require the robot drive
|
||||
{&m_drive}};
|
||||
|
||||
frc2::InstantCommand m_driveHalfSpeed{[this] { m_drive.SetMaxOutput(.5); },
|
||||
frc2::InstantCommand m_driveHalfSpeed{[this] { m_drive.SetMaxOutput(0.5); },
|
||||
{}};
|
||||
frc2::InstantCommand m_driveFullSpeed{[this] { m_drive.SetMaxOutput(1); },
|
||||
{}};
|
||||
|
||||
Reference in New Issue
Block a user