[wpilib] Clean up simulation physics API (#2739)

Some vestigial functions were never removed, and C++ single-jointed arm
sim was missing a flag for disabling gravity simulation. This is useful
for mechanisms like turrets.

Fixes #2738.
This commit is contained in:
Tyler Veness
2020-09-27 00:13:59 -07:00
committed by GitHub
parent 17d3d2f754
commit fc991cb59c
5 changed files with 43 additions and 30 deletions

View File

@@ -67,6 +67,7 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
* the simulation and write simulated outputs to sensors.
*
* @param motor DCMotor representing the motor driving the arm.
* @param jKgSquaredMeters The moment of inertia of the arm.
* @param G The gear ratio of the arm (numbers greater than 1
* represent reductions).
* @param armMassKg The mass of the arm.
@@ -188,10 +189,6 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
return m_x.get(1, 0);
}
public double getInputVoltageVolts() {
return m_u.get(0, 0);
}
@Override
public double getCurrentDrawAmps() {
// Reductions are greater than 1, so a reduction of 10:1 would mean the motor is