Use standard constant for pi instead of 3.14 (#2084)

This commit is contained in:
Tyler Veness
2019-11-15 17:33:18 -08:00
committed by Peter Johnson
parent db2c3dddd7
commit 1b66ead49d
14 changed files with 32 additions and 20 deletions

View File

@@ -7,6 +7,8 @@
#pragma once
#include <wpi/math>
/**
* The Constants header provides a convenient place for teams to hold robot-wide
* numerical or bool constants. This should not be used for any other purpose.
@@ -31,7 +33,7 @@ constexpr int kEncoderCPR = 1024;
constexpr double kWheelDiameterInches = 6;
constexpr double kEncoderDistancePerPulse =
// Assumes the encoders are directly mounted on the wheel shafts
(kWheelDiameterInches * 3.142) / static_cast<double>(kEncoderCPR);
(kWheelDiameterInches * wpi::math::pi) / static_cast<double>(kEncoderCPR);
constexpr bool kGyroReversed = true;