transitions -> pulses per second

This commit is contained in:
Pascal Serrarens 2024-01-19 14:14:00 +01:00
parent 8b2f9439ca
commit f3021c1f58
2 changed files with 6 additions and 6 deletions

View File

@ -1,9 +1,9 @@
#include "Encoder.h" #include "Encoder.h"
Encoder::Encoder(unsigned char transitionsPerRotation, Encoder::Encoder(unsigned char pulsesPerRevolution,
unsigned char distancePerRotation) { unsigned char distancePerRotation) {
//: Encoder::Encoder() { //: Encoder::Encoder() {
this->transitionsPerRevolution = transitionsPerRotation; this->pulsesPerRevolution = pulsesPerRevolution;
this->distancePerRevolution = distancePerRotation; this->distancePerRevolution = distancePerRotation;
} }

View File

@ -8,11 +8,11 @@ namespace RoboidControl {
class Encoder { class Encoder {
public: public:
/// @brief Creates a sensor which measures distance from pulses /// @brief Creates a sensor which measures distance from pulses
/// @param transitionsPerRevolution The number of pulse edges which make a /// @param pulsesPerRevolution The number of pulse edges which make a
/// full rotation /// full rotation
/// @param distancePerRevolution The distance a wheel travels per full /// @param distancePerRevolution The distance a wheel travels per full
/// rotation /// rotation
Encoder(unsigned char transitionsPerRevolution = 1, Encoder(unsigned char pulsesPerRevolution = 1,
unsigned char distancePerRevolution = 1); unsigned char distancePerRevolution = 1);
/// @brief Get the total number of pulses since the previous call /// @brief Get the total number of pulses since the previous call
@ -36,11 +36,11 @@ public:
/// @param currentTimeMs The clock time in milliseconds /// @param currentTimeMs The clock time in milliseconds
/// @return The speed in meters per second. /// @return The speed in meters per second.
/// @note this value is dependent on the accurate setting of the /// @note this value is dependent on the accurate setting of the
/// transitionsPerRevolution and distancePerRevolution parameters; /// pulsesPerRevolution and distancePerRevolution parameters;
virtual float GetSpeed(float currentTimeMs); virtual float GetSpeed(float currentTimeMs);
/// @brief The numer of pulses corresponding to a full rotation of the axle /// @brief The numer of pulses corresponding to a full rotation of the axle
unsigned char transitionsPerRevolution = 1; unsigned char pulsesPerRevolution = 1;
/// @brief The number of revolutions which makes the wheel move forward 1 /// @brief The number of revolutions which makes the wheel move forward 1
/// meter /// meter
unsigned char distancePerRevolution = 1; unsigned char distancePerRevolution = 1;