[wpilib] Prefix all NI DS specific controller classes (#8596)

Easier then the last one that put everything in a sub namespace. By
prefixing the name less things break, and intellisense will be less
confusing to new users during the transition.
This commit is contained in:
Thad House
2026-02-06 21:36:01 -08:00
committed by GitHub
parent 77b2f9802e
commit 5c5d5222f4
133 changed files with 1959 additions and 2682 deletions

View File

@@ -13,9 +13,9 @@ import org.wpilib.util.sendable.Sendable;
import org.wpilib.util.sendable.SendableBuilder;
/**
* Handle input from PS4 controllers connected to the Driver Station.
* Handle input from NiDsPS4 controllers connected to the Driver Station.
*
* <p>This class handles PS4 input that comes from the Driver Station. Each time a value is
* <p>This class handles NiDsPS4 input that comes from the Driver Station. Each time a value is
* requested the most recent value is returned. There is a single class instance for each controller
* and the mapping of ports to hardware buttons depends on the code in the Driver Station.
*
@@ -23,8 +23,8 @@ import org.wpilib.util.sendable.SendableBuilder;
* only through the official NI DS. Sim is not guaranteed to have the same mapping, as well as any
* 3rd party controllers.
*/
public class PS4Controller extends GenericHID implements Sendable {
/** Represents a digital button on a PS4Controller. */
public class NiDsPS4Controller extends GenericHID implements Sendable {
/** Represents a digital button on a NiDsPS4Controller. */
public enum Button {
/** Square button. */
kSquare(0),
@@ -77,7 +77,7 @@ public class PS4Controller extends GenericHID implements Sendable {
}
}
/** Represents an axis on an PS4Controller. */
/** Represents an axis on an NiDsPS4Controller. */
public enum Axis {
/** Left X axis. */
kLeftX(0),
@@ -122,9 +122,9 @@ public class PS4Controller extends GenericHID implements Sendable {
*
* @param port The port index on the Driver Station that the controller is plugged into (0-5).
*/
public PS4Controller(final int port) {
public NiDsPS4Controller(final int port) {
super(port);
HAL.reportUsage("HID", port, "PS4Controller");
HAL.reportUsage("HID", port, "NiDsPS4Controller");
}
/**
@@ -715,48 +715,11 @@ public class PS4Controller extends GenericHID implements Sendable {
return button(Button.kTouchpad.value, loop);
}
/**
* Read the value of the touchpad on the controller.
*
* @return The state of the touchpad.
* @deprecated Use {@link getTouchpadButton} instead. This function is deprecated for removal to
* make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getTouchpad() {
return getRawButton(Button.kTouchpad.value);
}
/**
* Whether the touchpad was pressed since the last check.
*
* @return Whether the touchpad was pressed since the last check.
* @deprecated Use {@link getTouchpadButtonPressed} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getTouchpadPressed() {
return getRawButtonPressed(Button.kTouchpad.value);
}
/**
* Whether the touchpad was released since the last check.
*
* @return Whether the touchpad was released since the last check.
* @deprecated Use {@link getTouchpadButtonReleased} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getTouchpadReleased() {
return getRawButtonReleased(Button.kTouchpad.value);
}
@Override
public void initSendable(SendableBuilder builder) {
builder.setSmartDashboardType("HID");
builder.publishConstString("ControllerType", "PS4");
builder.publishConstString("ControllerType", "NiDsPS4");
builder.addDoubleProperty("L2 Axis", this::getL2Axis, null);
builder.addDoubleProperty("R2 Axis", this::getR2Axis, null);
builder.addDoubleProperty("LeftX", this::getLeftX, null);

View File

@@ -13,9 +13,9 @@ import org.wpilib.util.sendable.Sendable;
import org.wpilib.util.sendable.SendableBuilder;
/**
* Handle input from PS5 controllers connected to the Driver Station.
* Handle input from NiDsPS5 controllers connected to the Driver Station.
*
* <p>This class handles PS5 input that comes from the Driver Station. Each time a value is
* <p>This class handles NiDsPS5 input that comes from the Driver Station. Each time a value is
* requested the most recent value is returned. There is a single class instance for each controller
* and the mapping of ports to hardware buttons depends on the code in the Driver Station.
*
@@ -23,8 +23,8 @@ import org.wpilib.util.sendable.SendableBuilder;
* only through the official NI DS. Sim is not guaranteed to have the same mapping, as well as any
* 3rd party controllers.
*/
public class PS5Controller extends GenericHID implements Sendable {
/** Represents a digital button on a PS5Controller. */
public class NiDsPS5Controller extends GenericHID implements Sendable {
/** Represents a digital button on a NiDsPS5Controller. */
public enum Button {
/** Square button. */
kSquare(0),
@@ -77,7 +77,7 @@ public class PS5Controller extends GenericHID implements Sendable {
}
}
/** Represents an axis on an PS5Controller. */
/** Represents an axis on an NiDsPS5Controller. */
public enum Axis {
/** Left X axis. */
kLeftX(0),
@@ -122,9 +122,9 @@ public class PS5Controller extends GenericHID implements Sendable {
*
* @param port The port index on the Driver Station that the controller is plugged into (0-5).
*/
public PS5Controller(final int port) {
public NiDsPS5Controller(final int port) {
super(port);
HAL.reportUsage("HID", port, "PS5Controller");
HAL.reportUsage("HID", port, "NiDsPS5Controller");
}
/**
@@ -715,48 +715,11 @@ public class PS5Controller extends GenericHID implements Sendable {
return button(Button.kTouchpad.value, loop);
}
/**
* Read the value of the touchpad on the controller.
*
* @return The state of the touchpad.
* @deprecated Use {@link getTouchpadButton} instead. This function is deprecated for removal to
* make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getTouchpad() {
return getRawButton(Button.kTouchpad.value);
}
/**
* Whether the touchpad was pressed since the last check.
*
* @return Whether the touchpad was pressed since the last check.
* @deprecated Use {@link getTouchpadButtonPressed} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getTouchpadPressed() {
return getRawButtonPressed(Button.kTouchpad.value);
}
/**
* Whether the touchpad was released since the last check.
*
* @return Whether the touchpad was released since the last check.
* @deprecated Use {@link getTouchpadButtonReleased} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getTouchpadReleased() {
return getRawButtonReleased(Button.kTouchpad.value);
}
@Override
public void initSendable(SendableBuilder builder) {
builder.setSmartDashboardType("HID");
builder.publishConstString("ControllerType", "PS5");
builder.publishConstString("ControllerType", "NiDsPS5");
builder.addDoubleProperty("L2 Axis", this::getL2Axis, null);
builder.addDoubleProperty("R2 Axis", this::getR2Axis, null);
builder.addDoubleProperty("LeftX", this::getLeftX, null);

View File

@@ -13,9 +13,9 @@ import org.wpilib.util.sendable.Sendable;
import org.wpilib.util.sendable.SendableBuilder;
/**
* Handle input from Stadia controllers connected to the Driver Station.
* Handle input from NiDsStadia controllers connected to the Driver Station.
*
* <p>This class handles Stadia input that comes from the Driver Station. Each time a value is
* <p>This class handles NiDsStadia input that comes from the Driver Station. Each time a value is
* requested the most recent value is returned. There is a single class instance for each controller
* and the mapping of ports to hardware buttons depends on the code in the Driver Station.
*
@@ -23,8 +23,8 @@ import org.wpilib.util.sendable.SendableBuilder;
* only through the official NI DS. Sim is not guaranteed to have the same mapping, as well as any
* 3rd party controllers.
*/
public class StadiaController extends GenericHID implements Sendable {
/** Represents a digital button on a StadiaController. */
public class NiDsStadiaController extends GenericHID implements Sendable {
/** Represents a digital button on a NiDsStadiaController. */
public enum Button {
/** A button. */
kA(0),
@@ -79,7 +79,7 @@ public class StadiaController extends GenericHID implements Sendable {
}
}
/** Represents an axis on an StadiaController. */
/** Represents an axis on an NiDsStadiaController. */
public enum Axis {
/** Left X axis. */
kLeftX(0),
@@ -120,9 +120,9 @@ public class StadiaController extends GenericHID implements Sendable {
*
* @param port The port index on the Driver Station that the controller is plugged into (0-5).
*/
public StadiaController(final int port) {
public NiDsStadiaController(final int port) {
super(port);
HAL.reportUsage("HID", port, "StadiaController");
HAL.reportUsage("HID", port, "NiDsStadiaController");
}
/**
@@ -731,86 +731,11 @@ public class StadiaController extends GenericHID implements Sendable {
return button(Button.kFrame.value, loop);
}
/**
* Read the value of the left bumper (LB) button on the controller.
*
* @return The state of the button.
* @deprecated Use {@link getLeftBumperButton} instead. This function is deprecated for removal
* to make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getLeftBumper() {
return getRawButton(Button.kLeftBumper.value);
}
/**
* Read the value of the right bumper (RB) button on the controller.
*
* @return The state of the button.
* @deprecated Use {@link getRightBumperButton} instead. This function is deprecated for removal
* to make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getRightBumper() {
return getRawButton(Button.kRightBumper.value);
}
/**
* Whether the left bumper (LB) was pressed since the last check.
*
* @return Whether the button was pressed since the last check.
* @deprecated Use {@link getLeftBumperButtonPressed} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getLeftBumperPressed() {
return getRawButtonPressed(Button.kLeftBumper.value);
}
/**
* Whether the right bumper (RB) was pressed since the last check.
*
* @return Whether the button was pressed since the last check.
* @deprecated Use {@link getRightBumperButtonPressed} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getRightBumperPressed() {
return getRawButtonPressed(Button.kRightBumper.value);
}
/**
* Whether the left bumper (LB) was released since the last check.
*
* @return Whether the button was released since the last check.
* @deprecated Use {@link getLeftBumperButtonReleased} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getLeftBumperReleased() {
return getRawButtonReleased(Button.kLeftBumper.value);
}
/**
* Whether the right bumper (RB) was released since the last check.
*
* @return Whether the button was released since the last check.
* @deprecated Use {@link getRightBumperButtonReleased} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getRightBumperReleased() {
return getRawButtonReleased(Button.kRightBumper.value);
}
@Override
public void initSendable(SendableBuilder builder) {
builder.setSmartDashboardType("HID");
builder.publishConstString("ControllerType", "Stadia");
builder.publishConstString("ControllerType", "NiDsStadia");
builder.addDoubleProperty("LeftX", this::getLeftX, null);
builder.addDoubleProperty("RightX", this::getRightX, null);
builder.addDoubleProperty("LeftY", this::getLeftY, null);

View File

@@ -13,9 +13,9 @@ import org.wpilib.util.sendable.Sendable;
import org.wpilib.util.sendable.SendableBuilder;
/**
* Handle input from Xbox controllers connected to the Driver Station.
* Handle input from NiDsXbox controllers connected to the Driver Station.
*
* <p>This class handles Xbox input that comes from the Driver Station. Each time a value is
* <p>This class handles NiDsXbox input that comes from the Driver Station. Each time a value is
* requested the most recent value is returned. There is a single class instance for each controller
* and the mapping of ports to hardware buttons depends on the code in the Driver Station.
*
@@ -23,8 +23,8 @@ import org.wpilib.util.sendable.SendableBuilder;
* only through the official NI DS. Sim is not guaranteed to have the same mapping, as well as any
* 3rd party controllers.
*/
public class XboxController extends GenericHID implements Sendable {
/** Represents a digital button on a XboxController. */
public class NiDsXboxController extends GenericHID implements Sendable {
/** Represents a digital button on a NiDsXboxController. */
public enum Button {
/** A button. */
kA(0),
@@ -69,7 +69,7 @@ public class XboxController extends GenericHID implements Sendable {
}
}
/** Represents an axis on an XboxController. */
/** Represents an axis on an NiDsXboxController. */
public enum Axis {
/** Left X axis. */
kLeftX(0),
@@ -114,9 +114,9 @@ public class XboxController extends GenericHID implements Sendable {
*
* @param port The port index on the Driver Station that the controller is plugged into (0-5).
*/
public XboxController(final int port) {
public NiDsXboxController(final int port) {
super(port);
HAL.reportUsage("HID", port, "XboxController");
HAL.reportUsage("HID", port, "NiDsXboxController");
}
/**
@@ -607,86 +607,11 @@ public class XboxController extends GenericHID implements Sendable {
return button(Button.kRightStick.value, loop);
}
/**
* Read the value of the left bumper (LB) button on the controller.
*
* @return The state of the button.
* @deprecated Use {@link getLeftBumperButton} instead. This function is deprecated for removal
* to make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getLeftBumper() {
return getRawButton(Button.kLeftBumper.value);
}
/**
* Read the value of the right bumper (RB) button on the controller.
*
* @return The state of the button.
* @deprecated Use {@link getRightBumperButton} instead. This function is deprecated for removal
* to make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getRightBumper() {
return getRawButton(Button.kRightBumper.value);
}
/**
* Whether the left bumper (LB) was pressed since the last check.
*
* @return Whether the button was pressed since the last check.
* @deprecated Use {@link getLeftBumperButtonPressed} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getLeftBumperPressed() {
return getRawButtonPressed(Button.kLeftBumper.value);
}
/**
* Whether the right bumper (RB) was pressed since the last check.
*
* @return Whether the button was pressed since the last check.
* @deprecated Use {@link getRightBumperButtonPressed} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getRightBumperPressed() {
return getRawButtonPressed(Button.kRightBumper.value);
}
/**
* Whether the left bumper (LB) was released since the last check.
*
* @return Whether the button was released since the last check.
* @deprecated Use {@link getLeftBumperButtonReleased} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getLeftBumperReleased() {
return getRawButtonReleased(Button.kLeftBumper.value);
}
/**
* Whether the right bumper (RB) was released since the last check.
*
* @return Whether the button was released since the last check.
* @deprecated Use {@link getRightBumperButtonReleased} instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be automatically
* generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public boolean getRightBumperReleased() {
return getRawButtonReleased(Button.kRightBumper.value);
}
@Override
public void initSendable(SendableBuilder builder) {
builder.setSmartDashboardType("HID");
builder.publishConstString("ControllerType", "Xbox");
builder.publishConstString("ControllerType", "NiDsXbox");
builder.addDoubleProperty("LeftTrigger Axis", this::getLeftTriggerAxis, null);
builder.addDoubleProperty("RightTrigger Axis", this::getRightTriggerAxis, null);
builder.addDoubleProperty("LeftX", this::getLeftX, null);

View File

@@ -6,17 +6,17 @@
package org.wpilib.simulation;
import org.wpilib.driverstation.PS4Controller;
import org.wpilib.driverstation.NiDsPS4Controller;
/** Class to control a simulated PS4 controller. */
public class PS4ControllerSim extends GenericHIDSim {
/** Class to control a simulated NiDsPS4 controller. */
public class NiDsPS4ControllerSim extends GenericHIDSim {
/**
* Constructs from a PS4Controller object.
* Constructs from a NiDsPS4Controller object.
*
* @param joystick controller to simulate
*/
@SuppressWarnings("this-escape")
public PS4ControllerSim(PS4Controller joystick) {
public NiDsPS4ControllerSim(NiDsPS4Controller joystick) {
super(joystick);
setAxesMaximumIndex(6);
setButtonsMaximumIndex(14);
@@ -29,7 +29,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param port port number
*/
@SuppressWarnings("this-escape")
public PS4ControllerSim(int port) {
public NiDsPS4ControllerSim(int port) {
super(port);
setAxesMaximumIndex(6);
setButtonsMaximumIndex(14);
@@ -42,7 +42,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftX(double value) {
setRawAxis(PS4Controller.Axis.kLeftX.value, value);
setRawAxis(NiDsPS4Controller.Axis.kLeftX.value, value);
}
/**
@@ -51,7 +51,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftY(double value) {
setRawAxis(PS4Controller.Axis.kLeftY.value, value);
setRawAxis(NiDsPS4Controller.Axis.kLeftY.value, value);
}
/**
@@ -60,7 +60,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightX(double value) {
setRawAxis(PS4Controller.Axis.kRightX.value, value);
setRawAxis(NiDsPS4Controller.Axis.kRightX.value, value);
}
/**
@@ -69,7 +69,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightY(double value) {
setRawAxis(PS4Controller.Axis.kRightY.value, value);
setRawAxis(NiDsPS4Controller.Axis.kRightY.value, value);
}
/**
@@ -78,7 +78,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setL2Axis(double value) {
setRawAxis(PS4Controller.Axis.kL2.value, value);
setRawAxis(NiDsPS4Controller.Axis.kL2.value, value);
}
/**
@@ -87,7 +87,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setR2Axis(double value) {
setRawAxis(PS4Controller.Axis.kR2.value, value);
setRawAxis(NiDsPS4Controller.Axis.kR2.value, value);
}
/**
@@ -96,7 +96,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setSquareButton(boolean value) {
setRawButton(PS4Controller.Button.kSquare.value, value);
setRawButton(NiDsPS4Controller.Button.kSquare.value, value);
}
/**
@@ -105,7 +105,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setCrossButton(boolean value) {
setRawButton(PS4Controller.Button.kCross.value, value);
setRawButton(NiDsPS4Controller.Button.kCross.value, value);
}
/**
@@ -114,7 +114,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setCircleButton(boolean value) {
setRawButton(PS4Controller.Button.kCircle.value, value);
setRawButton(NiDsPS4Controller.Button.kCircle.value, value);
}
/**
@@ -123,7 +123,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setTriangleButton(boolean value) {
setRawButton(PS4Controller.Button.kTriangle.value, value);
setRawButton(NiDsPS4Controller.Button.kTriangle.value, value);
}
/**
@@ -132,7 +132,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setL1Button(boolean value) {
setRawButton(PS4Controller.Button.kL1.value, value);
setRawButton(NiDsPS4Controller.Button.kL1.value, value);
}
/**
@@ -141,7 +141,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setR1Button(boolean value) {
setRawButton(PS4Controller.Button.kR1.value, value);
setRawButton(NiDsPS4Controller.Button.kR1.value, value);
}
/**
@@ -150,7 +150,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setL2Button(boolean value) {
setRawButton(PS4Controller.Button.kL2.value, value);
setRawButton(NiDsPS4Controller.Button.kL2.value, value);
}
/**
@@ -159,7 +159,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setR2Button(boolean value) {
setRawButton(PS4Controller.Button.kR2.value, value);
setRawButton(NiDsPS4Controller.Button.kR2.value, value);
}
/**
@@ -168,7 +168,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setShareButton(boolean value) {
setRawButton(PS4Controller.Button.kShare.value, value);
setRawButton(NiDsPS4Controller.Button.kShare.value, value);
}
/**
@@ -177,7 +177,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setOptionsButton(boolean value) {
setRawButton(PS4Controller.Button.kOptions.value, value);
setRawButton(NiDsPS4Controller.Button.kOptions.value, value);
}
/**
@@ -186,7 +186,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setL3Button(boolean value) {
setRawButton(PS4Controller.Button.kL3.value, value);
setRawButton(NiDsPS4Controller.Button.kL3.value, value);
}
/**
@@ -195,7 +195,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setR3Button(boolean value) {
setRawButton(PS4Controller.Button.kR3.value, value);
setRawButton(NiDsPS4Controller.Button.kR3.value, value);
}
/**
@@ -204,7 +204,7 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setPSButton(boolean value) {
setRawButton(PS4Controller.Button.kPS.value, value);
setRawButton(NiDsPS4Controller.Button.kPS.value, value);
}
/**
@@ -213,18 +213,6 @@ public class PS4ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setTouchpadButton(boolean value) {
setRawButton(PS4Controller.Button.kTouchpad.value, value);
}
/**
* Change the value of the touchpad button on the controller.
*
* @param value the new value
* @deprecated Use {@link setTouchpadButton} instead. This function is deprecated for removal to
* make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public void setTouchpad(boolean value) {
setRawButton(PS4Controller.Button.kTouchpad.value, value);
setRawButton(NiDsPS4Controller.Button.kTouchpad.value, value);
}
}

View File

@@ -6,17 +6,17 @@
package org.wpilib.simulation;
import org.wpilib.driverstation.PS5Controller;
import org.wpilib.driverstation.NiDsPS5Controller;
/** Class to control a simulated PS5 controller. */
public class PS5ControllerSim extends GenericHIDSim {
/** Class to control a simulated NiDsPS5 controller. */
public class NiDsPS5ControllerSim extends GenericHIDSim {
/**
* Constructs from a PS5Controller object.
* Constructs from a NiDsPS5Controller object.
*
* @param joystick controller to simulate
*/
@SuppressWarnings("this-escape")
public PS5ControllerSim(PS5Controller joystick) {
public NiDsPS5ControllerSim(NiDsPS5Controller joystick) {
super(joystick);
setAxesMaximumIndex(6);
setButtonsMaximumIndex(14);
@@ -29,7 +29,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param port port number
*/
@SuppressWarnings("this-escape")
public PS5ControllerSim(int port) {
public NiDsPS5ControllerSim(int port) {
super(port);
setAxesMaximumIndex(6);
setButtonsMaximumIndex(14);
@@ -42,7 +42,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftX(double value) {
setRawAxis(PS5Controller.Axis.kLeftX.value, value);
setRawAxis(NiDsPS5Controller.Axis.kLeftX.value, value);
}
/**
@@ -51,7 +51,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftY(double value) {
setRawAxis(PS5Controller.Axis.kLeftY.value, value);
setRawAxis(NiDsPS5Controller.Axis.kLeftY.value, value);
}
/**
@@ -60,7 +60,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightX(double value) {
setRawAxis(PS5Controller.Axis.kRightX.value, value);
setRawAxis(NiDsPS5Controller.Axis.kRightX.value, value);
}
/**
@@ -69,7 +69,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightY(double value) {
setRawAxis(PS5Controller.Axis.kRightY.value, value);
setRawAxis(NiDsPS5Controller.Axis.kRightY.value, value);
}
/**
@@ -78,7 +78,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setL2Axis(double value) {
setRawAxis(PS5Controller.Axis.kL2.value, value);
setRawAxis(NiDsPS5Controller.Axis.kL2.value, value);
}
/**
@@ -87,7 +87,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setR2Axis(double value) {
setRawAxis(PS5Controller.Axis.kR2.value, value);
setRawAxis(NiDsPS5Controller.Axis.kR2.value, value);
}
/**
@@ -96,7 +96,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setSquareButton(boolean value) {
setRawButton(PS5Controller.Button.kSquare.value, value);
setRawButton(NiDsPS5Controller.Button.kSquare.value, value);
}
/**
@@ -105,7 +105,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setCrossButton(boolean value) {
setRawButton(PS5Controller.Button.kCross.value, value);
setRawButton(NiDsPS5Controller.Button.kCross.value, value);
}
/**
@@ -114,7 +114,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setCircleButton(boolean value) {
setRawButton(PS5Controller.Button.kCircle.value, value);
setRawButton(NiDsPS5Controller.Button.kCircle.value, value);
}
/**
@@ -123,7 +123,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setTriangleButton(boolean value) {
setRawButton(PS5Controller.Button.kTriangle.value, value);
setRawButton(NiDsPS5Controller.Button.kTriangle.value, value);
}
/**
@@ -132,7 +132,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setL1Button(boolean value) {
setRawButton(PS5Controller.Button.kL1.value, value);
setRawButton(NiDsPS5Controller.Button.kL1.value, value);
}
/**
@@ -141,7 +141,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setR1Button(boolean value) {
setRawButton(PS5Controller.Button.kR1.value, value);
setRawButton(NiDsPS5Controller.Button.kR1.value, value);
}
/**
@@ -150,7 +150,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setL2Button(boolean value) {
setRawButton(PS5Controller.Button.kL2.value, value);
setRawButton(NiDsPS5Controller.Button.kL2.value, value);
}
/**
@@ -159,7 +159,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setR2Button(boolean value) {
setRawButton(PS5Controller.Button.kR2.value, value);
setRawButton(NiDsPS5Controller.Button.kR2.value, value);
}
/**
@@ -168,7 +168,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setCreateButton(boolean value) {
setRawButton(PS5Controller.Button.kCreate.value, value);
setRawButton(NiDsPS5Controller.Button.kCreate.value, value);
}
/**
@@ -177,7 +177,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setOptionsButton(boolean value) {
setRawButton(PS5Controller.Button.kOptions.value, value);
setRawButton(NiDsPS5Controller.Button.kOptions.value, value);
}
/**
@@ -186,7 +186,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setL3Button(boolean value) {
setRawButton(PS5Controller.Button.kL3.value, value);
setRawButton(NiDsPS5Controller.Button.kL3.value, value);
}
/**
@@ -195,7 +195,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setR3Button(boolean value) {
setRawButton(PS5Controller.Button.kR3.value, value);
setRawButton(NiDsPS5Controller.Button.kR3.value, value);
}
/**
@@ -204,7 +204,7 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setPSButton(boolean value) {
setRawButton(PS5Controller.Button.kPS.value, value);
setRawButton(NiDsPS5Controller.Button.kPS.value, value);
}
/**
@@ -213,18 +213,6 @@ public class PS5ControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setTouchpadButton(boolean value) {
setRawButton(PS5Controller.Button.kTouchpad.value, value);
}
/**
* Change the value of the touchpad button on the controller.
*
* @param value the new value
* @deprecated Use {@link setTouchpadButton} instead. This function is deprecated for removal to
* make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public void setTouchpad(boolean value) {
setRawButton(PS5Controller.Button.kTouchpad.value, value);
setRawButton(NiDsPS5Controller.Button.kTouchpad.value, value);
}
}

View File

@@ -6,17 +6,17 @@
package org.wpilib.simulation;
import org.wpilib.driverstation.StadiaController;
import org.wpilib.driverstation.NiDsStadiaController;
/** Class to control a simulated Stadia controller. */
public class StadiaControllerSim extends GenericHIDSim {
/** Class to control a simulated NiDsStadia controller. */
public class NiDsStadiaControllerSim extends GenericHIDSim {
/**
* Constructs from a StadiaController object.
* Constructs from a NiDsStadiaController object.
*
* @param joystick controller to simulate
*/
@SuppressWarnings("this-escape")
public StadiaControllerSim(StadiaController joystick) {
public NiDsStadiaControllerSim(NiDsStadiaController joystick) {
super(joystick);
setAxesMaximumIndex(4);
setButtonsMaximumIndex(15);
@@ -29,7 +29,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param port port number
*/
@SuppressWarnings("this-escape")
public StadiaControllerSim(int port) {
public NiDsStadiaControllerSim(int port) {
super(port);
setAxesMaximumIndex(4);
setButtonsMaximumIndex(15);
@@ -42,7 +42,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftX(double value) {
setRawAxis(StadiaController.Axis.kLeftX.value, value);
setRawAxis(NiDsStadiaController.Axis.kLeftX.value, value);
}
/**
@@ -51,7 +51,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightX(double value) {
setRawAxis(StadiaController.Axis.kRightX.value, value);
setRawAxis(NiDsStadiaController.Axis.kRightX.value, value);
}
/**
@@ -60,7 +60,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftY(double value) {
setRawAxis(StadiaController.Axis.kLeftY.value, value);
setRawAxis(NiDsStadiaController.Axis.kLeftY.value, value);
}
/**
@@ -69,7 +69,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightY(double value) {
setRawAxis(StadiaController.Axis.kRightY.value, value);
setRawAxis(NiDsStadiaController.Axis.kRightY.value, value);
}
/**
@@ -78,7 +78,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setAButton(boolean value) {
setRawButton(StadiaController.Button.kA.value, value);
setRawButton(NiDsStadiaController.Button.kA.value, value);
}
/**
@@ -87,7 +87,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setBButton(boolean value) {
setRawButton(StadiaController.Button.kB.value, value);
setRawButton(NiDsStadiaController.Button.kB.value, value);
}
/**
@@ -96,7 +96,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setXButton(boolean value) {
setRawButton(StadiaController.Button.kX.value, value);
setRawButton(NiDsStadiaController.Button.kX.value, value);
}
/**
@@ -105,7 +105,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setYButton(boolean value) {
setRawButton(StadiaController.Button.kY.value, value);
setRawButton(NiDsStadiaController.Button.kY.value, value);
}
/**
@@ -114,7 +114,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftBumperButton(boolean value) {
setRawButton(StadiaController.Button.kLeftBumper.value, value);
setRawButton(NiDsStadiaController.Button.kLeftBumper.value, value);
}
/**
@@ -123,7 +123,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightBumperButton(boolean value) {
setRawButton(StadiaController.Button.kRightBumper.value, value);
setRawButton(NiDsStadiaController.Button.kRightBumper.value, value);
}
/**
@@ -132,7 +132,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftStickButton(boolean value) {
setRawButton(StadiaController.Button.kLeftStick.value, value);
setRawButton(NiDsStadiaController.Button.kLeftStick.value, value);
}
/**
@@ -141,7 +141,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightStickButton(boolean value) {
setRawButton(StadiaController.Button.kRightStick.value, value);
setRawButton(NiDsStadiaController.Button.kRightStick.value, value);
}
/**
@@ -150,7 +150,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setEllipsesButton(boolean value) {
setRawButton(StadiaController.Button.kEllipses.value, value);
setRawButton(NiDsStadiaController.Button.kEllipses.value, value);
}
/**
@@ -159,7 +159,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setHamburgerButton(boolean value) {
setRawButton(StadiaController.Button.kHamburger.value, value);
setRawButton(NiDsStadiaController.Button.kHamburger.value, value);
}
/**
@@ -168,7 +168,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setStadiaButton(boolean value) {
setRawButton(StadiaController.Button.kStadia.value, value);
setRawButton(NiDsStadiaController.Button.kStadia.value, value);
}
/**
@@ -177,7 +177,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightTriggerButton(boolean value) {
setRawButton(StadiaController.Button.kRightTrigger.value, value);
setRawButton(NiDsStadiaController.Button.kRightTrigger.value, value);
}
/**
@@ -186,7 +186,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftTriggerButton(boolean value) {
setRawButton(StadiaController.Button.kLeftTrigger.value, value);
setRawButton(NiDsStadiaController.Button.kLeftTrigger.value, value);
}
/**
@@ -195,7 +195,7 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setGoogleButton(boolean value) {
setRawButton(StadiaController.Button.kGoogle.value, value);
setRawButton(NiDsStadiaController.Button.kGoogle.value, value);
}
/**
@@ -204,6 +204,6 @@ public class StadiaControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setFrameButton(boolean value) {
setRawButton(StadiaController.Button.kFrame.value, value);
setRawButton(NiDsStadiaController.Button.kFrame.value, value);
}
}

View File

@@ -6,17 +6,17 @@
package org.wpilib.simulation;
import org.wpilib.driverstation.XboxController;
import org.wpilib.driverstation.NiDsXboxController;
/** Class to control a simulated Xbox controller. */
public class XboxControllerSim extends GenericHIDSim {
/** Class to control a simulated NiDsXbox controller. */
public class NiDsXboxControllerSim extends GenericHIDSim {
/**
* Constructs from a XboxController object.
* Constructs from a NiDsXboxController object.
*
* @param joystick controller to simulate
*/
@SuppressWarnings("this-escape")
public XboxControllerSim(XboxController joystick) {
public NiDsXboxControllerSim(NiDsXboxController joystick) {
super(joystick);
setAxesMaximumIndex(6);
setButtonsMaximumIndex(10);
@@ -29,7 +29,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param port port number
*/
@SuppressWarnings("this-escape")
public XboxControllerSim(int port) {
public NiDsXboxControllerSim(int port) {
super(port);
setAxesMaximumIndex(6);
setButtonsMaximumIndex(10);
@@ -42,7 +42,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftX(double value) {
setRawAxis(XboxController.Axis.kLeftX.value, value);
setRawAxis(NiDsXboxController.Axis.kLeftX.value, value);
}
/**
@@ -51,7 +51,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightX(double value) {
setRawAxis(XboxController.Axis.kRightX.value, value);
setRawAxis(NiDsXboxController.Axis.kRightX.value, value);
}
/**
@@ -60,7 +60,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftY(double value) {
setRawAxis(XboxController.Axis.kLeftY.value, value);
setRawAxis(NiDsXboxController.Axis.kLeftY.value, value);
}
/**
@@ -69,7 +69,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightY(double value) {
setRawAxis(XboxController.Axis.kRightY.value, value);
setRawAxis(NiDsXboxController.Axis.kRightY.value, value);
}
/**
@@ -78,7 +78,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftTriggerAxis(double value) {
setRawAxis(XboxController.Axis.kLeftTrigger.value, value);
setRawAxis(NiDsXboxController.Axis.kLeftTrigger.value, value);
}
/**
@@ -87,7 +87,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightTriggerAxis(double value) {
setRawAxis(XboxController.Axis.kRightTrigger.value, value);
setRawAxis(NiDsXboxController.Axis.kRightTrigger.value, value);
}
/**
@@ -96,7 +96,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setAButton(boolean value) {
setRawButton(XboxController.Button.kA.value, value);
setRawButton(NiDsXboxController.Button.kA.value, value);
}
/**
@@ -105,7 +105,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setBButton(boolean value) {
setRawButton(XboxController.Button.kB.value, value);
setRawButton(NiDsXboxController.Button.kB.value, value);
}
/**
@@ -114,7 +114,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setXButton(boolean value) {
setRawButton(XboxController.Button.kX.value, value);
setRawButton(NiDsXboxController.Button.kX.value, value);
}
/**
@@ -123,7 +123,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setYButton(boolean value) {
setRawButton(XboxController.Button.kY.value, value);
setRawButton(NiDsXboxController.Button.kY.value, value);
}
/**
@@ -132,7 +132,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftBumperButton(boolean value) {
setRawButton(XboxController.Button.kLeftBumper.value, value);
setRawButton(NiDsXboxController.Button.kLeftBumper.value, value);
}
/**
@@ -141,7 +141,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightBumperButton(boolean value) {
setRawButton(XboxController.Button.kRightBumper.value, value);
setRawButton(NiDsXboxController.Button.kRightBumper.value, value);
}
/**
@@ -150,7 +150,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setBackButton(boolean value) {
setRawButton(XboxController.Button.kBack.value, value);
setRawButton(NiDsXboxController.Button.kBack.value, value);
}
/**
@@ -159,7 +159,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setStartButton(boolean value) {
setRawButton(XboxController.Button.kStart.value, value);
setRawButton(NiDsXboxController.Button.kStart.value, value);
}
/**
@@ -168,7 +168,7 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setLeftStickButton(boolean value) {
setRawButton(XboxController.Button.kLeftStick.value, value);
setRawButton(NiDsXboxController.Button.kLeftStick.value, value);
}
/**
@@ -177,30 +177,6 @@ public class XboxControllerSim extends GenericHIDSim {
* @param value the new value
*/
public void setRightStickButton(boolean value) {
setRawButton(XboxController.Button.kRightStick.value, value);
}
/**
* Change the value of the left bumper on the joystick.
*
* @param state the new value
* @deprecated Use {@link setLeftBumperButton} instead. This function is deprecated for removal
* to make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public void setLeftBumper(boolean state) {
setRawButton(XboxController.Button.kLeftBumper.value, state);
}
/**
* Change the value of the right bumper on the joystick.
*
* @param state the new value
* @deprecated Use {@link setRightBumperButton} instead. This function is deprecated for removal
* to make function names consistent to allow the HID classes to be automatically generated.
*/
@Deprecated(since = "2025", forRemoval = true)
public void setRightBumper(boolean state) {
setRawButton(XboxController.Button.kRightBumper.value, state);
setRawButton(NiDsXboxController.Button.kRightStick.value, value);
}
}