mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpimath] Add full state support to LinearSystemId functions (#6554)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7fbbecb5b7
commit
7fc17811fa
@@ -17,7 +17,7 @@ namespace frc::sim {
|
||||
/**
|
||||
* Represents a simulated elevator mechanism.
|
||||
*/
|
||||
class ElevatorSim : public LinearSystemSim<2, 1, 1> {
|
||||
class ElevatorSim : public LinearSystemSim<2, 1, 2> {
|
||||
public:
|
||||
template <typename Distance>
|
||||
using Velocity_t = units::unit_t<
|
||||
@@ -42,10 +42,10 @@ class ElevatorSim : public LinearSystemSim<2, 1, 1> {
|
||||
* @param startingHeight The starting height of the elevator.
|
||||
* @param measurementStdDevs The standard deviation of the measurements.
|
||||
*/
|
||||
ElevatorSim(const LinearSystem<2, 1, 1>& plant, const DCMotor& gearbox,
|
||||
ElevatorSim(const LinearSystem<2, 1, 2>& plant, const DCMotor& gearbox,
|
||||
units::meter_t minHeight, units::meter_t maxHeight,
|
||||
bool simulateGravity, units::meter_t startingHeight,
|
||||
const std::array<double, 1>& measurementStdDevs = {0.0});
|
||||
const std::array<double, 2>& measurementStdDevs = {0.0, 0.0});
|
||||
|
||||
/**
|
||||
* Constructs a simulated elevator mechanism.
|
||||
@@ -67,7 +67,7 @@ class ElevatorSim : public LinearSystemSim<2, 1, 1> {
|
||||
units::kilogram_t carriageMass, units::meter_t drumRadius,
|
||||
units::meter_t minHeight, units::meter_t maxHeight,
|
||||
bool simulateGravity, units::meter_t startingHeight,
|
||||
const std::array<double, 1>& measurementStdDevs = {0.0});
|
||||
const std::array<double, 2>& measurementStdDevs = {0.0, 0.0});
|
||||
|
||||
/**
|
||||
* Constructs a simulated elevator mechanism.
|
||||
@@ -90,7 +90,7 @@ class ElevatorSim : public LinearSystemSim<2, 1, 1> {
|
||||
const DCMotor& gearbox, units::meter_t minHeight,
|
||||
units::meter_t maxHeight, bool simulateGravity,
|
||||
units::meter_t startingHeight,
|
||||
const std::array<double, 1>& measurementStdDevs = {0.0});
|
||||
const std::array<double, 2>& measurementStdDevs = {0.0, 0.0});
|
||||
using LinearSystemSim::SetState;
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace frc::sim {
|
||||
/**
|
||||
* Represents a simulated arm mechanism.
|
||||
*/
|
||||
class SingleJointedArmSim : public LinearSystemSim<2, 1, 1> {
|
||||
class SingleJointedArmSim : public LinearSystemSim<2, 1, 2> {
|
||||
public:
|
||||
/**
|
||||
* Creates a simulated arm mechanism.
|
||||
@@ -36,12 +36,13 @@ class SingleJointedArmSim : public LinearSystemSim<2, 1, 1> {
|
||||
* @param startingAngle The initial position of the arm.
|
||||
* @param measurementStdDevs The standard deviations of the measurements.
|
||||
*/
|
||||
SingleJointedArmSim(const LinearSystem<2, 1, 1>& system,
|
||||
SingleJointedArmSim(const LinearSystem<2, 1, 2>& system,
|
||||
const DCMotor& gearbox, double gearing,
|
||||
units::meter_t armLength, units::radian_t minAngle,
|
||||
units::radian_t maxAngle, bool simulateGravity,
|
||||
units::radian_t startingAngle,
|
||||
const std::array<double, 1>& measurementStdDevs = {0.0});
|
||||
const std::array<double, 2>& measurementStdDevs = {0.0,
|
||||
0.0});
|
||||
/**
|
||||
* Creates a simulated arm mechanism.
|
||||
*
|
||||
@@ -62,7 +63,8 @@ class SingleJointedArmSim : public LinearSystemSim<2, 1, 1> {
|
||||
units::meter_t armLength, units::radian_t minAngle,
|
||||
units::radian_t maxAngle, bool simulateGravity,
|
||||
units::radian_t startingAngle,
|
||||
const std::array<double, 1>& measurementStdDevs = {0.0});
|
||||
const std::array<double, 2>& measurementStdDevs = {0.0,
|
||||
0.0});
|
||||
|
||||
using LinearSystemSim::SetState;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user