mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpimath] Reorganize LinearSystem factories (#8468)
This commit is contained in:
@@ -12,10 +12,10 @@ import org.wpilib.math.numbers.N1;
|
||||
import org.wpilib.math.numbers.N2;
|
||||
import org.wpilib.math.numbers.N7;
|
||||
import org.wpilib.math.random.Normal;
|
||||
import org.wpilib.math.system.DCMotor;
|
||||
import org.wpilib.math.system.LinearSystem;
|
||||
import org.wpilib.math.system.Models;
|
||||
import org.wpilib.math.system.NumericalIntegration;
|
||||
import org.wpilib.math.system.plant.DCMotor;
|
||||
import org.wpilib.math.system.plant.LinearSystemId;
|
||||
import org.wpilib.math.util.Nat;
|
||||
import org.wpilib.math.util.StateSpaceUtil;
|
||||
import org.wpilib.math.util.Units;
|
||||
@@ -77,7 +77,7 @@ public class DifferentialDrivetrainSim {
|
||||
double trackwidth,
|
||||
Matrix<N7, N1> measurementStdDevs) {
|
||||
this(
|
||||
LinearSystemId.createDrivetrainVelocitySystem(
|
||||
Models.differentialDriveFromPhysicalConstants(
|
||||
driveMotor, mass, wheelRadius, trackwidth / 2.0, j, gearing),
|
||||
driveMotor,
|
||||
gearing,
|
||||
@@ -91,10 +91,9 @@ public class DifferentialDrivetrainSim {
|
||||
*
|
||||
* @param plant The {@link LinearSystem} representing the robot's drivetrain. This system can be
|
||||
* created with {@link
|
||||
* org.wpilib.math.system.plant.LinearSystemId#createDrivetrainVelocitySystem(DCMotor, double,
|
||||
* org.wpilib.math.system.Models#differentialDriveFromPhysicalConstants(DCMotor, double,
|
||||
* double, double, double, double)} or {@link
|
||||
* org.wpilib.math.system.plant.LinearSystemId#identifyDrivetrainSystem(double, double,
|
||||
* double, double)}.
|
||||
* org.wpilib.math.system.Models#differentialDriveFromSysId(double, double, double, double)}.
|
||||
* @param driveMotor A {@link DCMotor} representing the drivetrain.
|
||||
* @param gearing The gearingRatio ratio of the robot, as output over input. This must be the same
|
||||
* ratio as the ratio used to identify or create the drivetrainPlant.
|
||||
|
||||
Reference in New Issue
Block a user