[wpilib] Fix typos in simulation classes (#2799)

This commit is contained in:
Tyler Veness
2020-10-22 20:38:12 -07:00
committed by GitHub
parent 17698af5e3
commit abbf9f01ab
3 changed files with 8 additions and 4 deletions

View File

@@ -15,10 +15,10 @@
using namespace frc::sim;
AnalogEncoderSim::AnalogEncoderSim(const frc::AnalogEncoder& analogEncoder) {
AnalogEncoderSim::AnalogEncoderSim(const frc::AnalogEncoder& encoder) {
wpi::SmallString<128> fullname;
wpi::raw_svector_ostream os(fullname);
os << "AnalogEncoder" << '[' << analogEncoder.GetChannel() << ']';
os << "AnalogEncoder" << '[' << encoder.GetChannel() << ']';
frc::sim::SimDeviceSim deviceSim{fullname.c_str()};
m_positionSim = deviceSim.GetDouble("Position");
}

View File

@@ -26,12 +26,14 @@ class AnalogEncoderSim {
/**
* Constructs from an AnalogEncoder object.
*
* @param analogInput AnalogEncoder to simulate
* @param encoder AnalogEncoder to simulate
*/
explicit AnalogEncoderSim(const AnalogEncoder& analogEncoder);
explicit AnalogEncoderSim(const AnalogEncoder& encoder);
/**
* Set the position using an {@link Rotation2d}.
*
* @param angle The angle.
*/
void SetPosition(Rotation2d angle);

View File

@@ -29,6 +29,8 @@ public class AnalogEncoderSim {
/**
* Set the position using an {@link Rotation2d}.
*
* @param angle The angle.
*/
public void setPosition(Rotation2d angle) {
setTurns(angle.getDegrees() / 360.0);