Skip to content

Commit

Permalink
[wombat] add default reduction value (#43)
Browse files Browse the repository at this point in the history
Resolves #40
  • Loading branch information
spacey-sooty authored Jan 1, 2024
1 parent 8bdbfd7 commit 5acd73b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions wombat/src/main/cpp/utils/Encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

#include "utils/Encoder.h"

wom::utils::Encoder::Encoder(double encoderTicksPerRotation, int type,
double reduction)
: _reduction(reduction),
_encoderTicksPerRotation(encoderTicksPerRotation),
_type(type) {}

double wom::utils::Encoder::GetEncoderTicks() const {
return GetEncoderRawTicks();
}
Expand Down
6 changes: 2 additions & 4 deletions wombat/src/main/include/utils/Encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ namespace wom {
namespace utils {
class Encoder {
public:
Encoder(double encoderTicksPerRotation, double reduction, int type)
: _reduction(reduction),
_encoderTicksPerRotation(encoderTicksPerRotation),
_type(type) {}
Encoder(double encoderTicksPerRotation, int type, double reduction = 1.0);

virtual double GetEncoderRawTicks() const = 0;
virtual double GetEncoderTickVelocity() const = 0; // ticks/s
virtual void ZeroEncoder();
Expand Down

0 comments on commit 5acd73b

Please sign in to comment.