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

@@ -11,12 +11,15 @@
#include <frc/TimedRobot.h>
#include <frc/controller/PIDController.h>
#include <frc/trajectory/TrapezoidProfile.h>
#include <wpi/math>
class Robot : public frc::TimedRobot {
public:
static constexpr units::second_t kDt = 20_ms;
Robot() { m_encoder.SetDistancePerPulse(1.0 / 360.0 * 2.0 * 3.1415 * 1.5); }
Robot() {
m_encoder.SetDistancePerPulse(1.0 / 360.0 * 2.0 * wpi::math::pi * 1.5);
}
void TeleopPeriodic() override {
if (m_joystick.GetRawButtonPressed(2)) {