mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Clean up Java warning suppressions (#4433)
Checkstyle naming conventions were changed to allow most of what's in wpimath. Naming rules were disabled completely in wpimath since almost all suppressions are for math notation.
This commit is contained in:
@@ -611,7 +611,6 @@ public class ADIS16448_IMU implements AutoCloseable, NTSendable {
|
||||
m_spi.write(buf, 2);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public void reset() {
|
||||
synchronized (this) {
|
||||
m_integ_gyro_angle_x = 0.0;
|
||||
|
||||
@@ -636,7 +636,6 @@ public class ADIS16470_IMU implements AutoCloseable, NTSendable {
|
||||
m_spi.write(buf, 2);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public void reset() {
|
||||
synchronized (this) {
|
||||
m_integ_angle = 0.0;
|
||||
|
||||
@@ -49,7 +49,6 @@ public class ADXL345_I2C implements Accelerometer, NTSendable, AutoCloseable {
|
||||
kZ((byte) 0x04);
|
||||
|
||||
/** The integer value representing this enumeration. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final byte value;
|
||||
|
||||
Axes(byte value) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.nio.ByteOrder;
|
||||
* <p>This class is for the digital ADXRS450 gyro sensor that connects via SPI. Only one instance of
|
||||
* an ADXRS Gyro is supported.
|
||||
*/
|
||||
@SuppressWarnings({"TypeName", "AbbreviationAsWordInName", "PMD.UnusedPrivateField"})
|
||||
@SuppressWarnings({"TypeName", "PMD.UnusedPrivateField"})
|
||||
public class ADXRS450_Gyro implements Gyro, Sendable {
|
||||
private static final double kSamplePeriod = 0.0005;
|
||||
private static final double kCalibrationSampleTime = 5.0;
|
||||
|
||||
@@ -28,7 +28,6 @@ public class AddressableLEDBuffer {
|
||||
* @param g the g value [0-255]
|
||||
* @param b the b value [0-255]
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setRGB(int index, int r, int g, int b) {
|
||||
m_buffer[index * 4] = (byte) b;
|
||||
m_buffer[(index * 4) + 1] = (byte) g;
|
||||
@@ -44,7 +43,6 @@ public class AddressableLEDBuffer {
|
||||
* @param s the s value [0-255]
|
||||
* @param v the v value [0-255]
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setHSV(final int index, final int h, final int s, final int v) {
|
||||
if (s == 0) {
|
||||
setRGB(index, v, v, v);
|
||||
|
||||
@@ -192,7 +192,6 @@ public class Counter implements CounterBase, Sendable, AutoCloseable {
|
||||
*
|
||||
* @return the Counter's FPGA index
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public int getFPGAIndex() {
|
||||
return m_index;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,6 @@ public final class DataLogManager {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.EmptyCatchBlock")
|
||||
private static String makeLogDir(String dir) {
|
||||
if (!dir.isEmpty()) {
|
||||
return dir;
|
||||
|
||||
@@ -80,59 +80,25 @@ public final class DriverStation {
|
||||
}
|
||||
} /* DriverStationTask */
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
private static class MatchDataSender {
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTable table;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry typeMetadata;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry gameSpecificMessage;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry eventName;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry matchNumber;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry replayNumber;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry matchType;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry alliance;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry station;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
NetworkTableEntry controlWord;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
boolean oldIsRedAlliance = true;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
int oldStationNumber = 1;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
String oldEventName = "";
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
String oldGameSpecificMessage = "";
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
int oldMatchNumber;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
int oldReplayNumber;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
int oldMatchType;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
int oldControlWord;
|
||||
|
||||
MatchDataSender() {
|
||||
|
||||
@@ -100,7 +100,6 @@ public class DutyCycle implements Sendable, AutoCloseable {
|
||||
*
|
||||
* @return the FPGA index
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public final int getFPGAIndex() {
|
||||
return DutyCycleJNI.getFPGAIndex(m_handle);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,6 @@ public class DutyCycleEncoder implements Sendable, AutoCloseable {
|
||||
*
|
||||
* @return the FPGA index
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public int getFPGAIndex() {
|
||||
return m_dutyCycle.getFPGAIndex();
|
||||
}
|
||||
|
||||
@@ -282,7 +282,6 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
*
|
||||
* @return The Encoder's FPGA index.
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public int getFPGAIndex() {
|
||||
return EncoderJNI.getEncoderFPGAIndex(m_encoder);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,6 @@ public class I2C implements AutoCloseable {
|
||||
* @param receiveSize Number of bytes to read from the device.
|
||||
* @return Transfer Aborted... false for success, true for aborted.
|
||||
*/
|
||||
@SuppressWarnings("ByteBufferBackingArray")
|
||||
public synchronized boolean transaction(
|
||||
ByteBuffer dataToSend, int sendSize, ByteBuffer dataReceived, int receiveSize) {
|
||||
if (dataToSend.hasArray() && dataReceived.hasArray()) {
|
||||
@@ -211,7 +210,6 @@ public class I2C implements AutoCloseable {
|
||||
* @param size The number of data bytes to write.
|
||||
* @return Transfer Aborted... false for success, true for aborted.
|
||||
*/
|
||||
@SuppressWarnings("ByteBufferBackingArray")
|
||||
public synchronized boolean writeBulk(ByteBuffer data, int size) {
|
||||
if (data.hasArray()) {
|
||||
return writeBulk(data.array(), size);
|
||||
@@ -266,7 +264,6 @@ public class I2C implements AutoCloseable {
|
||||
* @param buffer A buffer to store the data read from the device.
|
||||
* @return Transfer Aborted... false for success, true for aborted.
|
||||
*/
|
||||
@SuppressWarnings("ByteBufferBackingArray")
|
||||
public boolean read(int registerAddress, int count, ByteBuffer buffer) {
|
||||
if (count < 1) {
|
||||
throw new BoundaryException("Value must be at least 1, " + count + " given");
|
||||
@@ -323,7 +320,6 @@ public class I2C implements AutoCloseable {
|
||||
* @param count The number of bytes to read in the transaction.
|
||||
* @return Transfer Aborted... false for success, true for aborted.
|
||||
*/
|
||||
@SuppressWarnings("ByteBufferBackingArray")
|
||||
public boolean readOnly(ByteBuffer buffer, int count) {
|
||||
if (count < 1) {
|
||||
throw new BoundaryException("Value must be at least 1, " + count + " given");
|
||||
|
||||
@@ -134,7 +134,6 @@ public abstract class IterativeRobotBase extends RobotBase {
|
||||
* <p>Users should override this method for initialization code which will be called each time the
|
||||
* robot enters test mode.
|
||||
*/
|
||||
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
|
||||
public void testInit() {}
|
||||
|
||||
/* ----------- Overridable periodic code ----------------- */
|
||||
@@ -196,7 +195,6 @@ public abstract class IterativeRobotBase extends RobotBase {
|
||||
private boolean m_tmpFirstRun = true;
|
||||
|
||||
/** Periodic code for test mode should go here. */
|
||||
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
|
||||
public void testPeriodic() {
|
||||
if (m_tmpFirstRun) {
|
||||
System.out.println("Default testPeriodic() method... Override me!");
|
||||
@@ -234,7 +232,6 @@ public abstract class IterativeRobotBase extends RobotBase {
|
||||
* <p>Users should override this method for code which will be called each time the robot exits
|
||||
* test mode.
|
||||
*/
|
||||
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
|
||||
public void testExit() {}
|
||||
|
||||
/**
|
||||
|
||||
@@ -269,27 +269,11 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
/** Ends the main loop in startCompetition(). */
|
||||
public abstract void endCompetition();
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
public static boolean getBooleanProperty(String name, boolean defaultValue) {
|
||||
String propVal = System.getProperty(name);
|
||||
if (propVal == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if ("false".equalsIgnoreCase(propVal)) {
|
||||
return false;
|
||||
} else if ("true".equalsIgnoreCase(propVal)) {
|
||||
return true;
|
||||
} else {
|
||||
throw new IllegalStateException(propVal);
|
||||
}
|
||||
}
|
||||
|
||||
private static final ReentrantLock m_runMutex = new ReentrantLock();
|
||||
private static RobotBase m_robotCopy;
|
||||
private static boolean m_suppressExitWarning;
|
||||
|
||||
/** Run the robot main loop. */
|
||||
@SuppressWarnings({"PMD.AvoidCatchingThrowable", "PMD.AvoidReassigningCatchVariables"})
|
||||
private static <T extends RobotBase> void runRobot(Supplier<T> robotSupplier) {
|
||||
System.out.println("********** Robot program starting **********");
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ public final class RobotController {
|
||||
*
|
||||
* @return FPGA Version number.
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static int getFPGAVersion() {
|
||||
return HALUtil.getFPGAVersion();
|
||||
}
|
||||
@@ -33,7 +32,6 @@ public final class RobotController {
|
||||
*
|
||||
* @return FPGA Revision number.
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static long getFPGARevision() {
|
||||
return (long) HALUtil.getFPGARevision();
|
||||
}
|
||||
|
||||
@@ -4,28 +4,57 @@
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
public final class RobotState {
|
||||
/**
|
||||
* Returns true if the robot is disabled.
|
||||
*
|
||||
* @return True if the robot is disabled.
|
||||
*/
|
||||
public static boolean isDisabled() {
|
||||
return DriverStation.isDisabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the robot is enabled.
|
||||
*
|
||||
* @return True if the robot is enabled.
|
||||
*/
|
||||
public static boolean isEnabled() {
|
||||
return DriverStation.isEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the robot is E-stopped.
|
||||
*
|
||||
* @return True if the robot is E-stopped.
|
||||
*/
|
||||
public static boolean isEStopped() {
|
||||
return DriverStation.isEStopped();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the robot is in teleop mode.
|
||||
*
|
||||
* @return True if the robot is in teleop mode.
|
||||
*/
|
||||
public static boolean isTeleop() {
|
||||
return DriverStation.isTeleop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the robot is in autonomous mode.
|
||||
*
|
||||
* @return True if the robot is in autonomous mode.
|
||||
*/
|
||||
public static boolean isAutonomous() {
|
||||
return DriverStation.isAutonomous();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the robot is in test mode.
|
||||
*
|
||||
* @return True if the robot is in test mode.
|
||||
*/
|
||||
public static boolean isTest() {
|
||||
return DriverStation.isTest();
|
||||
}
|
||||
|
||||
@@ -208,7 +208,6 @@ public class SPI implements AutoCloseable {
|
||||
* @param size The number of bytes to send.
|
||||
* @return Number of bytes written or -1 on error.
|
||||
*/
|
||||
@SuppressWarnings("ByteBufferBackingArray")
|
||||
public int write(ByteBuffer dataToSend, int size) {
|
||||
if (dataToSend.hasArray()) {
|
||||
return write(dataToSend.array(), size);
|
||||
@@ -257,7 +256,6 @@ public class SPI implements AutoCloseable {
|
||||
* @param size The length of the transaction, in bytes
|
||||
* @return Number of bytes read or -1 on error.
|
||||
*/
|
||||
@SuppressWarnings("ByteBufferBackingArray")
|
||||
public int read(boolean initiate, ByteBuffer dataReceived, int size) {
|
||||
if (dataReceived.hasArray()) {
|
||||
return read(initiate, dataReceived.array(), size);
|
||||
@@ -297,7 +295,6 @@ public class SPI implements AutoCloseable {
|
||||
* @param size The length of the transaction, in bytes
|
||||
* @return TODO
|
||||
*/
|
||||
@SuppressWarnings("ByteBufferBackingArray")
|
||||
public int transaction(ByteBuffer dataToSend, ByteBuffer dataReceived, int size) {
|
||||
if (dataToSend.hasArray() && dataReceived.hasArray()) {
|
||||
return transaction(dataToSend.array(), dataReceived.array(), size);
|
||||
|
||||
@@ -141,7 +141,6 @@ public final class SensorUtil {
|
||||
*
|
||||
* @return The number of the default solenoid module.
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static int getDefaultCTREPCMModule() {
|
||||
return 0;
|
||||
}
|
||||
@@ -151,7 +150,6 @@ public final class SensorUtil {
|
||||
*
|
||||
* @return The number of the default solenoid module.
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static int getDefaultREVPHModule() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -21,14 +21,13 @@ public class SynchronousInterrupt implements AutoCloseable {
|
||||
|
||||
private final int m_handle;
|
||||
|
||||
@SuppressWarnings("JavadocMethod")
|
||||
/** Event trigger combinations for a synchronous interrupt. */
|
||||
public enum WaitResult {
|
||||
kTimeout(0x0),
|
||||
kRisingEdge(0x1),
|
||||
kFallingEdge(0x100),
|
||||
kBoth(0x101);
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int value;
|
||||
|
||||
WaitResult(int value) {
|
||||
|
||||
@@ -101,7 +101,6 @@ public class TimedRobot extends IterativeRobotBase {
|
||||
|
||||
/** Provide an alternate "main loop" via startCompetition(). */
|
||||
@Override
|
||||
@SuppressWarnings("UnsafeFinalization")
|
||||
public void startCompetition() {
|
||||
robotInit();
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ public class Timer {
|
||||
*
|
||||
* @return Robot running time in seconds.
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static double getFPGATimestamp() {
|
||||
return RobotController.getFPGATime() / 1000000.0;
|
||||
}
|
||||
@@ -55,7 +54,7 @@ public class Timer {
|
||||
private double m_accumulatedTime;
|
||||
private boolean m_running;
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/** Timer constructor. */
|
||||
public Timer() {
|
||||
reset();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ public class Tracer {
|
||||
private long m_lastEpochsPrintTime; // microseconds
|
||||
private long m_startTime; // microseconds
|
||||
|
||||
@SuppressWarnings("PMD.UseConcurrentHashMap")
|
||||
private final Map<String, Long> m_epochs = new HashMap<>(); // microseconds
|
||||
|
||||
/** Tracer constructor. */
|
||||
|
||||
@@ -208,7 +208,6 @@ public class Watchdog implements Closeable, Comparable<Watchdog> {
|
||||
m_suppressTimeoutMessage = suppress;
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
private static void updateAlarm() {
|
||||
if (m_watchdogs.size() == 0) {
|
||||
NotifierJNI.cancelNotifierAlarm(m_notifier);
|
||||
@@ -225,7 +224,6 @@ public class Watchdog implements Closeable, Comparable<Watchdog> {
|
||||
return inst;
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.AvoidDeeplyNestedIfStmts")
|
||||
private static void schedulerFunc() {
|
||||
while (!Thread.currentThread().isInterrupted()) {
|
||||
long curTime = NotifierJNI.waitForNotifierAlarm(m_notifier);
|
||||
|
||||
@@ -30,7 +30,6 @@ public class XboxController extends GenericHID {
|
||||
kBack(7),
|
||||
kStart(8);
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int value;
|
||||
|
||||
Button(int value) {
|
||||
@@ -64,7 +63,6 @@ public class XboxController extends GenericHID {
|
||||
kLeftTrigger(2),
|
||||
kRightTrigger(3);
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int value;
|
||||
|
||||
Axis(int value) {
|
||||
|
||||
@@ -155,7 +155,6 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
|
||||
* @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
|
||||
* positive.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void arcadeDrive(double xSpeed, double zRotation) {
|
||||
arcadeDrive(xSpeed, zRotation, true);
|
||||
}
|
||||
@@ -168,7 +167,6 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
|
||||
* positive.
|
||||
* @param squareInputs If set, decreases the input sensitivity at low speeds.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void arcadeDrive(double xSpeed, double zRotation, boolean squareInputs) {
|
||||
if (!m_reported) {
|
||||
HAL.report(
|
||||
@@ -198,7 +196,6 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
|
||||
* @param allowTurnInPlace If set, overrides constant-curvature turning for turn-in-place
|
||||
* maneuvers. zRotation will control turning rate instead of curvature.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void curvatureDrive(double xSpeed, double zRotation, boolean allowTurnInPlace) {
|
||||
if (!m_reported) {
|
||||
HAL.report(
|
||||
@@ -264,7 +261,6 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
|
||||
* @param squareInputs If set, decreases the input sensitivity at low speeds.
|
||||
* @return Wheel speeds [-1.0..1.0].
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static WheelSpeeds arcadeDriveIK(double xSpeed, double zRotation, boolean squareInputs) {
|
||||
xSpeed = MathUtil.clamp(xSpeed, -1.0, 1.0);
|
||||
zRotation = MathUtil.clamp(zRotation, -1.0, 1.0);
|
||||
@@ -323,7 +319,6 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
|
||||
* maneuvers. zRotation will control rotation rate around the Z axis instead of curvature.
|
||||
* @return Wheel speeds [-1.0..1.0].
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static WheelSpeeds curvatureDriveIK(
|
||||
double xSpeed, double zRotation, boolean allowTurnInPlace) {
|
||||
xSpeed = MathUtil.clamp(xSpeed, -1.0, 1.0);
|
||||
|
||||
@@ -172,7 +172,6 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
|
||||
* @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
|
||||
* positive.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void driveCartesian(double ySpeed, double xSpeed, double zRotation) {
|
||||
driveCartesian(ySpeed, xSpeed, zRotation, 0.0);
|
||||
}
|
||||
@@ -190,7 +189,6 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
|
||||
* @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use this
|
||||
* to implement field-oriented controls.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void driveCartesian(double ySpeed, double xSpeed, double zRotation, double gyroAngle) {
|
||||
if (!m_reported) {
|
||||
HAL.report(
|
||||
@@ -221,7 +219,6 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
|
||||
* @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
|
||||
* positive.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void drivePolar(double magnitude, double angle, double zRotation) {
|
||||
if (!m_reported) {
|
||||
HAL.report(tResourceType.kResourceType_RobotDrive, tInstances.kRobotDrive2_KilloughPolar, 3);
|
||||
@@ -247,7 +244,6 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
|
||||
* positive.
|
||||
* @return Wheel speeds [-1.0..1.0].
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public WheelSpeeds driveCartesianIK(double ySpeed, double xSpeed, double zRotation) {
|
||||
return driveCartesianIK(ySpeed, xSpeed, zRotation, 0.0);
|
||||
}
|
||||
@@ -266,7 +262,6 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
|
||||
* to implement field-oriented controls.
|
||||
* @return Wheel speeds [-1.0..1.0].
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public WheelSpeeds driveCartesianIK(
|
||||
double ySpeed, double xSpeed, double zRotation, double gyroAngle) {
|
||||
ySpeed = MathUtil.clamp(ySpeed, -1.0, 1.0);
|
||||
|
||||
@@ -139,7 +139,6 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
|
||||
* positive.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void driveCartesian(double ySpeed, double xSpeed, double zRotation) {
|
||||
driveCartesian(ySpeed, xSpeed, zRotation, 0.0);
|
||||
}
|
||||
@@ -157,7 +156,6 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use this
|
||||
* to implement field-oriented controls.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void driveCartesian(double ySpeed, double xSpeed, double zRotation, double gyroAngle) {
|
||||
if (!m_reported) {
|
||||
HAL.report(
|
||||
@@ -189,7 +187,6 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
|
||||
* positive.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void drivePolar(double magnitude, double angle, double zRotation) {
|
||||
if (!m_reported) {
|
||||
HAL.report(tResourceType.kResourceType_RobotDrive, tInstances.kRobotDrive2_MecanumPolar, 4);
|
||||
@@ -215,7 +212,6 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* positive.
|
||||
* @return Wheel speeds [-1.0..1.0].
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static WheelSpeeds driveCartesianIK(double ySpeed, double xSpeed, double zRotation) {
|
||||
return driveCartesianIK(ySpeed, xSpeed, zRotation, 0.0);
|
||||
}
|
||||
@@ -234,7 +230,6 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* to implement field-oriented controls.
|
||||
* @return Wheel speeds [-1.0..1.0].
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static WheelSpeeds driveCartesianIK(
|
||||
double ySpeed, double xSpeed, double zRotation, double gyroAngle) {
|
||||
ySpeed = MathUtil.clamp(ySpeed, -1.0, 1.0);
|
||||
|
||||
@@ -5,11 +5,9 @@
|
||||
package edu.wpi.first.wpilibj.drive;
|
||||
|
||||
/** This is a 2D vector struct that supports basic vector operations. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public class Vector2d {
|
||||
@SuppressWarnings("MemberName")
|
||||
public double x;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public double y;
|
||||
|
||||
public Vector2d() {}
|
||||
|
||||
@@ -37,7 +37,6 @@ public final class SendableCameraWrapper implements Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/** Clears all cached wrapper objects. This should only be used in tests. */
|
||||
@SuppressWarnings("PMD.DefaultPackage")
|
||||
static void clearWrappers() {
|
||||
m_wrappers.clear();
|
||||
}
|
||||
@@ -73,7 +72,6 @@ public final class SendableCameraWrapper implements Sendable, AutoCloseable {
|
||||
* @return a sendable wrapper object for the video source, usable in Shuffleboard via {@link
|
||||
* ShuffleboardTab#add(Sendable)} and {@link ShuffleboardLayout#add(Sendable)}
|
||||
*/
|
||||
@SuppressWarnings("PMD.CyclomaticComplexity")
|
||||
public static SendableCameraWrapper wrap(String cameraName, String... cameraUrls) {
|
||||
if (m_wrappers.containsKey(cameraName)) {
|
||||
return m_wrappers.get(cameraName);
|
||||
|
||||
@@ -8,7 +8,7 @@ import edu.wpi.first.hal.SimDouble;
|
||||
import edu.wpi.first.wpilibj.ADIS16448_IMU;
|
||||
|
||||
/** Class to control a simulated ADIS16448 gyroscope. */
|
||||
@SuppressWarnings({"TypeName", "AbbreviationAsWordInName"})
|
||||
@SuppressWarnings("TypeName")
|
||||
public class ADIS16448_IMUSim {
|
||||
private final SimDouble m_simGyroAngleX;
|
||||
private final SimDouble m_simGyroAngleY;
|
||||
|
||||
@@ -8,7 +8,7 @@ import edu.wpi.first.hal.SimDouble;
|
||||
import edu.wpi.first.wpilibj.ADIS16470_IMU;
|
||||
|
||||
/** Class to control a simulated ADIS16470 gyroscope. */
|
||||
@SuppressWarnings({"TypeName", "AbbreviationAsWordInName"})
|
||||
@SuppressWarnings("TypeName")
|
||||
public class ADIS16470_IMUSim {
|
||||
private final SimDouble m_simGyroAngleX;
|
||||
private final SimDouble m_simGyroAngleY;
|
||||
|
||||
@@ -8,7 +8,7 @@ import edu.wpi.first.hal.SimDouble;
|
||||
import edu.wpi.first.wpilibj.ADXRS450_Gyro;
|
||||
|
||||
/** Class to control a simulated ADXRS450 gyroscope. */
|
||||
@SuppressWarnings({"TypeName", "AbbreviationAsWordInName"})
|
||||
@SuppressWarnings("TypeName")
|
||||
public class ADXRS450_GyroSim {
|
||||
private final SimDouble m_simAngle;
|
||||
private final SimDouble m_simRate;
|
||||
|
||||
@@ -116,7 +116,6 @@ public class BuiltInAccelerometerSim {
|
||||
*
|
||||
* @param x the new reading of the X axis
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setX(double x) {
|
||||
AccelerometerDataJNI.setX(m_index, x);
|
||||
}
|
||||
@@ -148,7 +147,6 @@ public class BuiltInAccelerometerSim {
|
||||
*
|
||||
* @param y the new reading of the Y axis
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setY(double y) {
|
||||
AccelerometerDataJNI.setY(m_index, y);
|
||||
}
|
||||
@@ -180,7 +178,6 @@ public class BuiltInAccelerometerSim {
|
||||
*
|
||||
* @param z the new reading of the Z axis
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setZ(double z) {
|
||||
AccelerometerDataJNI.setZ(m_index, z);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import edu.wpi.first.wpilibj.PneumaticsControlModule;
|
||||
import edu.wpi.first.wpilibj.SensorUtil;
|
||||
|
||||
/** Class to control a simulated Pneumatic Control Module (PCM). */
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class CTREPCMSim extends PneumaticsBaseSim {
|
||||
/** Constructs for the default PCM. */
|
||||
public CTREPCMSim() {
|
||||
|
||||
@@ -59,7 +59,6 @@ public class DCMotorSim extends LinearSystemSim<N2, N1, N2> {
|
||||
* @param jKgMetersSquared The moment of inertia of the DC motor. If this is unknown, use the
|
||||
* {@link #DCMotorSim(LinearSystem, DCMotor, double, Matrix)} constructor.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public DCMotorSim(DCMotor gearbox, double gearing, double jKgMetersSquared) {
|
||||
super(LinearSystemId.createDCMotorSystem(gearbox, jKgMetersSquared, gearing));
|
||||
m_gearbox = gearbox;
|
||||
@@ -75,7 +74,6 @@ public class DCMotorSim extends LinearSystemSim<N2, N1, N2> {
|
||||
* {@link #DCMotorSim(LinearSystem, DCMotor, double, Matrix)} constructor.
|
||||
* @param measurementStdDevs The standard deviations of the measurements.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public DCMotorSim(
|
||||
DCMotor gearbox, double gearing, double jKgMetersSquared, Matrix<N2, N1> measurementStdDevs) {
|
||||
super(
|
||||
|
||||
@@ -44,13 +44,8 @@ public class DifferentialDrivetrainSim {
|
||||
private double m_currentGearing;
|
||||
private final double m_wheelRadiusMeters;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
private Matrix<N2, N1> m_u;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
private Matrix<N7, N1> m_x;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
private Matrix<N7, N1> m_y;
|
||||
|
||||
private final double m_rb;
|
||||
@@ -72,7 +67,6 @@ public class DifferentialDrivetrainSim {
|
||||
* m/s, and position measurement standard deviations of 0.005 meters are a reasonable starting
|
||||
* point.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public DifferentialDrivetrainSim(
|
||||
DCMotor driveMotor,
|
||||
double gearing,
|
||||
@@ -153,7 +147,6 @@ public class DifferentialDrivetrainSim {
|
||||
*
|
||||
* @param dtSeconds the time difference
|
||||
*/
|
||||
@SuppressWarnings("LocalVariableName")
|
||||
public void update(double dtSeconds) {
|
||||
// Update state estimate with RK4
|
||||
m_x = NumericalIntegration.rk4(this::getDynamics, m_x, m_u, dtSeconds);
|
||||
@@ -316,7 +309,6 @@ public class DifferentialDrivetrainSim {
|
||||
m_x.set(State.kRightPosition.value, 0, 0);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"DuplicatedCode", "LocalVariableName", "ParameterName"})
|
||||
protected Matrix<N7, N1> getDynamics(Matrix<N7, N1> x, Matrix<N2, N1> u) {
|
||||
// Because G can be factored out of B, we can divide by the old ratio and multiply
|
||||
// by the new ratio to get a new drivetrain model.
|
||||
@@ -373,10 +365,8 @@ public class DifferentialDrivetrainSim {
|
||||
kLeftPosition(5),
|
||||
kRightPosition(6);
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int value;
|
||||
|
||||
@SuppressWarnings("ParameterName")
|
||||
State(int i) {
|
||||
this.value = i;
|
||||
}
|
||||
@@ -393,10 +383,8 @@ public class DifferentialDrivetrainSim {
|
||||
k7p31(7.31),
|
||||
k5p95(5.95);
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final double value;
|
||||
|
||||
@SuppressWarnings("ParameterName")
|
||||
KitbotGearing(double i) {
|
||||
this.value = i;
|
||||
}
|
||||
@@ -413,10 +401,8 @@ public class DifferentialDrivetrainSim {
|
||||
kSingleNEOPerSide(DCMotor.getNEO(1)),
|
||||
kDoubleNEOPerSide(DCMotor.getNEO(2));
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final DCMotor value;
|
||||
|
||||
@SuppressWarnings("ParameterName")
|
||||
KitbotMotor(DCMotor i) {
|
||||
this.value = i;
|
||||
}
|
||||
@@ -428,10 +414,8 @@ public class DifferentialDrivetrainSim {
|
||||
kEightInch(Units.inchesToMeters(8)),
|
||||
kTenInch(Units.inchesToMeters(10));
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final double value;
|
||||
|
||||
@SuppressWarnings("ParameterName")
|
||||
KitbotWheelSize(double i) {
|
||||
this.value = i;
|
||||
}
|
||||
@@ -479,7 +463,6 @@ public class DifferentialDrivetrainSim {
|
||||
* point.
|
||||
* @return A sim for the standard FRC kitbot.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static DifferentialDrivetrainSim createKitbotSim(
|
||||
KitbotMotor motor,
|
||||
KitbotGearing gearing,
|
||||
|
||||
@@ -138,7 +138,6 @@ public final class DriverStationSim {
|
||||
*
|
||||
* @param eStop true to activate
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static void setEStop(boolean eStop) {
|
||||
DriverStationDataJNI.setEStop(eStop);
|
||||
}
|
||||
|
||||
@@ -244,14 +244,13 @@ public class ElevatorSim extends LinearSystemSim<N2, N1, N1> {
|
||||
* @param u The system inputs (voltage).
|
||||
* @param dtSeconds The time difference between controller updates.
|
||||
*/
|
||||
@SuppressWarnings({"ParameterName", "LambdaParameterName"})
|
||||
@Override
|
||||
protected Matrix<N2, N1> updateX(Matrix<N2, N1> currentXhat, Matrix<N1, N1> u, double dtSeconds) {
|
||||
// Calculate updated x-hat from Runge-Kutta.
|
||||
var updatedXhat =
|
||||
NumericalIntegration.rkdp(
|
||||
(x, u_) -> {
|
||||
Matrix<N2, N1> xdot = m_plant.getA().times(x).plus(m_plant.getB().times(u_));
|
||||
(x, _u) -> {
|
||||
Matrix<N2, N1> xdot = m_plant.getA().times(x).plus(m_plant.getB().times(_u));
|
||||
if (m_simulateGravity) {
|
||||
xdot = xdot.plus(VecBuilder.fill(0, -9.8));
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ public class FlywheelSim extends LinearSystemSim<N1, N1, N1> {
|
||||
* @param jKgMetersSquared The moment of inertia of the flywheel. If this is unknown, use the
|
||||
* {@link #FlywheelSim(LinearSystem, DCMotor, double, Matrix)} constructor.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public FlywheelSim(DCMotor gearbox, double gearing, double jKgMetersSquared) {
|
||||
super(LinearSystemId.createFlywheelSystem(gearbox, jKgMetersSquared, gearing));
|
||||
m_gearbox = gearbox;
|
||||
@@ -74,7 +73,6 @@ public class FlywheelSim extends LinearSystemSim<N1, N1, N1> {
|
||||
* {@link #FlywheelSim(LinearSystem, DCMotor, double, Matrix)} constructor.
|
||||
* @param measurementStdDevs The standard deviations of the measurements.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public FlywheelSim(
|
||||
DCMotor gearbox, double gearing, double jKgMetersSquared, Matrix<N1, N1> measurementStdDevs) {
|
||||
super(
|
||||
|
||||
@@ -27,19 +27,13 @@ import org.ejml.simple.SimpleMatrix;
|
||||
* @param <Inputs> The number of inputs to the system.
|
||||
* @param <Outputs> The number of outputs of the system.
|
||||
*/
|
||||
@SuppressWarnings("ClassTypeParameterName")
|
||||
public class LinearSystemSim<States extends Num, Inputs extends Num, Outputs extends Num> {
|
||||
// The plant that represents the linear system.
|
||||
protected final LinearSystem<States, Inputs, Outputs> m_plant;
|
||||
|
||||
// Variables for state, output, and input.
|
||||
@SuppressWarnings("MemberName")
|
||||
protected Matrix<States, N1> m_x;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
protected Matrix<Outputs, N1> m_y;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
protected Matrix<Inputs, N1> m_u;
|
||||
|
||||
// The standard deviations of measurements, used for adding noise
|
||||
@@ -77,7 +71,6 @@ public class LinearSystemSim<States extends Num, Inputs extends Num, Outputs ext
|
||||
*
|
||||
* @param dtSeconds The time between updates.
|
||||
*/
|
||||
@SuppressWarnings("LocalVariableName")
|
||||
public void update(double dtSeconds) {
|
||||
// Update X. By default, this is the linear system dynamics X = Ax + Bu
|
||||
m_x = updateX(m_x, m_u, dtSeconds);
|
||||
@@ -115,7 +108,6 @@ public class LinearSystemSim<States extends Num, Inputs extends Num, Outputs ext
|
||||
*
|
||||
* @param u The system inputs.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setInput(Matrix<Inputs, N1> u) {
|
||||
this.m_u = clampInput(u);
|
||||
}
|
||||
@@ -136,7 +128,6 @@ public class LinearSystemSim<States extends Num, Inputs extends Num, Outputs ext
|
||||
*
|
||||
* @param u An array of doubles that represent the inputs of the system.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setInput(double... u) {
|
||||
if (u.length != m_u.getNumRows()) {
|
||||
throw new MatrixDimensionException(
|
||||
@@ -172,7 +163,6 @@ public class LinearSystemSim<States extends Num, Inputs extends Num, Outputs ext
|
||||
* @param dtSeconds The time difference between controller updates.
|
||||
* @return The new state.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
protected Matrix<States, N1> updateX(
|
||||
Matrix<States, N1> currentXhat, Matrix<Inputs, N1> u, double dtSeconds) {
|
||||
return m_plant.calculateX(currentXhat, u, dtSeconds);
|
||||
|
||||
@@ -10,7 +10,6 @@ import edu.wpi.first.wpilibj.PneumaticHub;
|
||||
import edu.wpi.first.wpilibj.SensorUtil;
|
||||
|
||||
/** Class to control a simulated PneumaticHub (PH). */
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class REVPHSim extends PneumaticsBaseSim {
|
||||
/** Constructs for the default PH. */
|
||||
public REVPHSim() {
|
||||
|
||||
@@ -21,7 +21,6 @@ public final class RoboRioSim {
|
||||
* @return the {@link CallbackStore} object associated with this callback. Save a reference to
|
||||
* this object so GC doesn't cancel the callback.
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static CallbackStore registerFPGAButtonCallback(
|
||||
NotifyCallback callback, boolean initialNotify) {
|
||||
int uid = RoboRioDataJNI.registerFPGAButtonCallback(callback, initialNotify);
|
||||
@@ -33,7 +32,6 @@ public final class RoboRioSim {
|
||||
*
|
||||
* @return the FPGA button state
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static boolean getFPGAButton() {
|
||||
return RoboRioDataJNI.getFPGAButton();
|
||||
}
|
||||
@@ -43,7 +41,6 @@ public final class RoboRioSim {
|
||||
*
|
||||
* @param fpgaButton the new state
|
||||
*/
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static void setFPGAButton(boolean fpgaButton) {
|
||||
RoboRioDataJNI.setFPGAButton(fpgaButton);
|
||||
}
|
||||
@@ -76,7 +73,6 @@ public final class RoboRioSim {
|
||||
*
|
||||
* @param vInVoltage the new voltage
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static void setVInVoltage(double vInVoltage) {
|
||||
RoboRioDataJNI.setVInVoltage(vInVoltage);
|
||||
}
|
||||
@@ -109,7 +105,6 @@ public final class RoboRioSim {
|
||||
*
|
||||
* @param vInCurrent the new current
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static void setVInCurrent(double vInCurrent) {
|
||||
RoboRioDataJNI.setVInCurrent(vInCurrent);
|
||||
}
|
||||
@@ -526,7 +521,6 @@ public final class RoboRioSim {
|
||||
*
|
||||
* @param vInVoltage the new voltage
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static void setBrownoutVoltage(double vInVoltage) {
|
||||
RoboRioDataJNI.setBrownoutVoltage(vInVoltage);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ public class SPIAccelerometerSim {
|
||||
*
|
||||
* @param x the new reading of the X axis
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setX(double x) {
|
||||
SPIAccelerometerDataJNI.setX(m_index, x);
|
||||
}
|
||||
@@ -141,7 +140,6 @@ public class SPIAccelerometerSim {
|
||||
*
|
||||
* @param y the new reading of the Y axis
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setY(double y) {
|
||||
SPIAccelerometerDataJNI.setY(m_index, y);
|
||||
}
|
||||
@@ -173,7 +171,6 @@ public class SPIAccelerometerSim {
|
||||
*
|
||||
* @param z the new reading of the Z axis
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public void setZ(double z) {
|
||||
SPIAccelerometerDataJNI.setZ(m_index, z);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
|
||||
private final double m_gearing;
|
||||
|
||||
// The length of the arm.
|
||||
@SuppressWarnings("MemberName")
|
||||
private final double m_r;
|
||||
|
||||
// The minimum angle that the arm is capable of.
|
||||
@@ -115,7 +114,6 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
|
||||
* @param armMassKg The mass of the arm.
|
||||
* @param simulateGravity Whether gravity should be simulated or not.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public SingleJointedArmSim(
|
||||
DCMotor gearbox,
|
||||
double gearing,
|
||||
@@ -150,7 +148,6 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
|
||||
* @param simulateGravity Whether gravity should be simulated or not.
|
||||
* @param measurementStdDevs The standard deviations of the measurements.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public SingleJointedArmSim(
|
||||
DCMotor gearbox,
|
||||
double gearing,
|
||||
@@ -270,7 +267,6 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
|
||||
* @param dtSeconds The time difference between controller updates.
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings({"ParameterName", "LambdaParameterName"})
|
||||
protected Matrix<N2, N1> updateX(Matrix<N2, N1> currentXhat, Matrix<N1, N1> u, double dtSeconds) {
|
||||
// Horizontal case:
|
||||
// Torque = F * r = I * alpha
|
||||
@@ -283,8 +279,8 @@ public class SingleJointedArmSim extends LinearSystemSim<N2, N1, N1> {
|
||||
// cos(theta)]]
|
||||
Matrix<N2, N1> updatedXhat =
|
||||
NumericalIntegration.rkdp(
|
||||
(Matrix<N2, N1> x, Matrix<N1, N1> u_) -> {
|
||||
Matrix<N2, N1> xdot = m_plant.getA().times(x).plus(m_plant.getB().times(u_));
|
||||
(Matrix<N2, N1> x, Matrix<N1, N1> _u) -> {
|
||||
Matrix<N2, N1> xdot = m_plant.getA().times(x).plus(m_plant.getB().times(_u));
|
||||
if (m_simulateGravity) {
|
||||
xdot =
|
||||
xdot.plus(
|
||||
|
||||
@@ -54,7 +54,6 @@ public class Field2d implements NTSendable {
|
||||
* @param yMeters Y location, in meters
|
||||
* @param rotation rotation
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public synchronized void setRobotPose(double xMeters, double yMeters, Rotation2d rotation) {
|
||||
m_objects.get(0).setPose(xMeters, yMeters, rotation);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ public class FieldObject2d {
|
||||
* @param yMeters Y location, in meters
|
||||
* @param rotation rotation
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public synchronized void setPose(double xMeters, double yMeters, Rotation2d rotation) {
|
||||
setPose(new Pose2d(xMeters, yMeters, rotation));
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class Color {
|
||||
* @param v The v value [0-255]
|
||||
* @return The color
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public static Color fromHSV(int h, int s, int v) {
|
||||
if (s == 0) {
|
||||
return new Color(v / 255.0, v / 255.0, v / 255.0);
|
||||
|
||||
Reference in New Issue
Block a user