Skip to content

Commit

Permalink
[wpilibc] Rename DCMotorSim getters
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Dec 31, 2024
1 parent 86137c4 commit d9dbb23
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions wpilibc/src/main/native/cpp/simulation/DCMotorSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,15 @@ void DCMotorSim::SetInputVoltage(units::volt_t voltage) {
SetInput(Vectord<1>{voltage.value()});
ClampInput(frc::RobotController::GetBatteryVoltage().value());
}

const DCMotor& DCMotorSim::GetGearbox() const {
return m_gearbox;
}

double DCMotorSim::GetGearing() const {
return m_gearing;
}

units::kilogram_square_meter_t DCMotorSim::GetJ() const {
return m_j;
}
6 changes: 3 additions & 3 deletions wpilibc/src/main/native/include/frc/simulation/DCMotorSim.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@ class DCMotorSim : public LinearSystemSim<2, 1, 2> {
/**
* Returns the gearbox.
*/
const DCMotor& Gearbox() const { return m_gearbox; }
const DCMotor& GetGearbox() const;

/**
* Returns the gearing;
*/
double Gearing() const { return m_gearing; }
double GetGearing() const;

/**
* Returns the moment of inertia
*/
units::kilogram_square_meter_t J() const { return m_j; }
units::kilogram_square_meter_t GetJ() const;

private:
DCMotor m_gearbox;
Expand Down

0 comments on commit d9dbb23

Please sign in to comment.