mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Use standard constant for pi instead of 3.14 (#2084)
This commit is contained in:
committed by
Peter Johnson
parent
db2c3dddd7
commit
1b66ead49d
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user