diff --git a/wpilibc/src/main/native/cpp/simulation/EncoderSim.cpp b/wpilibc/src/main/native/cpp/simulation/EncoderSim.cpp index 146328d5cf0..9709b4c4c97 100644 --- a/wpilibc/src/main/native/cpp/simulation/EncoderSim.cpp +++ b/wpilibc/src/main/native/cpp/simulation/EncoderSim.cpp @@ -191,7 +191,7 @@ void EncoderSim::SetDistance(double distance) { HALSIM_SetEncoderDistance(m_index, distance); } -double EncoderSim::GetDistance() { +double EncoderSim::GetDistance() const { return HALSIM_GetEncoderDistance(m_index); } @@ -199,6 +199,6 @@ void EncoderSim::SetRate(double rate) { HALSIM_SetEncoderRate(m_index, rate); } -double EncoderSim::GetRate() { +double EncoderSim::GetRate() const { return HALSIM_GetEncoderRate(m_index); } diff --git a/wpilibc/src/main/native/include/frc/simulation/EncoderSim.h b/wpilibc/src/main/native/include/frc/simulation/EncoderSim.h index 52d7bd10cf3..80ad1463245 100644 --- a/wpilibc/src/main/native/include/frc/simulation/EncoderSim.h +++ b/wpilibc/src/main/native/include/frc/simulation/EncoderSim.h @@ -295,7 +295,7 @@ class EncoderSim { * * @return the encoder distance */ - double GetDistance(); + double GetDistance() const; /** * Change the rate of the encoder. @@ -309,7 +309,7 @@ class EncoderSim { * * @return the rate of change */ - double GetRate(); + double GetRate() const; private: explicit EncoderSim(int index) : m_index{index} {}