mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] Simulation: Add ctor parameter to set starting state of mechanism sims (#5288)
- Add a constructor parameter to configure the initial angle of the arm - Also reorganizes cascading constructors for Java
This commit is contained in:
@@ -50,6 +50,7 @@ public class Arm implements AutoCloseable {
|
||||
Constants.kMinAngleRads,
|
||||
Constants.kMaxAngleRads,
|
||||
true,
|
||||
0,
|
||||
VecBuilder.fill(Constants.kArmEncoderDistPerPulse) // Add noise with a std-dev of 1 tick
|
||||
);
|
||||
private final EncoderSim m_encoderSim = new EncoderSim(m_encoder);
|
||||
|
||||
@@ -54,6 +54,7 @@ public class Elevator implements AutoCloseable {
|
||||
Constants.kMinElevatorHeightMeters,
|
||||
Constants.kMaxElevatorHeightMeters,
|
||||
true,
|
||||
0,
|
||||
VecBuilder.fill(0.01));
|
||||
private final EncoderSim m_encoderSim = new EncoderSim(m_encoder);
|
||||
private final PWMSim m_motorSim = new PWMSim(m_motor);
|
||||
|
||||
Reference in New Issue
Block a user