mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpilib] Document how to create LinearSystem object for physics sim classes (NFC) (#5488)
Fixes #4372.
This commit is contained in:
@@ -23,7 +23,9 @@ public class DCMotorSim extends LinearSystemSim<N2, N1, N2> {
|
||||
/**
|
||||
* Creates a simulated DC motor mechanism.
|
||||
*
|
||||
* @param plant The linear system that represents the DC motor.
|
||||
* @param plant The linear system representing the DC motor. This system can be created with
|
||||
* {@link edu.wpi.first.math.system.plant.LinearSystemId#createDCMotorSystem(DCMotor, double,
|
||||
* double)}.
|
||||
* @param gearbox The type of and number of motors in the DC motor gearbox.
|
||||
* @param gearing The gearing of the DC motor (numbers greater than 1 represent reductions).
|
||||
*/
|
||||
@@ -36,7 +38,7 @@ public class DCMotorSim extends LinearSystemSim<N2, N1, N2> {
|
||||
/**
|
||||
* Creates a simulated DC motor mechanism.
|
||||
*
|
||||
* @param plant The linear system that represents the DC motor.
|
||||
* @param plant The linear system representing the DC motor. This system can be created with
|
||||
* @param gearbox The type of and number of motors in the DC motor gearbox.
|
||||
* @param gearing The gearing of the DC motor (numbers greater than 1 represent reductions).
|
||||
* @param measurementStdDevs The standard deviations of the measurements.
|
||||
|
||||
@@ -52,7 +52,7 @@ public class DifferentialDrivetrainSim {
|
||||
private final LinearSystem<N2, N2, N2> m_plant;
|
||||
|
||||
/**
|
||||
* Create a SimDrivetrain.
|
||||
* Creates a simulated differential drivetrain.
|
||||
*
|
||||
* @param driveMotor A {@link DCMotor} representing the left side of the drivetrain.
|
||||
* @param gearing The gearing ratio between motor and wheel, as output over input. This must be
|
||||
@@ -91,10 +91,10 @@ public class DifferentialDrivetrainSim {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a SimDrivetrain .
|
||||
* Creates a simulated differential drivetrain.
|
||||
*
|
||||
* @param drivetrainPlant The {@link LinearSystem} representing the robot's drivetrain. This
|
||||
* system can be created with {@link
|
||||
* @param plant The {@link LinearSystem} representing the robot's drivetrain. This system can be
|
||||
* created with {@link
|
||||
* edu.wpi.first.math.system.plant.LinearSystemId#createDrivetrainVelocitySystem(DCMotor,
|
||||
* double, double, double, double, double)} or {@link
|
||||
* edu.wpi.first.math.system.plant.LinearSystemId#identifyDrivetrainSystem(double, double,
|
||||
@@ -112,13 +112,13 @@ public class DifferentialDrivetrainSim {
|
||||
* point.
|
||||
*/
|
||||
public DifferentialDrivetrainSim(
|
||||
LinearSystem<N2, N2, N2> drivetrainPlant,
|
||||
LinearSystem<N2, N2, N2> plant,
|
||||
DCMotor driveMotor,
|
||||
double gearing,
|
||||
double trackWidthMeters,
|
||||
double wheelRadiusMeters,
|
||||
Matrix<N7, N1> measurementStdDevs) {
|
||||
this.m_plant = drivetrainPlant;
|
||||
this.m_plant = plant;
|
||||
this.m_rb = trackWidthMeters / 2.0;
|
||||
this.m_motor = driveMotor;
|
||||
this.m_originalGearing = gearing;
|
||||
|
||||
@@ -37,7 +37,9 @@ public class ElevatorSim extends LinearSystemSim<N2, N1, N1> {
|
||||
/**
|
||||
* Creates a simulated elevator mechanism.
|
||||
*
|
||||
* @param plant The linear system that represents the elevator.
|
||||
* @param plant The linear system that represents the elevator. This system can be created with
|
||||
* {@link edu.wpi.first.math.system.plant.LinearSystemId#createElevatorSystem(DCMotor, double,
|
||||
* double, double)}.
|
||||
* @param gearbox The type of and number of motors in the elevator gearbox.
|
||||
* @param gearing The gearing of the elevator (numbers greater than 1 represent reductions).
|
||||
* @param drumRadiusMeters The radius of the drum that the elevator spool is wrapped around.
|
||||
@@ -72,7 +74,9 @@ public class ElevatorSim extends LinearSystemSim<N2, N1, N1> {
|
||||
/**
|
||||
* Creates a simulated elevator mechanism.
|
||||
*
|
||||
* @param plant The linear system that represents the elevator.
|
||||
* @param plant The linear system that represents the elevator. This system can be created with
|
||||
* {@link edu.wpi.first.math.system.plant.LinearSystemId#createElevatorSystem(DCMotor, double,
|
||||
* double, double)}.
|
||||
* @param gearbox The type of and number of motors in the elevator gearbox.
|
||||
* @param gearing The gearing of the elevator (numbers greater than 1 represent reductions).
|
||||
* @param drumRadiusMeters The radius of the drum that the elevator spool is wrapped around.
|
||||
|
||||
@@ -22,7 +22,9 @@ public class FlywheelSim extends LinearSystemSim<N1, N1, N1> {
|
||||
/**
|
||||
* Creates a simulated flywheel mechanism.
|
||||
*
|
||||
* @param plant The linear system that represents the flywheel.
|
||||
* @param plant The linear system that represents the flywheel. This system can be created with
|
||||
* {@link edu.wpi.first.math.system.plant.LinearSystemId#createFlywheelSystem(DCMotor, double,
|
||||
* double)}.
|
||||
* @param gearbox The type of and number of motors in the flywheel gearbox.
|
||||
* @param gearing The gearing of the flywheel (numbers greater than 1 represent reductions).
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,9 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
|
||||
/**
|
||||
* Creates a simulated arm mechanism.
|
||||
*
|
||||
* @param plant The linear system that represents the arm.
|
||||
* @param plant The linear system that represents the arm. This system can be created with {@link
|
||||
* edu.wpi.first.math.system.plant.LinearSystemId#createSingleJointedArmSystem(DCMotor,
|
||||
* double, double)}.
|
||||
* @param gearbox The type of and number of motors in the arm gearbox.
|
||||
* @param gearing The gearing of the arm (numbers greater than 1 represent reductions).
|
||||
* @param armLengthMeters The length of the arm.
|
||||
@@ -70,7 +72,9 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
|
||||
/**
|
||||
* Creates a simulated arm mechanism.
|
||||
*
|
||||
* @param plant The linear system that represents the arm.
|
||||
* @param plant The linear system that represents the arm. This system can be created with {@link
|
||||
* edu.wpi.first.math.system.plant.LinearSystemId#createSingleJointedArmSystem(DCMotor,
|
||||
* double, double)}.
|
||||
* @param gearbox The type of and number of motors in the arm gearbox.
|
||||
* @param gearing The gearing of the arm (numbers greater than 1 represent reductions).
|
||||
* @param armLengthMeters The length of the arm.
|
||||
|
||||
Reference in New Issue
Block a user