25 template <
typename Distance>
29 template <
typename Distance>
45 units::kilogram_t mass,
46 units::meter_t radius,
double G);
59 DCMotor motor, units::kilogram_square_meter_t J,
double G);
80 template <
typename Distance>
81 requires std::same_as<units::meter, Distance> ||
82 std::same_as<units::radian, Distance>
86 if (kV <=
decltype(kV){0}) {
87 throw std::domain_error(
"Kv must be greater than zero.");
89 if (kA <=
decltype(kA){0}) {
90 throw std::domain_error(
"Ka must be greater than zero.");
121 template <
typename Distance>
122 requires std::same_as<units::meter, Distance> ||
123 std::same_as<units::radian, Distance>
127 if (kV <=
decltype(kV){0}) {
128 throw std::domain_error(
"Kv must be greater than zero.");
130 if (kA <=
decltype(kA){0}) {
131 throw std::domain_error(
"Ka must be greater than zero.");
134 Matrixd<2, 2> A{{0.0, 1.0}, {0.0, -kV.value() / kA.value()}};
163 decltype(1_V / 1_mps) kVLinear,
decltype(1_V / 1_mps_sq) kALinear,
164 decltype(1_V / 1_mps) kVAngular,
decltype(1_V / 1_mps_sq) kAAngular);
190 decltype(1_V / 1_mps) kVLinear,
decltype(1_V / 1_mps_sq) kALinear,
191 decltype(1_V / 1_rad_per_s) kVAngular,
192 decltype(1_V / 1_rad_per_s_sq) kAAngular, units::meter_t trackwidth);
205 units::kilogram_square_meter_t J,
219 units::kilogram_square_meter_t J,
237 const DCMotor& motor, units::kilogram_t mass, units::meter_t r,
238 units::meter_t rb, units::kilogram_square_meter_t J,
double G);
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:180
Holds the constants for a DC motor.
Definition: DCMotor.h:20
A plant defined using state-space notation.
Definition: LinearSystem.h:31
Definition: LinearSystemId.h:23
static LinearSystem< 2, 1, 1 > ElevatorSystem(DCMotor motor, units::kilogram_t mass, units::meter_t radius, double G)
Create a state-space model of the elevator system.
static LinearSystem< 2, 1, 2 > DCMotorSystem(DCMotor motor, units::kilogram_square_meter_t J, double G)
Create a state-space model of a DC motor system.
static LinearSystem< 2, 1, 1 > IdentifyPositionSystem(decltype(1_V/Velocity_t< Distance >(1)) kV, decltype(1_V/Acceleration_t< Distance >(1)) kA)
Create a state-space model for a 1 DOF position system from its kV (volts/(unit/sec)) and kA (volts/(...
Definition: LinearSystemId.h:124
static LinearSystem< 2, 1, 1 > SingleJointedArmSystem(DCMotor motor, units::kilogram_square_meter_t J, double G)
Create a state-space model of a single-jointed arm system.The states of the system are [angle,...
static LinearSystem< 1, 1, 1 > IdentifyVelocitySystem(decltype(1_V/Velocity_t< Distance >(1)) kV, decltype(1_V/Acceleration_t< Distance >(1)) kA)
Create a state-space model for a 1 DOF velocity system from its kV (volts/(unit/sec)) and kA (volts/(...
Definition: LinearSystemId.h:83
static LinearSystem< 2, 2, 2 > IdentifyDrivetrainSystem(decltype(1_V/1_mps) kVLinear, decltype(1_V/1_mps_sq) kALinear, decltype(1_V/1_rad_per_s) kVAngular, decltype(1_V/1_rad_per_s_sq) kAAngular, units::meter_t trackwidth)
Identify a differential drive drivetrain given the drivetrain's kV and kA in both linear {(volts/(met...
static LinearSystem< 2, 2, 2 > DrivetrainVelocitySystem(const DCMotor &motor, units::kilogram_t mass, units::meter_t r, units::meter_t rb, units::kilogram_square_meter_t J, double G)
Create a state-space model of differential drive drivetrain.
static LinearSystem< 1, 1, 1 > FlywheelSystem(DCMotor motor, units::kilogram_square_meter_t J, double G)
Create a state-space model of a flywheel system, the states of the system are [angular velocity],...
static LinearSystem< 2, 2, 2 > IdentifyDrivetrainSystem(decltype(1_V/1_mps) kVLinear, decltype(1_V/1_mps_sq) kALinear, decltype(1_V/1_mps) kVAngular, decltype(1_V/1_mps_sq) kAAngular)
Identify a differential drive drivetrain given the drivetrain's kV and kA in both linear {(volts/(met...
Container for values which represent quantities of a given unit.
Definition: base.h:1937
typename units::detail::inverse_impl< U >::type inverse
represents the inverse unit type of class U.
Definition: base.h:1145
typename units::detail::compound_impl< U, Us... >::type compound_unit
Represents a unit type made up from other units.
Definition: base.h:1445
Definition: AprilTagPoseEstimator.h:15
G
Definition: magnetic_field_strength.h:52