mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
SCRIPT: Spotless Apply
This commit is contained in:
committed by
Peter Johnson
parent
c89910b7c6
commit
c48b722dac
@@ -4,9 +4,9 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import org.wpilib.hardware.hal.SimDouble;
|
||||
import org.wpilib.hardware.accelerometer.ADXL345_I2C;
|
||||
import java.util.Objects;
|
||||
import org.wpilib.hardware.accelerometer.ADXL345_I2C;
|
||||
import org.wpilib.hardware.hal.SimDouble;
|
||||
|
||||
/** Class to control a simulated ADXL345. */
|
||||
public class ADXL345Sim {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import org.wpilib.hardware.discrete.AnalogInput;
|
||||
import org.wpilib.hardware.hal.simulation.AnalogInDataJNI;
|
||||
import org.wpilib.hardware.hal.simulation.NotifyCallback;
|
||||
import org.wpilib.hardware.discrete.AnalogInput;
|
||||
|
||||
/** Class to control a simulated analog input. */
|
||||
public class AnalogInputSim {
|
||||
|
||||
@@ -33,8 +33,8 @@ public final class BatterySim {
|
||||
/**
|
||||
* Calculate the loaded battery voltage. Use this with {@link RoboRioSim#setVInVoltage(double)} to
|
||||
* set the simulated battery voltage, which can then be retrieved with the {@link
|
||||
* org.wpilib.system.RobotController#getBatteryVoltage()} method. This function assumes a
|
||||
* nominal voltage of 12v and a resistance of 20 milliohms (0.020 ohms)
|
||||
* org.wpilib.system.RobotController#getBatteryVoltage()} method. This function assumes a nominal
|
||||
* voltage of 12v and a resistance of 20 milliohms (0.020 ohms)
|
||||
*
|
||||
* @param currents The currents drawn from the battery.
|
||||
* @return The battery's voltage under load.
|
||||
|
||||
@@ -27,10 +27,9 @@ public class DCMotorSim extends LinearSystemSim<N2, N1, N2> {
|
||||
*
|
||||
* @param plant The linear system representing the DC motor. This system can be created with
|
||||
* {@link org.wpilib.math.system.plant.LinearSystemId#createDCMotorSystem(DCMotor, double,
|
||||
* double)} or {@link
|
||||
* org.wpilib.math.system.plant.LinearSystemId#createDCMotorSystem(double, double)}. If
|
||||
* {@link org.wpilib.math.system.plant.LinearSystemId#createDCMotorSystem(double, double)}
|
||||
* is used, the distance unit must be radians.
|
||||
* double)} or {@link org.wpilib.math.system.plant.LinearSystemId#createDCMotorSystem(double,
|
||||
* double)}. If {@link org.wpilib.math.system.plant.LinearSystemId#createDCMotorSystem(double,
|
||||
* double)} is used, the distance unit must be radians.
|
||||
* @param gearbox The type of and number of motors in the DC motor gearbox.
|
||||
* @param measurementStdDevs The standard deviations of the measurements. Can be omitted if no
|
||||
* noise is desired. If present must have 2 elements. The first element is for position. The
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import org.wpilib.hardware.hal.simulation.DIODataJNI;
|
||||
import org.wpilib.hardware.hal.simulation.NotifyCallback;
|
||||
import org.wpilib.hardware.discrete.DigitalInput;
|
||||
import org.wpilib.hardware.discrete.DigitalOutput;
|
||||
import org.wpilib.hardware.hal.simulation.DIODataJNI;
|
||||
import org.wpilib.hardware.hal.simulation.NotifyCallback;
|
||||
|
||||
/** Class to control a simulated digital input or output. */
|
||||
public class DIOSim {
|
||||
|
||||
@@ -4,12 +4,10 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import org.wpilib.math.linalg.Matrix;
|
||||
import org.wpilib.math.util.Nat;
|
||||
import org.wpilib.math.util.StateSpaceUtil;
|
||||
import org.wpilib.math.linalg.VecBuilder;
|
||||
import org.wpilib.math.geometry.Pose2d;
|
||||
import org.wpilib.math.geometry.Rotation2d;
|
||||
import org.wpilib.math.linalg.Matrix;
|
||||
import org.wpilib.math.linalg.VecBuilder;
|
||||
import org.wpilib.math.numbers.N1;
|
||||
import org.wpilib.math.numbers.N2;
|
||||
import org.wpilib.math.numbers.N7;
|
||||
@@ -17,6 +15,8 @@ import org.wpilib.math.system.LinearSystem;
|
||||
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;
|
||||
import org.wpilib.system.RobotController;
|
||||
|
||||
@@ -24,8 +24,8 @@ import org.wpilib.system.RobotController;
|
||||
* This class simulates the state of the drivetrain. In simulationPeriodic, users should first set
|
||||
* inputs from motors with {@link #setInputs(double, double)}, call {@link #update(double)} to
|
||||
* update the simulation, and set estimated encoder and gyro positions, as well as estimated
|
||||
* odometry pose. Teams can use {@link org.wpilib.smartdashboard.Field2d} to visualize
|
||||
* their robot on the Sim GUI's field.
|
||||
* odometry pose. Teams can use {@link org.wpilib.smartdashboard.Field2d} to visualize their robot
|
||||
* on the Sim GUI's field.
|
||||
*
|
||||
* <p>Our state-space system is:
|
||||
*
|
||||
@@ -90,8 +90,8 @@ 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, double, double, double, double)} or {@link
|
||||
* org.wpilib.math.system.plant.LinearSystemId#createDrivetrainVelocitySystem(DCMotor, double,
|
||||
* double, double, double, double)} or {@link
|
||||
* org.wpilib.math.system.plant.LinearSystemId#identifyDrivetrainSystem(double, double,
|
||||
* double, double)}.
|
||||
* @param driveMotor A {@link DCMotor} representing the drivetrain.
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
import org.wpilib.hardware.discrete.DigitalOutput;
|
||||
import org.wpilib.hardware.hal.simulation.DigitalPWMDataJNI;
|
||||
import org.wpilib.hardware.hal.simulation.NotifyCallback;
|
||||
import org.wpilib.hardware.discrete.DigitalOutput;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/**
|
||||
* Class to control a simulated digital PWM output.
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import org.wpilib.driverstation.DriverStation;
|
||||
import org.wpilib.hardware.hal.AllianceStationID;
|
||||
import org.wpilib.hardware.hal.DriverStationJNI;
|
||||
import org.wpilib.hardware.hal.simulation.DriverStationDataJNI;
|
||||
import org.wpilib.hardware.hal.simulation.NotifyCallback;
|
||||
import org.wpilib.util.WPIUtilJNI;
|
||||
import org.wpilib.driverstation.DriverStation;
|
||||
|
||||
/** Class to control a simulated driver station. */
|
||||
public final class DriverStationSim {
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
import org.wpilib.hardware.hal.simulation.EncoderDataJNI;
|
||||
import org.wpilib.hardware.hal.simulation.NotifyCallback;
|
||||
import org.wpilib.hardware.rotation.Encoder;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/** Class to control a simulated encoder. */
|
||||
public class EncoderSim {
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import org.wpilib.math.linalg.Matrix;
|
||||
import org.wpilib.math.util.Num;
|
||||
import org.wpilib.math.util.StateSpaceUtil;
|
||||
import org.wpilib.math.numbers.N1;
|
||||
import org.wpilib.math.system.LinearSystem;
|
||||
import org.ejml.MatrixDimensionException;
|
||||
import org.ejml.simple.SimpleMatrix;
|
||||
import org.wpilib.math.linalg.Matrix;
|
||||
import org.wpilib.math.numbers.N1;
|
||||
import org.wpilib.math.system.LinearSystem;
|
||||
import org.wpilib.math.util.Num;
|
||||
import org.wpilib.math.util.StateSpaceUtil;
|
||||
|
||||
/**
|
||||
* This class helps simulate linear systems. To use this class, do the following in the {@link
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
package org.wpilib.simulation;
|
||||
|
||||
import org.wpilib.hardware.discrete.PWM;
|
||||
import org.wpilib.hardware.hal.simulation.NotifyCallback;
|
||||
import org.wpilib.hardware.hal.simulation.PWMDataJNI;
|
||||
import org.wpilib.hardware.discrete.PWM;
|
||||
|
||||
/** Class to control a simulated PWM output. */
|
||||
public class PWMSim {
|
||||
|
||||
@@ -235,7 +235,8 @@ public class SimDeviceSim {
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a callback to be run every time a new {@link org.wpilib.hardware.hal.SimDevice} is created.
|
||||
* Register a callback to be run every time a new {@link org.wpilib.hardware.hal.SimDevice} is
|
||||
* created.
|
||||
*
|
||||
* @param prefix the prefix to filter sim devices
|
||||
* @param callback the callback
|
||||
|
||||
@@ -38,8 +38,8 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N2> {
|
||||
* Creates a simulated arm mechanism.
|
||||
*
|
||||
* @param plant The linear system that represents the arm. This system can be created with {@link
|
||||
* org.wpilib.math.system.plant.LinearSystemId#createSingleJointedArmSystem(DCMotor,
|
||||
* double, double)}.
|
||||
* org.wpilib.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 armLength The length of the arm in meters.
|
||||
|
||||
Reference in New Issue
Block a user