diff --git a/styleguide/pmd-ruleset.xml b/styleguide/pmd-ruleset.xml
index 92d35dcb02..dc5c1da04e 100644
--- a/styleguide/pmd-ruleset.xml
+++ b/styleguide/pmd-ruleset.xml
@@ -19,4 +19,10 @@
This class allows access to an Analog Devices ADXL362 3-axis accelerometer. */ +@SuppressWarnings("PMD.UnusedPrivateField") public class ADXL362 extends SensorBase implements Accelerometer, LiveWindowSendable { private static final byte kRegWrite = 0x0A; private static final byte kRegRead = 0x0B; diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java index 946fc743c7..dc7a736a4d 100644 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java +++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java @@ -25,7 +25,7 @@ import edu.wpi.first.wpilibj.livewindow.LiveWindowSendable; * *
This class is for the digital ADXRS450 gyro sensor that connects via SPI.
*/
-@SuppressWarnings({"TypeName", "AbbreviationAsWordInName"})
+@SuppressWarnings({"TypeName", "AbbreviationAsWordInName", "PMD.UnusedPrivateField"})
public class ADXRS450_Gyro extends GyroBase implements Gyro, PIDSource, LiveWindowSendable {
private static final double kSamplePeriod = 0.001;
private static final double kCalibrationSampleTime = 5.0;
diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/AnalogOutput.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/AnalogOutput.java
index 6b9112e001..dc15349393 100644
--- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/AnalogOutput.java
+++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/AnalogOutput.java
@@ -47,6 +47,13 @@ public class AnalogOutput extends SensorBase implements LiveWindowSendable {
m_channel = 0;
}
+ /**
+ * Get the channel of this AnalogOutput.
+ */
+ public int getChannel() {
+ return m_channel;
+ }
+
public void setVoltage(double voltage) {
AnalogJNI.setAnalogOutput(m_port, voltage);
}
diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java
index 561c515000..8f60d3c300 100644
--- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java
+++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java
@@ -55,8 +55,8 @@ public class CameraServer {
private HashMap This is not currently implemented!
@@ -302,8 +302,8 @@ public class I2C extends SensorBase {
* @param registerAddress The register to write on all devices on the bus.
* @param data The value to write to the devices.
*/
- public void broadcast(int registerAddress, int data) {
- }
+ // public void broadcast(int registerAddress, int data) {
+ // }
/**
* Verify that a device's registers contain expected values.
diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Joystick.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Joystick.java
index 223e33d341..f1724e4ec6 100644
--- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Joystick.java
+++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Joystick.java
@@ -201,6 +201,7 @@ public class Joystick extends JoystickBase {
* GenericHID interface.
* @return The state of the trigger.
*/
+ @SuppressWarnings("PMD.UnusedFormalParameter")
public boolean getTrigger(Hand hand) {
return getRawButton(m_buttons[ButtonType.kTrigger.value]);
}
@@ -214,6 +215,7 @@ public class Joystick extends JoystickBase {
* GenericHID interface.
* @return The state of the top button.
*/
+ @SuppressWarnings("PMD.UnusedFormalParameter")
public boolean getTop(Hand hand) {
return getRawButton(m_buttons[ButtonType.kTop.value]);
}
@@ -236,6 +238,7 @@ public class Joystick extends JoystickBase {
* GenericHID interface.
* @return The state of the bumper (always false)
*/
+ @SuppressWarnings("PMD.UnusedFormalParameter")
public boolean getBumper(Hand hand) {
return false;
}
diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Relay.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Relay.java
index 48a5347e16..0f9d153df7 100644
--- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Relay.java
+++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Relay.java
@@ -75,7 +75,6 @@ public class Relay extends SensorBase implements MotorSafety, LiveWindowSendable
private int m_forwardHandle = 0;
private int m_reverseHandle = 0;
- private long m_port;
private Direction m_direction;
diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/RobotBase.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/RobotBase.java
index 5a6a3ca6a8..5a351f45ac 100644
--- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/RobotBase.java
+++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/RobotBase.java
@@ -189,6 +189,7 @@ public abstract class RobotBase {
/**
* Starting point for the applications.
*/
+ @SuppressWarnings("PMD.UnusedFormalParameter")
public static void main(String... args) {
initializeHardwareConfiguration();
diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Ultrasonic.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Ultrasonic.java
index 55f7525273..3b5bb4c19c 100644
--- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Ultrasonic.java
+++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/Ultrasonic.java
@@ -40,10 +40,6 @@ public class Ultrasonic extends SensorBase implements PIDSource, LiveWindowSenda
// Time (sec) for the ping trigger pulse.
private static final double kPingTime = 10 * 1e-6;
- // Priority that the ultrasonic round robin task runs.
- private static final int kPriority = 90;
- // Max time (ms) between readings.
- private static final double kMaxUltrasonicTime = 0.1;
private static final double kSpeedOfSoundInchesPerSec = 1130.0 * 12.0;
// head of the ultrasonic sensor list
private static Ultrasonic m_firstSensor = null;
@@ -84,7 +80,7 @@ public class Ultrasonic extends SensorBase implements PIDSource, LiveWindowSenda
}
if (ultrasonic.isEnabled()) {
// Do the ping
- ultrasonic.m_pingChannel.pulse(m_pingChannel.getChannel(), kPingTime);
+ ultrasonic.m_pingChannel.pulse(kPingTime);
}
ultrasonic = ultrasonic.m_nextSensor;
Timer.delay(.1); // wait for ping to return
@@ -288,7 +284,7 @@ public class Ultrasonic extends SensorBase implements PIDSource, LiveWindowSenda
// single sensor
m_counter.reset(); // reset the counter to zero (invalid data now)
// do the ping to start getting a single range
- m_pingChannel.pulse(m_pingChannel.getChannel(), kPingTime);
+ m_pingChannel.pulse(kPingTime);
}
/**
diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/XboxController.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/XboxController.java
index 11821162e7..d5bd1588fa 100644
--- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/XboxController.java
+++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/XboxController.java
@@ -100,6 +100,7 @@ public class XboxController extends GamepadBase {
* GenericHID interface.
* @return The state of the trigger (always false)
*/
+ @SuppressWarnings("PMD.UnusedFormalParameter")
public boolean getTrigger(Hand hand) {
return false;
}
@@ -112,6 +113,7 @@ public class XboxController extends GamepadBase {
* GenericHID interface.
* @return The state of the top button (always false)
*/
+ @SuppressWarnings("PMD.UnusedFormalParameter")
public boolean getTop(Hand hand) {
return false;
}
diff --git a/wpilibj/src/shared/java/edu/wpi/first/wpilibj/HLUsageReporting.java b/wpilibj/src/shared/java/edu/wpi/first/wpilibj/HLUsageReporting.java
index 092426b9af..7e15b09d36 100644
--- a/wpilibj/src/shared/java/edu/wpi/first/wpilibj/HLUsageReporting.java
+++ b/wpilibj/src/shared/java/edu/wpi/first/wpilibj/HLUsageReporting.java
@@ -57,6 +57,7 @@ public class HLUsageReporting {
public void reportScheduler() {
}
+ @SuppressWarnings("PMD.UnusedFormalParameter")
public void reportPIDController(int num) {
}