mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +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:
@@ -33,12 +33,10 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
* Singleton class for creating and keeping camera servers. Also publishes camera information to
|
||||
* NetworkTables.
|
||||
*/
|
||||
@SuppressWarnings("PMD.UnusedPrivateField")
|
||||
public final class CameraServer {
|
||||
public static final int kBasePort = 1181;
|
||||
|
||||
private static final String kPublishName = "/CameraPublisher";
|
||||
private static CameraServer server;
|
||||
|
||||
private static final AtomicInteger m_defaultUsbDevice = new AtomicInteger();
|
||||
private static String m_primarySourceName;
|
||||
@@ -63,6 +61,7 @@ public final class CameraServer {
|
||||
// - "PropertyInfo/{Property}" - Property supporting information
|
||||
|
||||
// Listener for video events
|
||||
@SuppressWarnings("PMD.UnusedPrivateField")
|
||||
private static final VideoListener m_videoListener =
|
||||
new VideoListener(
|
||||
event -> {
|
||||
@@ -185,6 +184,7 @@ public final class CameraServer {
|
||||
0x4fff,
|
||||
true);
|
||||
|
||||
@SuppressWarnings("PMD.UnusedPrivateField")
|
||||
private static final int m_tableListener =
|
||||
NetworkTableInstance.getDefault()
|
||||
.addEntryListener(
|
||||
@@ -243,10 +243,15 @@ public final class CameraServer {
|
||||
}
|
||||
},
|
||||
EntryListenerFlags.kImmediate | EntryListenerFlags.kUpdate);
|
||||
|
||||
private static int m_nextPort = kBasePort;
|
||||
private static String[] m_addresses = new String[0];
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Return URI of source with the given index.
|
||||
*
|
||||
* @param source Source index.
|
||||
*/
|
||||
private static String makeSourceValue(int source) {
|
||||
switch (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))) {
|
||||
case kUsb:
|
||||
@@ -267,12 +272,21 @@ public final class CameraServer {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Return URI of stream with the given address and port.
|
||||
*
|
||||
* @param address Stream IP address.
|
||||
* @param port Stream remote port.
|
||||
*/
|
||||
private static String makeStreamValue(String address, int port) {
|
||||
return "mjpg:http://" + address + ":" + port + "/?action=stream";
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Return URI of sink stream with the given index.
|
||||
*
|
||||
* @param sink Sink index.
|
||||
*/
|
||||
private static synchronized String[] getSinkStreamValues(int sink) {
|
||||
// Ignore all but MjpegServer
|
||||
if (VideoSink.getKindFromInt(CameraServerJNI.getSinkKind(sink)) != VideoSink.Kind.kMjpeg) {
|
||||
@@ -302,7 +316,11 @@ public final class CameraServer {
|
||||
return values.toArray(new String[0]);
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Return list of stream source URIs for the given source index.
|
||||
*
|
||||
* @param source Source index.
|
||||
*/
|
||||
private static synchronized String[] getSourceStreamValues(int source) {
|
||||
// Ignore all but HttpCamera
|
||||
if (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))
|
||||
@@ -337,7 +355,7 @@ public final class CameraServer {
|
||||
return values;
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/** Update list of stream URIs. */
|
||||
private static synchronized void updateStreamValues() {
|
||||
// Over all the sinks...
|
||||
for (VideoSink i : m_sinks.values()) {
|
||||
@@ -383,7 +401,7 @@ public final class CameraServer {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/** Provide string description of pixel format. */
|
||||
private static String pixelFormatToString(PixelFormat pixelFormat) {
|
||||
switch (pixelFormat) {
|
||||
case kMJPEG:
|
||||
@@ -401,9 +419,11 @@ public final class CameraServer {
|
||||
}
|
||||
}
|
||||
|
||||
/// Provide string description of video mode.
|
||||
/// The returned string is "{width}x{height} {format} {fps} fps".
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Provide string description of video mode.
|
||||
*
|
||||
* <p>The returned string is "{width}x{height} {format} {fps} fps".
|
||||
*/
|
||||
private static String videoModeToString(VideoMode mode) {
|
||||
return mode.width
|
||||
+ "x"
|
||||
@@ -415,7 +435,11 @@ public final class CameraServer {
|
||||
+ " fps";
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Get list of video modes for the given source handle.
|
||||
*
|
||||
* @param sourceHandle Source handle.
|
||||
*/
|
||||
private static String[] getSourceModeValues(int sourceHandle) {
|
||||
VideoMode[] modes = CameraServerJNI.enumerateSourceVideoModes(sourceHandle);
|
||||
String[] modeStrings = new String[modes.length];
|
||||
@@ -425,7 +449,13 @@ public final class CameraServer {
|
||||
return modeStrings;
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Publish a source property value to NetworkTables.
|
||||
*
|
||||
* @param table NetworkTable to which to push value.
|
||||
* @param event Video event.
|
||||
* @param isNew Whether the property value hasn't been pushed to NetworkTables before.
|
||||
*/
|
||||
private static void putSourcePropertyValue(NetworkTable table, VideoEvent event, boolean isNew) {
|
||||
String name;
|
||||
String infoName;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
package edu.wpi.first.cscore;
|
||||
|
||||
/** USB camera information. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public class UsbCameraInfo {
|
||||
/**
|
||||
* Create a new set of UsbCameraInfo.
|
||||
@@ -28,26 +29,20 @@ public class UsbCameraInfo {
|
||||
}
|
||||
|
||||
/** Device number (e.g. N in '/dev/videoN' on Linux). */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int dev;
|
||||
|
||||
/** Path to device if available (e.g. '/dev/video0' on Linux). */
|
||||
@SuppressWarnings("MemberName")
|
||||
public String path;
|
||||
|
||||
/** Vendor/model name of the camera as provided by the USB driver. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public String name;
|
||||
|
||||
/** Other path aliases to device (e.g. '/dev/v4l/by-id/...' etc on Linux). */
|
||||
@SuppressWarnings("MemberName")
|
||||
public String[] otherPaths;
|
||||
|
||||
/** USB vendor id. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int vendorId;
|
||||
|
||||
/** USB product id. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int productId;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
package edu.wpi.first.cscore;
|
||||
|
||||
/** Video event. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public class VideoEvent {
|
||||
public enum Kind {
|
||||
kUnknown(0x0000),
|
||||
@@ -117,39 +118,29 @@ public class VideoEvent {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public Kind kind;
|
||||
|
||||
// Valid for kSource* and kSink* respectively
|
||||
@SuppressWarnings("MemberName")
|
||||
public int sourceHandle;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public int sinkHandle;
|
||||
|
||||
// Source/sink/property name
|
||||
@SuppressWarnings("MemberName")
|
||||
public String name;
|
||||
|
||||
// Fields for kSourceVideoModeChanged event
|
||||
@SuppressWarnings("MemberName")
|
||||
public VideoMode mode;
|
||||
|
||||
// Fields for kSourceProperty* events
|
||||
@SuppressWarnings("MemberName")
|
||||
public int propertyHandle;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public VideoProperty.Kind propertyKind;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public int value;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public String valueStr;
|
||||
|
||||
// Listener that was triggered
|
||||
@SuppressWarnings("MemberName")
|
||||
public int listener;
|
||||
|
||||
public VideoSource getSource() {
|
||||
|
||||
@@ -64,7 +64,6 @@ public class VideoListener implements AutoCloseable {
|
||||
private static boolean s_waitQueue;
|
||||
private static final Condition s_waitQueueCond = s_lock.newCondition();
|
||||
|
||||
@SuppressWarnings("PMD.AvoidCatchingThrowable")
|
||||
private static void startThread() {
|
||||
s_thread =
|
||||
new Thread(
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
package edu.wpi.first.cscore;
|
||||
|
||||
/** Video mode. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public class VideoMode {
|
||||
public enum PixelFormat {
|
||||
kUnknown(0),
|
||||
@@ -62,18 +63,14 @@ public class VideoMode {
|
||||
}
|
||||
|
||||
/** Pixel format. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public PixelFormat pixelFormat;
|
||||
|
||||
/** Width in pixels. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int width;
|
||||
|
||||
/** Height in pixels. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int height;
|
||||
|
||||
/** Frames per second. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int fps;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ package edu.wpi.first.hal;
|
||||
/**
|
||||
* JNI wrapper for library <b>FRC_NetworkCommunication</b><br>.
|
||||
*/
|
||||
@SuppressWarnings({"MethodName", "LineLength"})
|
||||
public class FRCNetComm {
|
||||
/**
|
||||
* Resource type from UsageReporting.
|
||||
|
||||
@@ -5,12 +5,11 @@
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
/** Structure for holding the values stored in an accumulator. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public class AccumulatorResult {
|
||||
/** The total value accumulated. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public long value;
|
||||
/** The number of sample value was accumulated over. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public long count;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class AddressableLEDJNI extends JNIWrapper {
|
||||
public static native int initialize(int pwmHandle);
|
||||
|
||||
|
||||
@@ -111,6 +111,5 @@ public class AnalogJNI extends JNIWrapper {
|
||||
|
||||
public static native boolean getAnalogTriggerOutput(int analogTriggerHandle, int type);
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static native int getAnalogTriggerFPGAIndex(int analogTriggerHandle);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class CANAPIJNI extends JNIWrapper {
|
||||
public static native int initializeCAN(int manufacturer, int deviceId, int deviceType);
|
||||
|
||||
|
||||
@@ -4,14 +4,10 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public class CANData {
|
||||
@SuppressWarnings("MemberName")
|
||||
public final byte[] data = new byte[8];
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public int length;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public long timestamp;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class CTREPCMJNI extends JNIWrapper {
|
||||
public static native int initialize(int module);
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class DIOJNI extends JNIWrapper {
|
||||
public static native int initializeDIOPort(int halPortHandle, boolean input);
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class DMAJNI extends JNIWrapper {
|
||||
public static native int initialize();
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ package edu.wpi.first.hal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class DMAJNISample {
|
||||
private static final int kEnable_Accumulator0 = 8;
|
||||
private static final int kEnable_Accumulator1 = 9;
|
||||
|
||||
@@ -17,6 +17,5 @@ public class DutyCycleJNI extends JNIWrapper {
|
||||
|
||||
public static native int getOutputScaleFactor(int handle);
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static native int getFPGAIndex(int handle);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class EncoderJNI extends JNIWrapper {
|
||||
public static native void setEncoderIndexSource(
|
||||
int encoderHandle, int digitalSourceHandle, int analogTriggerType, int indexingType);
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static native int getEncoderFPGAIndex(int encoderHandle);
|
||||
|
||||
public static native int getEncoderEncodingScale(int encoderHandle);
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.util.List;
|
||||
* JNI Wrapper for HAL<br>
|
||||
* .
|
||||
*/
|
||||
@SuppressWarnings({"AbbreviationAsWordInName", "MethodName"})
|
||||
public final class HAL extends JNIWrapper {
|
||||
public static native void waitForDSData();
|
||||
|
||||
@@ -153,7 +152,11 @@ public final class HAL extends JNIWrapper {
|
||||
|
||||
public static native int nativeGetControlWord();
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Get the current DriverStation control word.
|
||||
*
|
||||
* @param controlWord Storage for control word.
|
||||
*/
|
||||
public static void getControlWord(ControlWord controlWord) {
|
||||
int word = nativeGetControlWord();
|
||||
controlWord.update(
|
||||
@@ -167,7 +170,11 @@ public final class HAL extends JNIWrapper {
|
||||
|
||||
private static native int nativeGetAllianceStation();
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Get the alliance station.
|
||||
*
|
||||
* @return The alliance station.
|
||||
*/
|
||||
public static AllianceStationID getAllianceStation() {
|
||||
switch (nativeGetAllianceStation()) {
|
||||
case 0:
|
||||
@@ -187,13 +194,10 @@ public final class HAL extends JNIWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
public static native boolean isNewControlData();
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
public static native void releaseDSMutex();
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
public static native boolean waitForDSDataTimeout(double timeout);
|
||||
|
||||
public static final int kMaxJoystickAxes = 12;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public final class HALUtil extends JNIWrapper {
|
||||
public static final int NULL_PARAMETER = -1005;
|
||||
public static final int SAMPLE_RATE_TOO_HIGH = 1001;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public final class HALValue {
|
||||
public static final int kUnassigned = 0;
|
||||
public static final int kBoolean = 0x01;
|
||||
|
||||
@@ -6,7 +6,6 @@ package edu.wpi.first.hal;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class I2CJNI extends JNIWrapper {
|
||||
public static native void i2CInitialize(int port);
|
||||
|
||||
|
||||
@@ -5,25 +5,21 @@
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
/** Structure for holding the match info data request. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public class MatchInfoData {
|
||||
/** Stores the event name. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public String eventName = "";
|
||||
|
||||
/** Stores the game specific message. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public String gameSpecificMessage = "";
|
||||
|
||||
/** Stores the match number. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int matchNumber;
|
||||
|
||||
/** Stores the replay number. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int replayNumber;
|
||||
|
||||
/** Stores the match type. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int matchType;
|
||||
|
||||
/**
|
||||
@@ -35,7 +31,6 @@ public class MatchInfoData {
|
||||
* @param replayNumber Replay number.
|
||||
* @param matchType Match type.
|
||||
*/
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
public void setData(
|
||||
String eventName,
|
||||
String gameSpecificMessage,
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
/** Structure for holding the config data result for PWM. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public class PWMConfigDataResult {
|
||||
PWMConfigDataResult(int max, int deadbandMax, int center, int deadbandMin, int min) {
|
||||
this.max = max;
|
||||
@@ -15,22 +16,17 @@ public class PWMConfigDataResult {
|
||||
}
|
||||
|
||||
/** The maximum PWM value. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int max;
|
||||
|
||||
/** The deadband maximum PWM value. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int deadbandMax;
|
||||
|
||||
/** The center PWM value. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int center;
|
||||
|
||||
/** The deadband minimum PWM value. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int deadbandMin;
|
||||
|
||||
/** The minimum PWM value. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int min;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class PWMJNI extends DIOJNI {
|
||||
public static native int initializePWMPort(int halPortHandle);
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class PortsJNI extends JNIWrapper {
|
||||
public static native int getNumAccumulators();
|
||||
|
||||
|
||||
@@ -4,86 +4,60 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public class PowerDistributionFaults {
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel0BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel1BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel2BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel3BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel4BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel5BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel6BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel7BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel8BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel9BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel10BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel11BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel12BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel13BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel14BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel15BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel16BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel17BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel18BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel19BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel20BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel21BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel22BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel23BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Brownout;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CanWarning;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean HardwareFault;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class PowerDistributionJNI extends JNIWrapper {
|
||||
public static final int AUTOMATIC_TYPE = 0;
|
||||
public static final int CTRE_TYPE = 1;
|
||||
|
||||
@@ -4,89 +4,62 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public class PowerDistributionStickyFaults {
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel0BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel1BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel2BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel3BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel4BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel5BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel6BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel7BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel8BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel9BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel10BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel11BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel12BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel13BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel14BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel15BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel16BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel17BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel18BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel19BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel20BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel21BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel22BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel23BreakerFault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Brownout;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CanWarning;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CanBusOff;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean HasReset;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,23 +4,18 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public class PowerDistributionVersion {
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int firmwareMajor;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int firmwareMinor;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int firmwareFix;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int hardwareMinor;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int hardwareMajor;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int uniqueId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,72 +4,50 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
@SuppressWarnings("MemberName")
|
||||
public class REVPHFaults {
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel0Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel1Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel2Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel3Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel4Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel5Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel6Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel7Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel8Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel9Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel10Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel11Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel12Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel13Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel14Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Channel15Fault;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CompressorOverCurrent;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CompressorOpen;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean SolenoidOverCurrent;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Brownout;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CanWarning;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean HardwareFault;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class REVPHJNI extends JNIWrapper {
|
||||
public static final int COMPRESSOR_CONFIG_TYPE_DISABLED = 0;
|
||||
public static final int COMPRESSOR_CONFIG_TYPE_DIGITAL = 1;
|
||||
|
||||
@@ -4,27 +4,20 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
@SuppressWarnings("MemberName")
|
||||
public class REVPHStickyFaults {
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CompressorOverCurrent;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CompressorOpen;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean SolenoidOverCurrent;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean Brownout;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CanWarning;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean CanBusOff;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean HasReset;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,24 +4,18 @@
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
@SuppressWarnings("MemberName")
|
||||
public class REVPHVersion {
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int firmwareMajor;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int firmwareMinor;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int firmwareFix;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int hardwareMinor;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int hardwareMajor;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int uniqueId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,6 @@ package edu.wpi.first.hal;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class SPIJNI extends JNIWrapper {
|
||||
public static final int INVALID_PORT = -1;
|
||||
public static final int ONBOARD_CS0_PORT = 0;
|
||||
|
||||
@@ -8,7 +8,7 @@ import edu.wpi.first.hal.JNIWrapper;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CANJNI extends JNIWrapper {
|
||||
public static final int CAN_SEND_PERIOD_NO_REPEAT = 0;
|
||||
public static final int CAN_SEND_PERIOD_STOP_REPEATING = -1;
|
||||
@@ -17,14 +17,11 @@ public class CANJNI extends JNIWrapper {
|
||||
public static final int CAN_IS_FRAME_REMOTE = 0x80000000;
|
||||
public static final int CAN_IS_FRAME_11BIT = 0x40000000;
|
||||
|
||||
@SuppressWarnings("MethodName")
|
||||
public static native void FRCNetCommCANSessionMuxSendMessage(
|
||||
int messageID, byte[] data, int periodMs);
|
||||
|
||||
@SuppressWarnings("MethodName")
|
||||
public static native byte[] FRCNetCommCANSessionMuxReceiveMessage(
|
||||
IntBuffer messageID, int messageIDMask, ByteBuffer timeStamp);
|
||||
|
||||
@SuppressWarnings("MethodName")
|
||||
public static native void getCANStatus(CANStatus status);
|
||||
}
|
||||
|
||||
@@ -5,28 +5,32 @@
|
||||
package edu.wpi.first.hal.can;
|
||||
|
||||
/** Structure for holding the result of a CAN Status request. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public class CANStatus {
|
||||
/** The utilization of the CAN Bus. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public double percentBusUtilization;
|
||||
|
||||
/** The CAN Bus off count. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int busOffCount;
|
||||
|
||||
/** The CAN Bus TX full count. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int txFullCount;
|
||||
|
||||
/** The CAN Bus receive error count. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int receiveErrorCount;
|
||||
|
||||
/** The CAN Bus transmit error count. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int transmitErrorCount;
|
||||
|
||||
@SuppressWarnings("MissingJavadocMethod")
|
||||
/**
|
||||
* Set CAN bus status.
|
||||
*
|
||||
* @param percentBusUtilization CAN bus utilization as a percent.
|
||||
* @param busOffCount Bus off event count.
|
||||
* @param txFullCount TX buffer full event count.
|
||||
* @param receiveErrorCount Receive error event count.
|
||||
* @param transmitErrorCount Transmit error event count.
|
||||
*/
|
||||
public void setStatus(
|
||||
double percentBusUtilization,
|
||||
int busOffCount,
|
||||
|
||||
@@ -6,7 +6,6 @@ package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class CTREPCMDataJNI extends JNIWrapper {
|
||||
public static native int registerInitializedCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
@@ -6,7 +6,6 @@ package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class REVPHDataJNI extends JNIWrapper {
|
||||
public static native int registerInitializedCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
@@ -7,17 +7,13 @@ package edu.wpi.first.hal.simulation;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class RoboRioDataJNI extends JNIWrapper {
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static native int registerFPGAButtonCallback(
|
||||
NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static native void cancelFPGAButtonCallback(int uid);
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static native boolean getFPGAButton();
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static native void setFPGAButton(boolean fPGAButton);
|
||||
|
||||
public static native int registerVInVoltageCallback(
|
||||
|
||||
@@ -28,18 +28,21 @@ public class SimDeviceDataJNI extends JNIWrapper {
|
||||
|
||||
public static native int getSimValueDeviceHandle(int handle);
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public static class SimDeviceInfo {
|
||||
@SuppressWarnings("JavadocMethod")
|
||||
public String name;
|
||||
public int handle;
|
||||
|
||||
/**
|
||||
* SimDeviceInfo constructor.
|
||||
*
|
||||
* @param name SimDevice name.
|
||||
* @param handle SimDevice handle.
|
||||
*/
|
||||
public SimDeviceInfo(String name, int handle) {
|
||||
this.name = name;
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public String name;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public int handle;
|
||||
}
|
||||
|
||||
public static native SimDeviceInfo[] enumerateSimDevices(String prefix);
|
||||
@@ -70,8 +73,23 @@ public class SimDeviceDataJNI extends JNIWrapper {
|
||||
|
||||
public static native int getSimValueHandle(int device, String name);
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public static class SimValueInfo {
|
||||
@SuppressWarnings("JavadocMethod")
|
||||
public String name;
|
||||
public int handle;
|
||||
public int direction;
|
||||
public HALValue value;
|
||||
|
||||
/**
|
||||
* SimValueInfo constructor.
|
||||
*
|
||||
* @param name SimValue name.
|
||||
* @param handle SimValue handle.
|
||||
* @param direction SimValue direction.
|
||||
* @param type SimValue type.
|
||||
* @param value1 Value 1.
|
||||
* @param value2 Value 2.
|
||||
*/
|
||||
public SimValueInfo(
|
||||
String name, int handle, int direction, int type, long value1, double value2) {
|
||||
this.name = name;
|
||||
@@ -79,18 +97,6 @@ public class SimDeviceDataJNI extends JNIWrapper {
|
||||
this.direction = direction;
|
||||
this.value = HALValue.fromNative(type, value1, value2);
|
||||
}
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public String name;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public int handle;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public int direction;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public HALValue value;
|
||||
}
|
||||
|
||||
public static native SimValueInfo[] enumerateSimValues(int device);
|
||||
|
||||
@@ -6,7 +6,6 @@ package frc.robot;
|
||||
|
||||
import edu.wpi.first.wpilibj.TimedRobot;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class MyRobot extends TimedRobot {
|
||||
/**
|
||||
* This function is run when the robot is first started up and should be used for any
|
||||
@@ -15,27 +14,27 @@ public class MyRobot extends TimedRobot {
|
||||
@Override
|
||||
public void robotInit() {}
|
||||
|
||||
/** This function is run once each time the robot enters autonomous mode */
|
||||
/** This function is run once each time the robot enters autonomous mode. */
|
||||
@Override
|
||||
public void autonomousInit() {}
|
||||
|
||||
/** This function is called periodically during autonomous */
|
||||
/** This function is called periodically during autonomous. */
|
||||
@Override
|
||||
public void autonomousPeriodic() {}
|
||||
|
||||
/** This function is called once each time the robot enters tele-operated mode */
|
||||
/** This function is called once each time the robot enters tele-operated mode. */
|
||||
@Override
|
||||
public void teleopInit() {}
|
||||
|
||||
/** This function is called periodically during operator control */
|
||||
/** This function is called periodically during operator control. */
|
||||
@Override
|
||||
public void teleopPeriodic() {}
|
||||
|
||||
/** This function is called periodically during test mode */
|
||||
/** This function is called periodically during test mode. */
|
||||
@Override
|
||||
public void testPeriodic() {}
|
||||
|
||||
/** This function is called periodically during all modes */
|
||||
/** This function is called periodically during all modes. */
|
||||
@Override
|
||||
public void robotPeriodic() {}
|
||||
}
|
||||
|
||||
@@ -5,34 +5,30 @@
|
||||
package edu.wpi.first.networktables;
|
||||
|
||||
/** NetworkTables Connection information. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final class ConnectionInfo {
|
||||
/**
|
||||
* The remote identifier (as set on the remote node by {@link
|
||||
* NetworkTableInstance#setNetworkIdentity(String)}).
|
||||
*/
|
||||
@SuppressWarnings("MemberName")
|
||||
public final String remote_id;
|
||||
|
||||
/** The IP address of the remote node. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final String remote_ip;
|
||||
|
||||
/** The port number of the remote node. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int remote_port;
|
||||
|
||||
/**
|
||||
* The last time any update was received from the remote node (same scale as returned by {@link
|
||||
* NetworkTablesJNI#now()}).
|
||||
*/
|
||||
@SuppressWarnings("MemberName")
|
||||
public final long last_update;
|
||||
|
||||
/**
|
||||
* The protocol version being used for this connection. This is in protocol layer format, so
|
||||
* 0x0200 = 2.0, 0x0300 = 3.0).
|
||||
*/
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int protocol_version;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,17 +5,15 @@
|
||||
package edu.wpi.first.networktables;
|
||||
|
||||
/** NetworkTables Connection notification. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final class ConnectionNotification {
|
||||
/** Listener that was triggered. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int listener;
|
||||
|
||||
/** True if event is due to connection being established. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final boolean connected;
|
||||
|
||||
/** Connection information. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final ConnectionInfo conn;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,25 +5,21 @@
|
||||
package edu.wpi.first.networktables;
|
||||
|
||||
/** NetworkTables Entry information. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final class EntryInfo {
|
||||
/** Entry handle. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int entry;
|
||||
|
||||
/** Entry name. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final String name;
|
||||
|
||||
/** Entry type. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final NetworkTableType type;
|
||||
|
||||
/** Entry flags. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int flags;
|
||||
|
||||
/** Timestamp of last change to entry (type or value). */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final long last_change;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,27 +5,23 @@
|
||||
package edu.wpi.first.networktables;
|
||||
|
||||
/** NetworkTables Entry notification. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final class EntryNotification {
|
||||
/** Listener that was triggered. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int listener;
|
||||
|
||||
/** Entry handle. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int entry;
|
||||
|
||||
/** Entry name. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final String name;
|
||||
|
||||
/** The new value. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final NetworkTableValue value;
|
||||
|
||||
/**
|
||||
* Update flags. For example, {@link EntryListenerFlags#kNew} if the key did not previously exist.
|
||||
*/
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int flags;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
package edu.wpi.first.networktables;
|
||||
|
||||
/** NetworkTables log message. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final class LogMessage {
|
||||
/** Logging levels. */
|
||||
public static final int kCritical = 50;
|
||||
@@ -19,23 +20,18 @@ public final class LogMessage {
|
||||
public static final int kDebug4 = 6;
|
||||
|
||||
/** The logger that generated the message. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int logger;
|
||||
|
||||
/** Log level of the message. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int level;
|
||||
|
||||
/** The filename of the source file that generated the message. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final String filename;
|
||||
|
||||
/** The line number in the source file that generated the message. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int line;
|
||||
|
||||
/** The message. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final String message;
|
||||
|
||||
/**
|
||||
|
||||
@@ -207,7 +207,6 @@ public final class NetworkTableInstance implements AutoCloseable {
|
||||
private boolean m_entryListenerWaitQueue;
|
||||
private final Condition m_entryListenerWaitQueueCond = m_entryListenerLock.newCondition();
|
||||
|
||||
@SuppressWarnings("PMD.AvoidCatchingThrowable")
|
||||
private void startEntryListenerThread() {
|
||||
var entryListenerThread =
|
||||
new Thread(
|
||||
@@ -375,7 +374,6 @@ public final class NetworkTableInstance implements AutoCloseable {
|
||||
private final Condition m_connectionListenerWaitQueueCond =
|
||||
m_connectionListenerLock.newCondition();
|
||||
|
||||
@SuppressWarnings("PMD.AvoidCatchingThrowable")
|
||||
private void startConnectionListenerThread() {
|
||||
var connectionListenerThread =
|
||||
new Thread(
|
||||
@@ -524,7 +522,6 @@ public final class NetworkTableInstance implements AutoCloseable {
|
||||
private boolean m_rpcCallWaitQueue;
|
||||
private final Condition m_rpcCallWaitQueueCond = m_rpcCallLock.newCondition();
|
||||
|
||||
@SuppressWarnings("PMD.AvoidCatchingThrowable")
|
||||
private void startRpcCallThread() {
|
||||
var rpcCallThread =
|
||||
new Thread(
|
||||
@@ -1048,7 +1045,6 @@ public final class NetworkTableInstance implements AutoCloseable {
|
||||
private boolean m_loggerWaitQueue;
|
||||
private final Condition m_loggerWaitQueueCond = m_loggerLock.newCondition();
|
||||
|
||||
@SuppressWarnings("PMD.AvoidCatchingThrowable")
|
||||
private void startLogThread() {
|
||||
var loggerThread =
|
||||
new Thread(
|
||||
|
||||
@@ -7,6 +7,7 @@ package edu.wpi.first.networktables;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A network table entry value. */
|
||||
@SuppressWarnings("PMD.MethodReturnsInternalArray")
|
||||
public final class NetworkTableValue {
|
||||
NetworkTableValue(NetworkTableType type, Object value, long time) {
|
||||
m_type = type;
|
||||
@@ -183,7 +184,6 @@ public final class NetworkTableValue {
|
||||
* @return The raw value.
|
||||
* @throws ClassCastException if the entry value is not of raw type.
|
||||
*/
|
||||
@SuppressWarnings("PMD.MethodReturnsInternalArray")
|
||||
public byte[] getRaw() {
|
||||
if (m_type != NetworkTableType.kRaw) {
|
||||
throw new ClassCastException("cannot convert " + m_type + " to raw");
|
||||
@@ -197,7 +197,6 @@ public final class NetworkTableValue {
|
||||
* @return The rpc definition value.
|
||||
* @throws ClassCastException if the entry value is not of rpc definition type.
|
||||
*/
|
||||
@SuppressWarnings("PMD.MethodReturnsInternalArray")
|
||||
public byte[] getRpc() {
|
||||
if (m_type != NetworkTableType.kRpc) {
|
||||
throw new ClassCastException("cannot convert " + m_type + " to rpc");
|
||||
@@ -211,7 +210,6 @@ public final class NetworkTableValue {
|
||||
* @return The boolean array value.
|
||||
* @throws ClassCastException if the entry value is not of boolean array type.
|
||||
*/
|
||||
@SuppressWarnings("PMD.MethodReturnsInternalArray")
|
||||
public boolean[] getBooleanArray() {
|
||||
if (m_type != NetworkTableType.kBooleanArray) {
|
||||
throw new ClassCastException("cannot convert " + m_type + " to boolean array");
|
||||
@@ -225,7 +223,6 @@ public final class NetworkTableValue {
|
||||
* @return The double array value.
|
||||
* @throws ClassCastException if the entry value is not of double array type.
|
||||
*/
|
||||
@SuppressWarnings("PMD.MethodReturnsInternalArray")
|
||||
public double[] getDoubleArray() {
|
||||
if (m_type != NetworkTableType.kDoubleArray) {
|
||||
throw new ClassCastException("cannot convert " + m_type + " to double array");
|
||||
@@ -239,7 +236,6 @@ public final class NetworkTableValue {
|
||||
* @return The string array value.
|
||||
* @throws ClassCastException if the entry value is not of string array type.
|
||||
*/
|
||||
@SuppressWarnings("PMD.MethodReturnsInternalArray")
|
||||
public String[] getStringArray() {
|
||||
if (m_type != NetworkTableType.kStringArray) {
|
||||
throw new ClassCastException("cannot convert " + m_type + " to string array");
|
||||
|
||||
@@ -5,25 +5,21 @@
|
||||
package edu.wpi.first.networktables;
|
||||
|
||||
/** NetworkTables Remote Procedure Call (Server Side). */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final class RpcAnswer {
|
||||
/** Entry handle. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int entry;
|
||||
|
||||
/** Call handle. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public int call;
|
||||
|
||||
/** Entry name. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final String name;
|
||||
|
||||
/** Call raw parameters. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final byte[] params;
|
||||
|
||||
/** Connection that called the RPC. */
|
||||
@SuppressWarnings("MemberName")
|
||||
public final ConnectionInfo conn;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,8 @@ suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN"
|
||||
<suppress files=".*test.*" checks="MissingJavadocMethod" />
|
||||
<suppress files=".*wpilibjIntegrationTests.*"
|
||||
checks="MissingJavadocMethod" />
|
||||
<suppress files="wpimath/*"
|
||||
checks="(LocalVariableName|MemberName|MethodName|MethodTypeParameterName|ParameterName)" />
|
||||
<suppress files=".*JNI.*"
|
||||
checks="(LineLength|EmptyLineSeparator|ParameterName|MissingJavadocMethod)" />
|
||||
checks="(EmptyLineSeparator|LineLength|MissingJavadocMethod|ParameterName)" />
|
||||
</suppressions>
|
||||
|
||||
@@ -170,19 +170,19 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
</module>
|
||||
<module name="MemberName">
|
||||
<property name="format"
|
||||
value="^(m_[a-z]([a-zA-Z0-9]*)|value)$" />
|
||||
value="^(m_([a-zA-Z]|[a-z][a-zA-Z0-9]+)|value)$" />
|
||||
<message key="name.invalidPattern"
|
||||
value="Member name ''{0}'' must match pattern ''{1}''." />
|
||||
</module>
|
||||
<module name="ParameterName">
|
||||
<property name="format"
|
||||
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
|
||||
value="^([a-zA-Z]|[a-z][a-zA-Z0-9]+)$" />
|
||||
<message key="name.invalidPattern"
|
||||
value="Parameter name ''{0}'' must match pattern ''{1}''." />
|
||||
</module>
|
||||
<module name="LambdaParameterName">
|
||||
<property name="format"
|
||||
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
|
||||
value="^(_?[a-zA-Z]|_?[a-z][a-zA-Z0-9]+)$" />
|
||||
<message key="name.invalidPattern"
|
||||
value="Lambda parameter name ''{0}'' must match pattern ''{1}''." />
|
||||
</module>
|
||||
@@ -195,26 +195,23 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
<module name="LocalVariableName">
|
||||
<property name="tokens" value="VARIABLE_DEF" />
|
||||
<property name="format"
|
||||
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
|
||||
value="^([a-zA-Z][0-9]*|[a-z][a-zA-Z0-9]+)$" />
|
||||
<property name="allowOneCharVarInForLoop" value="true" />
|
||||
<message key="name.invalidPattern"
|
||||
value="Local variable name ''{0}'' must match pattern ''{1}''." />
|
||||
</module>
|
||||
<module name="ClassTypeParameterName">
|
||||
<property name="format"
|
||||
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
|
||||
<property name="format" value="^[A-Z][a-zA-Z0-9]*$" />
|
||||
<message key="name.invalidPattern"
|
||||
value="Class type name ''{0}'' must match pattern ''{1}''." />
|
||||
</module>
|
||||
<module name="MethodTypeParameterName">
|
||||
<property name="format"
|
||||
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
|
||||
<property name="format" value="^[A-Z][a-zA-Z0-9]*$" />
|
||||
<message key="name.invalidPattern"
|
||||
value="Method type name ''{0}'' must match pattern ''{1}''." />
|
||||
</module>
|
||||
<module name="InterfaceTypeParameterName">
|
||||
<property name="format"
|
||||
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
|
||||
<property name="format" value="^[A-Z][a-zA-Z0-9]*$" />
|
||||
<message key="name.invalidPattern"
|
||||
value="Interface type name ''{0}'' must match pattern ''{1}''." />
|
||||
</module>
|
||||
@@ -229,10 +226,6 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
<message key="ws.notPreceded"
|
||||
value="GenericWhitespace ''{0}'' is not preceded with whitespace." />
|
||||
</module>
|
||||
<module name="AbbreviationAsWordInName">
|
||||
<property name="ignoreFinal" value="false" />
|
||||
<property name="allowedAbbreviationLength" value="4" />
|
||||
</module>
|
||||
<module name="OverloadMethodsDeclarationOrder" />
|
||||
<module name="VariableDeclarationUsageDistance" />
|
||||
<module name="MethodParamPad" />
|
||||
|
||||
@@ -13,15 +13,18 @@
|
||||
<exclude name="AccessorClassGeneration" />
|
||||
<exclude name="AccessorMethodGeneration" />
|
||||
<exclude name="AvoidPrintStackTrace" />
|
||||
<exclude name="AvoidReassigningCatchVariables" />
|
||||
<exclude name="AvoidReassigningParameters" />
|
||||
<exclude name="AvoidUsingHardCodedIP" />
|
||||
<exclude name="ConstantsInInterface" />
|
||||
<exclude name="JUnitAssertionsShouldIncludeMessage" />
|
||||
<exclude name="JUnitTestContainsTooManyAsserts" />
|
||||
<exclude name="JUnitTestsShouldIncludeAssert" />
|
||||
<exclude name="JUnit4TestShouldUseAfterAnnotation" />
|
||||
<exclude name="JUnit4TestShouldUseBeforeAnnotation" />
|
||||
<exclude name="JUnit4TestShouldUseTestAnnotation" />
|
||||
<exclude name="LooseCoupling" />
|
||||
<exclude name="PreserveStackTrace" />
|
||||
<exclude name="ReplaceHashtableWithMap" />
|
||||
<exclude name="ReplaceVectorWithList" />
|
||||
<exclude name="SwitchStmtsShouldHaveDefault" />
|
||||
@@ -58,6 +61,7 @@
|
||||
|
||||
<rule ref="category/java/errorprone.xml">
|
||||
<exclude name="AssignmentToNonFinalStatic" />
|
||||
<exclude name="AvoidCatchingThrowable" />
|
||||
<exclude name="AvoidDuplicateLiterals" />
|
||||
<exclude name="AvoidLiteralsInIfCondition" />
|
||||
<exclude name="BeanMembersShouldSerialize" />
|
||||
@@ -65,6 +69,8 @@
|
||||
<exclude name="ConstructorCallsOverridableMethod" />
|
||||
<exclude name="DataflowAnomalyAnalysis" />
|
||||
<exclude name="DoNotTerminateVM" />
|
||||
<exclude name="EmptyCatchBlock" />
|
||||
<exclude name="EmptyWhileStmt" />
|
||||
<exclude name="FinalizeDoesNotCallSuperFinalize" />
|
||||
<exclude name="JUnitSpelling" />
|
||||
<exclude name="MissingSerialVersionUID" />
|
||||
|
||||
@@ -38,7 +38,6 @@ import java.util.function.Supplier;
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
@SuppressWarnings("MemberName")
|
||||
public class MecanumControllerCommand extends CommandBase {
|
||||
private final Timer m_timer = new Timer();
|
||||
private final boolean m_usePID;
|
||||
@@ -87,7 +86,6 @@ public class MecanumControllerCommand extends CommandBase {
|
||||
* voltages.
|
||||
* @param requirements The subsystems to require.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public MecanumControllerCommand(
|
||||
Trajectory trajectory,
|
||||
Supplier<Pose2d> pose,
|
||||
@@ -179,7 +177,6 @@ public class MecanumControllerCommand extends CommandBase {
|
||||
* voltages.
|
||||
* @param requirements The subsystems to require.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public MecanumControllerCommand(
|
||||
Trajectory trajectory,
|
||||
Supplier<Pose2d> pose,
|
||||
@@ -236,7 +233,6 @@ public class MecanumControllerCommand extends CommandBase {
|
||||
* @param outputWheelSpeeds A MecanumDriveWheelSpeeds object containing the output wheel speeds.
|
||||
* @param requirements The subsystems to require.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public MecanumControllerCommand(
|
||||
Trajectory trajectory,
|
||||
Supplier<Pose2d> pose,
|
||||
@@ -308,7 +304,6 @@ public class MecanumControllerCommand extends CommandBase {
|
||||
* @param outputWheelSpeeds A MecanumDriveWheelSpeeds object containing the output wheel speeds.
|
||||
* @param requirements The subsystems to require.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public MecanumControllerCommand(
|
||||
Trajectory trajectory,
|
||||
Supplier<Pose2d> pose,
|
||||
@@ -350,7 +345,6 @@ public class MecanumControllerCommand extends CommandBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("LocalVariableName")
|
||||
public void execute() {
|
||||
double curTime = m_timer.get();
|
||||
double dt = curTime - m_prevTime;
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.function.Supplier;
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
@SuppressWarnings("MemberName")
|
||||
public class SwerveControllerCommand extends CommandBase {
|
||||
private final Timer m_timer = new Timer();
|
||||
private final Trajectory m_trajectory;
|
||||
@@ -61,7 +60,6 @@ public class SwerveControllerCommand extends CommandBase {
|
||||
* @param outputModuleStates The raw output module states from the position controllers.
|
||||
* @param requirements The subsystems to require.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public SwerveControllerCommand(
|
||||
Trajectory trajectory,
|
||||
Supplier<Pose2d> pose,
|
||||
@@ -114,7 +112,6 @@ public class SwerveControllerCommand extends CommandBase {
|
||||
* @param outputModuleStates The raw output module states from the position controllers.
|
||||
* @param requirements The subsystems to require.
|
||||
*/
|
||||
@SuppressWarnings("ParameterName")
|
||||
public SwerveControllerCommand(
|
||||
Trajectory trajectory,
|
||||
Supplier<Pose2d> pose,
|
||||
@@ -144,7 +141,6 @@ public class SwerveControllerCommand extends CommandBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("LocalVariableName")
|
||||
public void execute() {
|
||||
double curTime = m_timer.get();
|
||||
var desiredState = m_trajectory.sample(curTime);
|
||||
|
||||
@@ -21,6 +21,9 @@ class DigitalSource;
|
||||
*/
|
||||
class SynchronousInterrupt {
|
||||
public:
|
||||
/**
|
||||
* Event trigger combinations for a synchronous interrupt.
|
||||
*/
|
||||
enum WaitResult {
|
||||
kTimeout = 0x0,
|
||||
kRisingEdge = 0x1,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user