Skip to content

Commit

Permalink
[wpilib] Const-qualify EncoderSim getters (wpilibsuite#5660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Starlight220 authored Sep 18, 2023
1 parent 7be2901 commit e67df8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions wpilibc/src/main/native/cpp/simulation/EncoderSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ void EncoderSim::SetDistance(double distance) {
HALSIM_SetEncoderDistance(m_index, distance);
}

double EncoderSim::GetDistance() {
double EncoderSim::GetDistance() const {
return HALSIM_GetEncoderDistance(m_index);
}

void EncoderSim::SetRate(double rate) {
HALSIM_SetEncoderRate(m_index, rate);
}

double EncoderSim::GetRate() {
double EncoderSim::GetRate() const {
return HALSIM_GetEncoderRate(m_index);
}
4 changes: 2 additions & 2 deletions wpilibc/src/main/native/include/frc/simulation/EncoderSim.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class EncoderSim {
*
* @return the encoder distance
*/
double GetDistance();
double GetDistance() const;

/**
* Change the rate of the encoder.
Expand All @@ -309,7 +309,7 @@ class EncoderSim {
*
* @return the rate of change
*/
double GetRate();
double GetRate() const;

private:
explicit EncoderSim(int index) : m_index{index} {}
Expand Down

0 comments on commit e67df8c

Please sign in to comment.