From 7e14f8b5799a59f247edbe1cd713edbc8d11cf3e Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 24 Oct 2021 17:34:49 -0600 Subject: [PATCH 1/2] Remove units from odomWheel, I think that was the only place we had units --- include/position/odomWheel.hpp | 14 +++++++------- src/position/motorOdom.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/position/odomWheel.hpp b/include/position/odomWheel.hpp index d2b66059..e7044367 100644 --- a/include/position/odomWheel.hpp +++ b/include/position/odomWheel.hpp @@ -10,26 +10,26 @@ namespace Pronounce { */ class OdomWheel { private: - double mmPosition = 0; + double position = 0; double lastPosition = 0; public: /** * Get the mm at the current moment */ - double getMM() { - return this->mmPosition; + double getPosition() { + return this->position; } /** * Set the MM */ - void setMM(double mmPosition) { - this->mmPosition = mmPosition; + void setPosition(double position) { + this->position = position; } double getChange() { - double difference = this->getMM() - this->lastPosition; - this->lastPosition = this->getMM(); + double difference = this->getPosition() - this->lastPosition; + this->lastPosition = this->getPosition(); return difference; } diff --git a/src/position/motorOdom.cpp b/src/position/motorOdom.cpp index a2ad9052..40e96cc0 100644 --- a/src/position/motorOdom.cpp +++ b/src/position/motorOdom.cpp @@ -11,6 +11,6 @@ namespace Pronounce { } void MotorOdom::update() { - this->setMM(motor->get_position() * radius * M_PI * 2.0 * tuningFactor); + this->setPosition(motor->get_position() * radius * M_PI * 2.0 * tuningFactor); } } // namespace Pronounce From 8dfb90693d37354ba2ffeb451a8dfc9c98cb2ad9 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 27 Oct 2021 12:33:58 -0600 Subject: [PATCH 2/2] Remove comments from units --- include/position/odomWheel.hpp | 4 ++-- src/position/motorOdom.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/position/odomWheel.hpp b/include/position/odomWheel.hpp index e7044367..ff8185c2 100644 --- a/include/position/odomWheel.hpp +++ b/include/position/odomWheel.hpp @@ -15,13 +15,13 @@ namespace Pronounce { public: /** - * Get the mm at the current moment + * Get the position at the current moment */ double getPosition() { return this->position; } /** - * Set the MM + * Set the position */ void setPosition(double position) { this->position = position; diff --git a/src/position/motorOdom.cpp b/src/position/motorOdom.cpp index 40e96cc0..aea799c7 100644 --- a/src/position/motorOdom.cpp +++ b/src/position/motorOdom.cpp @@ -1,9 +1,9 @@ #include "motorOdom.hpp" namespace Pronounce { - MotorOdom::MotorOdom(pros::Motor* motor, double radiusMM) { + MotorOdom::MotorOdom(pros::Motor* motor, double radius) { this->motor = motor; - this->radius = radiusMM; + this->radius = radius; this->motor->set_encoder_units(pros::E_MOTOR_ENCODER_ROTATIONS); }