mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Clean up Java style (#5990)
Also make equivalent changes in C++ where applicable. Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
This commit is contained in:
@@ -92,26 +92,22 @@ Pose2d DifferentialDrivetrainSim::GetPose() const {
|
||||
}
|
||||
|
||||
units::ampere_t DifferentialDrivetrainSim::GetLeftCurrentDraw() const {
|
||||
auto loadIleft =
|
||||
m_motor.Current(
|
||||
units::radians_per_second_t{m_x(State::kLeftVelocity) *
|
||||
m_currentGearing / m_wheelRadius.value()},
|
||||
units::volt_t{m_u(0)}) *
|
||||
wpi::sgn(m_u(0));
|
||||
|
||||
return loadIleft;
|
||||
return m_motor.Current(units::radians_per_second_t{m_x(State::kLeftVelocity) *
|
||||
m_currentGearing /
|
||||
m_wheelRadius.value()},
|
||||
units::volt_t{m_u(0)}) *
|
||||
wpi::sgn(m_u(0));
|
||||
}
|
||||
|
||||
units::ampere_t DifferentialDrivetrainSim::GetRightCurrentDraw() const {
|
||||
auto loadIRight =
|
||||
m_motor.Current(
|
||||
units::radians_per_second_t{m_x(State::kRightVelocity) *
|
||||
m_currentGearing / m_wheelRadius.value()},
|
||||
units::volt_t{m_u(1)}) *
|
||||
wpi::sgn(m_u(1));
|
||||
|
||||
return loadIRight;
|
||||
return m_motor.Current(
|
||||
units::radians_per_second_t{m_x(State::kRightVelocity) *
|
||||
m_currentGearing /
|
||||
m_wheelRadius.value()},
|
||||
units::volt_t{m_u(1)}) *
|
||||
wpi::sgn(m_u(1));
|
||||
}
|
||||
|
||||
units::ampere_t DifferentialDrivetrainSim::GetCurrentDraw() const {
|
||||
return GetLeftCurrentDraw() + GetRightCurrentDraw();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user