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"
Encoder::Encoder(unsigned char transitionsPerRotation,
Encoder::Encoder(unsigned char pulsesPerRevolution,
unsigned char distancePerRotation) {
//: Encoder::Encoder() {
this->transitionsPerRevolution = transitionsPerRotation;
this->pulsesPerRevolution = pulsesPerRevolution;
this->distancePerRevolution = distancePerRotation;
}

View File

@ -8,11 +8,11 @@ namespace RoboidControl {
class Encoder {
public:
/// @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
/// @param distancePerRevolution The distance a wheel travels per full
/// rotation
Encoder(unsigned char transitionsPerRevolution = 1,
Encoder(unsigned char pulsesPerRevolution = 1,
unsigned char distancePerRevolution = 1);
/// @brief Get the total number of pulses since the previous call
@ -36,11 +36,11 @@ public:
/// @param currentTimeMs The clock time in milliseconds
/// @return The speed in meters per second.
/// @note this value is dependent on the accurate setting of the
/// transitionsPerRevolution and distancePerRevolution parameters;
/// pulsesPerRevolution and distancePerRevolution parameters;
virtual float GetSpeed(float currentTimeMs);
/// @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
/// meter
unsigned char distancePerRevolution = 1;