Skip to content

Commit

Permalink
[wombat] pass can name into cancoder. (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty authored Jan 1, 2024
1 parent c1358ff commit 4f5f49d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wombat/src/main/cpp/utils/Encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ double wom::utils::DutyCycleEncoder::GetEncoderTickVelocity() const {
}

wom::utils::CanEncoder::CanEncoder(int deviceNumber, double ticksPerRotation,
double reduction)
double reduction, std::string name)
: wom::utils::Encoder(ticksPerRotation, reduction, 1) {
_canEncoder = new CANCoder(deviceNumber, "Drivebase");
_canEncoder = new CANCoder(deviceNumber, name);
}

double wom::utils::CanEncoder::GetEncoderRawTicks() const {
Expand Down
6 changes: 5 additions & 1 deletion wombat/src/main/include/utils/Encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#include <units/angle.h>
#include <units/angular_velocity.h>

#include <string>

#include "utils/Util.h"

namespace wom {
namespace utils {
class Encoder {
Expand Down Expand Up @@ -109,7 +113,7 @@ class DutyCycleEncoder : public Encoder {
class CanEncoder : public Encoder {
public:
CanEncoder(int deviceNumber, double ticksPerRotation = 4095,
double reduction = 1);
double reduction = 1, std::string name = "Drivebase");

double GetEncoderRawTicks() const override;
double GetEncoderTickVelocity() const override;
Expand Down

0 comments on commit 4f5f49d

Please sign in to comment.