[wpilib] Add mechanism specific SetState overloads to physics sims (#5534)

This commit is contained in:
Ryan Blue
2023-08-12 18:21:07 -04:00
committed by GitHub
parent 8121566258
commit a4b7fde767
12 changed files with 112 additions and 6 deletions

View File

@@ -65,6 +65,16 @@ class ElevatorSim : public LinearSystemSim<2, 1, 1> {
bool simulateGravity, units::meter_t startingHeight,
const std::array<double, 1>& measurementStdDevs = {0.0});
using LinearSystemSim::SetState;
/**
* Sets the elevator's state. The new position will be limited between the
* minimum and maximum allowed heights.
* @param position The new position
* @param velocity The new velocity
*/
void SetState(units::meter_t position, units::meters_per_second_t velocity);
/**
* Returns whether the elevator would hit the lower limit.
*