mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[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:
@@ -7,26 +7,26 @@
|
||||
package org.wpilib.command2.button;
|
||||
|
||||
import org.wpilib.command2.CommandScheduler;
|
||||
import org.wpilib.driverstation.PS4Controller;
|
||||
import org.wpilib.driverstation.NiDsPS4Controller;
|
||||
import org.wpilib.event.EventLoop;
|
||||
|
||||
/**
|
||||
* A version of {@link PS4Controller} with {@link Trigger} factories for command-based.
|
||||
* A version of {@link NiDsPS4Controller} with {@link Trigger} factories for command-based.
|
||||
*
|
||||
* @see PS4Controller
|
||||
* @see NiDsPS4Controller
|
||||
*/
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CommandPS4Controller extends CommandGenericHID {
|
||||
private final PS4Controller m_hid;
|
||||
public class CommandNiDsPS4Controller extends CommandGenericHID {
|
||||
private final NiDsPS4Controller m_hid;
|
||||
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
*
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandPS4Controller(int port) {
|
||||
public CommandNiDsPS4Controller(int port) {
|
||||
super(port);
|
||||
m_hid = new PS4Controller(port);
|
||||
m_hid = new NiDsPS4Controller(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
@Override
|
||||
public PS4Controller getHID() {
|
||||
public NiDsPS4Controller getHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger square(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kSquare.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kSquare.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger cross(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kCross.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kCross.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +102,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger circle(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kCircle.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kCircle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +124,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger triangle(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kTriangle.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kTriangle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L1(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kL1.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kL1.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +168,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R1(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kR1.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kR1.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +190,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L2(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kL2.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kL2.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,7 +212,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R2(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kR2.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kR2.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,7 +234,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger share(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kShare.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kShare.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +256,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger options(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kOptions.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kOptions.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,7 +278,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L3(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kL3.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kL3.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,7 +300,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R3(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kR3.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kR3.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,7 +322,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger PS(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kPS.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kPS.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,7 +344,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger touchpad(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kTouchpad.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kTouchpad.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7,26 +7,26 @@
|
||||
package org.wpilib.command2.button;
|
||||
|
||||
import org.wpilib.command2.CommandScheduler;
|
||||
import org.wpilib.driverstation.PS5Controller;
|
||||
import org.wpilib.driverstation.NiDsPS5Controller;
|
||||
import org.wpilib.event.EventLoop;
|
||||
|
||||
/**
|
||||
* A version of {@link PS5Controller} with {@link Trigger} factories for command-based.
|
||||
* A version of {@link NiDsPS5Controller} with {@link Trigger} factories for command-based.
|
||||
*
|
||||
* @see PS5Controller
|
||||
* @see NiDsPS5Controller
|
||||
*/
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CommandPS5Controller extends CommandGenericHID {
|
||||
private final PS5Controller m_hid;
|
||||
public class CommandNiDsPS5Controller extends CommandGenericHID {
|
||||
private final NiDsPS5Controller m_hid;
|
||||
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
*
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandPS5Controller(int port) {
|
||||
public CommandNiDsPS5Controller(int port) {
|
||||
super(port);
|
||||
m_hid = new PS5Controller(port);
|
||||
m_hid = new NiDsPS5Controller(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
@Override
|
||||
public PS5Controller getHID() {
|
||||
public NiDsPS5Controller getHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger square(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kSquare.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kSquare.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger cross(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kCross.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kCross.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +102,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger circle(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kCircle.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kCircle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +124,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger triangle(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kTriangle.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kTriangle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L1(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kL1.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kL1.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +168,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R1(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kR1.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kR1.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +190,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L2(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kL2.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kL2.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,7 +212,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R2(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kR2.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kR2.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,7 +234,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger create(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kCreate.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kCreate.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +256,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger options(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kOptions.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kOptions.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,7 +278,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L3(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kL3.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kL3.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,7 +300,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R3(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kR3.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kR3.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,7 +322,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger PS(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kPS.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kPS.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,7 +344,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger touchpad(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kTouchpad.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kTouchpad.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7,26 +7,26 @@
|
||||
package org.wpilib.command2.button;
|
||||
|
||||
import org.wpilib.command2.CommandScheduler;
|
||||
import org.wpilib.driverstation.StadiaController;
|
||||
import org.wpilib.driverstation.NiDsStadiaController;
|
||||
import org.wpilib.event.EventLoop;
|
||||
|
||||
/**
|
||||
* A version of {@link StadiaController} with {@link Trigger} factories for command-based.
|
||||
* A version of {@link NiDsStadiaController} with {@link Trigger} factories for command-based.
|
||||
*
|
||||
* @see StadiaController
|
||||
* @see NiDsStadiaController
|
||||
*/
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CommandStadiaController extends CommandGenericHID {
|
||||
private final StadiaController m_hid;
|
||||
public class CommandNiDsStadiaController extends CommandGenericHID {
|
||||
private final NiDsStadiaController m_hid;
|
||||
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
*
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandStadiaController(int port) {
|
||||
public CommandNiDsStadiaController(int port) {
|
||||
super(port);
|
||||
m_hid = new StadiaController(port);
|
||||
m_hid = new NiDsStadiaController(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
@Override
|
||||
public StadiaController getHID() {
|
||||
public NiDsStadiaController getHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger a(EventLoop loop) {
|
||||
return button(StadiaController.Button.kA.value, loop);
|
||||
return button(NiDsStadiaController.Button.kA.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger b(EventLoop loop) {
|
||||
return button(StadiaController.Button.kB.value, loop);
|
||||
return button(NiDsStadiaController.Button.kB.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +102,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger x(EventLoop loop) {
|
||||
return button(StadiaController.Button.kX.value, loop);
|
||||
return button(NiDsStadiaController.Button.kX.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +124,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger y(EventLoop loop) {
|
||||
return button(StadiaController.Button.kY.value, loop);
|
||||
return button(NiDsStadiaController.Button.kY.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftBumper(EventLoop loop) {
|
||||
return button(StadiaController.Button.kLeftBumper.value, loop);
|
||||
return button(NiDsStadiaController.Button.kLeftBumper.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +168,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightBumper(EventLoop loop) {
|
||||
return button(StadiaController.Button.kRightBumper.value, loop);
|
||||
return button(NiDsStadiaController.Button.kRightBumper.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +190,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftStick(EventLoop loop) {
|
||||
return button(StadiaController.Button.kLeftStick.value, loop);
|
||||
return button(NiDsStadiaController.Button.kLeftStick.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,7 +212,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightStick(EventLoop loop) {
|
||||
return button(StadiaController.Button.kRightStick.value, loop);
|
||||
return button(NiDsStadiaController.Button.kRightStick.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,7 +234,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger ellipses(EventLoop loop) {
|
||||
return button(StadiaController.Button.kEllipses.value, loop);
|
||||
return button(NiDsStadiaController.Button.kEllipses.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +256,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger hamburger(EventLoop loop) {
|
||||
return button(StadiaController.Button.kHamburger.value, loop);
|
||||
return button(NiDsStadiaController.Button.kHamburger.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,7 +278,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger stadia(EventLoop loop) {
|
||||
return button(StadiaController.Button.kStadia.value, loop);
|
||||
return button(NiDsStadiaController.Button.kStadia.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,7 +300,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightTrigger(EventLoop loop) {
|
||||
return button(StadiaController.Button.kRightTrigger.value, loop);
|
||||
return button(NiDsStadiaController.Button.kRightTrigger.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,7 +322,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftTrigger(EventLoop loop) {
|
||||
return button(StadiaController.Button.kLeftTrigger.value, loop);
|
||||
return button(NiDsStadiaController.Button.kLeftTrigger.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,7 +344,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger google(EventLoop loop) {
|
||||
return button(StadiaController.Button.kGoogle.value, loop);
|
||||
return button(NiDsStadiaController.Button.kGoogle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,7 +366,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger frame(EventLoop loop) {
|
||||
return button(StadiaController.Button.kFrame.value, loop);
|
||||
return button(NiDsStadiaController.Button.kFrame.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7,26 +7,26 @@
|
||||
package org.wpilib.command2.button;
|
||||
|
||||
import org.wpilib.command2.CommandScheduler;
|
||||
import org.wpilib.driverstation.XboxController;
|
||||
import org.wpilib.driverstation.NiDsXboxController;
|
||||
import org.wpilib.event.EventLoop;
|
||||
|
||||
/**
|
||||
* A version of {@link XboxController} with {@link Trigger} factories for command-based.
|
||||
* A version of {@link NiDsXboxController} with {@link Trigger} factories for command-based.
|
||||
*
|
||||
* @see XboxController
|
||||
* @see NiDsXboxController
|
||||
*/
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CommandXboxController extends CommandGenericHID {
|
||||
private final XboxController m_hid;
|
||||
public class CommandNiDsXboxController extends CommandGenericHID {
|
||||
private final NiDsXboxController m_hid;
|
||||
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
*
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandXboxController(int port) {
|
||||
public CommandNiDsXboxController(int port) {
|
||||
super(port);
|
||||
m_hid = new XboxController(port);
|
||||
m_hid = new NiDsXboxController(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
@Override
|
||||
public XboxController getHID() {
|
||||
public NiDsXboxController getHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger a(EventLoop loop) {
|
||||
return button(XboxController.Button.kA.value, loop);
|
||||
return button(NiDsXboxController.Button.kA.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger b(EventLoop loop) {
|
||||
return button(XboxController.Button.kB.value, loop);
|
||||
return button(NiDsXboxController.Button.kB.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +102,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger x(EventLoop loop) {
|
||||
return button(XboxController.Button.kX.value, loop);
|
||||
return button(NiDsXboxController.Button.kX.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +124,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger y(EventLoop loop) {
|
||||
return button(XboxController.Button.kY.value, loop);
|
||||
return button(NiDsXboxController.Button.kY.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftBumper(EventLoop loop) {
|
||||
return button(XboxController.Button.kLeftBumper.value, loop);
|
||||
return button(NiDsXboxController.Button.kLeftBumper.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +168,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightBumper(EventLoop loop) {
|
||||
return button(XboxController.Button.kRightBumper.value, loop);
|
||||
return button(NiDsXboxController.Button.kRightBumper.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +190,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger back(EventLoop loop) {
|
||||
return button(XboxController.Button.kBack.value, loop);
|
||||
return button(NiDsXboxController.Button.kBack.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,7 +212,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger start(EventLoop loop) {
|
||||
return button(XboxController.Button.kStart.value, loop);
|
||||
return button(NiDsXboxController.Button.kStart.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,7 +234,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftStick(EventLoop loop) {
|
||||
return button(XboxController.Button.kLeftStick.value, loop);
|
||||
return button(NiDsXboxController.Button.kLeftStick.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +256,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightStick(EventLoop loop) {
|
||||
return button(XboxController.Button.kRightStick.value, loop);
|
||||
return button(NiDsXboxController.Button.kRightStick.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,7 +270,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* threshold, attached to the given event loop
|
||||
*/
|
||||
public Trigger leftTrigger(double threshold, EventLoop loop) {
|
||||
return axisGreaterThan(XboxController.Axis.kLeftTrigger.value, threshold, loop);
|
||||
return axisGreaterThan(NiDsXboxController.Axis.kLeftTrigger.value, threshold, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,7 +309,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* threshold, attached to the given event loop
|
||||
*/
|
||||
public Trigger rightTrigger(double threshold, EventLoop loop) {
|
||||
return axisGreaterThan(XboxController.Axis.kRightTrigger.value, threshold, loop);
|
||||
return axisGreaterThan(NiDsXboxController.Axis.kRightTrigger.value, threshold, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
96
commandsv2/src/generated/main/native/cpp/wpi/commands2/button/CommandNiDsPS4Controller.cpp
generated
Normal file
96
commandsv2/src/generated/main/native/cpp/wpi/commands2/button/CommandNiDsPS4Controller.cpp
generated
Normal file
@@ -0,0 +1,96 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/commands2/button/CommandNiDsPS4Controller.hpp"
|
||||
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandNiDsPS4Controller::CommandNiDsPS4Controller(int port)
|
||||
: CommandGenericHID(port), m_hid{wpi::NiDsPS4Controller(port)} {}
|
||||
|
||||
wpi::NiDsPS4Controller& CommandNiDsPS4Controller::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::Square(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kSquare, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::Cross(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kCross, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::Circle(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kCircle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::Triangle(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kTriangle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::L1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kL1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::R1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kR1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::L2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kL2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::R2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kR2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::Share(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kShare, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::Options(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kOptions, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::L3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kL3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::R3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kR3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::PS(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kPS, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS4Controller::Touchpad(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS4Controller::Button::kTouchpad, loop);
|
||||
}
|
||||
|
||||
double CommandNiDsPS4Controller::GetLeftX() const {
|
||||
return m_hid.GetLeftX();
|
||||
}
|
||||
|
||||
double CommandNiDsPS4Controller::GetLeftY() const {
|
||||
return m_hid.GetLeftY();
|
||||
}
|
||||
|
||||
double CommandNiDsPS4Controller::GetRightX() const {
|
||||
return m_hid.GetRightX();
|
||||
}
|
||||
|
||||
double CommandNiDsPS4Controller::GetRightY() const {
|
||||
return m_hid.GetRightY();
|
||||
}
|
||||
|
||||
double CommandNiDsPS4Controller::GetL2Axis() const {
|
||||
return m_hid.GetL2Axis();
|
||||
}
|
||||
|
||||
double CommandNiDsPS4Controller::GetR2Axis() const {
|
||||
return m_hid.GetR2Axis();
|
||||
}
|
||||
96
commandsv2/src/generated/main/native/cpp/wpi/commands2/button/CommandNiDsPS5Controller.cpp
generated
Normal file
96
commandsv2/src/generated/main/native/cpp/wpi/commands2/button/CommandNiDsPS5Controller.cpp
generated
Normal file
@@ -0,0 +1,96 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/commands2/button/CommandNiDsPS5Controller.hpp"
|
||||
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandNiDsPS5Controller::CommandNiDsPS5Controller(int port)
|
||||
: CommandGenericHID(port), m_hid{wpi::NiDsPS5Controller(port)} {}
|
||||
|
||||
wpi::NiDsPS5Controller& CommandNiDsPS5Controller::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::Square(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kSquare, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::Cross(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kCross, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::Circle(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kCircle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::Triangle(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kTriangle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::L1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kL1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::R1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kR1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::L2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kL2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::R2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kR2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::Create(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kCreate, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::Options(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kOptions, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::L3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kL3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::R3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kR3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::PS(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kPS, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsPS5Controller::Touchpad(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsPS5Controller::Button::kTouchpad, loop);
|
||||
}
|
||||
|
||||
double CommandNiDsPS5Controller::GetLeftX() const {
|
||||
return m_hid.GetLeftX();
|
||||
}
|
||||
|
||||
double CommandNiDsPS5Controller::GetLeftY() const {
|
||||
return m_hid.GetLeftY();
|
||||
}
|
||||
|
||||
double CommandNiDsPS5Controller::GetRightX() const {
|
||||
return m_hid.GetRightX();
|
||||
}
|
||||
|
||||
double CommandNiDsPS5Controller::GetRightY() const {
|
||||
return m_hid.GetRightY();
|
||||
}
|
||||
|
||||
double CommandNiDsPS5Controller::GetL2Axis() const {
|
||||
return m_hid.GetL2Axis();
|
||||
}
|
||||
|
||||
double CommandNiDsPS5Controller::GetR2Axis() const {
|
||||
return m_hid.GetR2Axis();
|
||||
}
|
||||
92
commandsv2/src/generated/main/native/cpp/wpi/commands2/button/CommandNiDsStadiaController.cpp
generated
Normal file
92
commandsv2/src/generated/main/native/cpp/wpi/commands2/button/CommandNiDsStadiaController.cpp
generated
Normal file
@@ -0,0 +1,92 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/commands2/button/CommandNiDsStadiaController.hpp"
|
||||
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandNiDsStadiaController::CommandNiDsStadiaController(int port)
|
||||
: CommandGenericHID(port), m_hid{wpi::NiDsStadiaController(port)} {}
|
||||
|
||||
wpi::NiDsStadiaController& CommandNiDsStadiaController::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::A(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kA, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::B(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kB, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::X(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kX, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::Y(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kY, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::LeftBumper(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kLeftBumper, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::RightBumper(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kRightBumper, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::LeftStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kLeftStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::RightStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kRightStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::Ellipses(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kEllipses, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::Hamburger(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kHamburger, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::Stadia(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kStadia, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::RightTrigger(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kRightTrigger, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::LeftTrigger(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kLeftTrigger, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::Google(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kGoogle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsStadiaController::Frame(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsStadiaController::Button::kFrame, loop);
|
||||
}
|
||||
|
||||
double CommandNiDsStadiaController::GetLeftX() const {
|
||||
return m_hid.GetLeftX();
|
||||
}
|
||||
|
||||
double CommandNiDsStadiaController::GetRightX() const {
|
||||
return m_hid.GetRightX();
|
||||
}
|
||||
|
||||
double CommandNiDsStadiaController::GetLeftY() const {
|
||||
return m_hid.GetLeftY();
|
||||
}
|
||||
|
||||
double CommandNiDsStadiaController::GetRightY() const {
|
||||
return m_hid.GetRightY();
|
||||
}
|
||||
94
commandsv2/src/generated/main/native/cpp/wpi/commands2/button/CommandNiDsXboxController.cpp
generated
Normal file
94
commandsv2/src/generated/main/native/cpp/wpi/commands2/button/CommandNiDsXboxController.cpp
generated
Normal file
@@ -0,0 +1,94 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/commands2/button/CommandNiDsXboxController.hpp"
|
||||
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandNiDsXboxController::CommandNiDsXboxController(int port)
|
||||
: CommandGenericHID(port), m_hid{wpi::NiDsXboxController(port)} {}
|
||||
|
||||
wpi::NiDsXboxController& CommandNiDsXboxController::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::A(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kA, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::B(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kB, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::X(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kX, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::Y(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kY, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::LeftBumper(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kLeftBumper, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::RightBumper(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kRightBumper, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::Back(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kBack, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::Start(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kStart, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::LeftStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kLeftStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::RightStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::NiDsXboxController::Button::kRightStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::LeftTrigger(double threshold,
|
||||
wpi::EventLoop* loop) const {
|
||||
return Trigger(loop, [this, threshold] {
|
||||
return m_hid.GetLeftTriggerAxis() > threshold;
|
||||
});
|
||||
}
|
||||
|
||||
Trigger CommandNiDsXboxController::RightTrigger(double threshold,
|
||||
wpi::EventLoop* loop) const {
|
||||
return Trigger(loop, [this, threshold] {
|
||||
return m_hid.GetRightTriggerAxis() > threshold;
|
||||
});
|
||||
}
|
||||
|
||||
double CommandNiDsXboxController::GetLeftX() const {
|
||||
return m_hid.GetLeftX();
|
||||
}
|
||||
|
||||
double CommandNiDsXboxController::GetRightX() const {
|
||||
return m_hid.GetRightX();
|
||||
}
|
||||
|
||||
double CommandNiDsXboxController::GetLeftY() const {
|
||||
return m_hid.GetLeftY();
|
||||
}
|
||||
|
||||
double CommandNiDsXboxController::GetRightY() const {
|
||||
return m_hid.GetRightY();
|
||||
}
|
||||
|
||||
double CommandNiDsXboxController::GetLeftTriggerAxis() const {
|
||||
return m_hid.GetLeftTriggerAxis();
|
||||
}
|
||||
|
||||
double CommandNiDsXboxController::GetRightTriggerAxis() const {
|
||||
return m_hid.GetRightTriggerAxis();
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/commands2/button/CommandPS4Controller.hpp"
|
||||
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandPS4Controller::CommandPS4Controller(int port)
|
||||
: CommandGenericHID(port), m_hid{wpi::PS4Controller(port)} {}
|
||||
|
||||
wpi::PS4Controller& CommandPS4Controller::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::Square(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kSquare, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::Cross(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kCross, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::Circle(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kCircle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::Triangle(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kTriangle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::L1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kL1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::R1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kR1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::L2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kL2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::R2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kR2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::Share(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kShare, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::Options(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kOptions, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::L3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kL3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::R3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kR3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::PS(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kPS, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS4Controller::Touchpad(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS4Controller::Button::kTouchpad, loop);
|
||||
}
|
||||
|
||||
double CommandPS4Controller::GetLeftX() const {
|
||||
return m_hid.GetLeftX();
|
||||
}
|
||||
|
||||
double CommandPS4Controller::GetLeftY() const {
|
||||
return m_hid.GetLeftY();
|
||||
}
|
||||
|
||||
double CommandPS4Controller::GetRightX() const {
|
||||
return m_hid.GetRightX();
|
||||
}
|
||||
|
||||
double CommandPS4Controller::GetRightY() const {
|
||||
return m_hid.GetRightY();
|
||||
}
|
||||
|
||||
double CommandPS4Controller::GetL2Axis() const {
|
||||
return m_hid.GetL2Axis();
|
||||
}
|
||||
|
||||
double CommandPS4Controller::GetR2Axis() const {
|
||||
return m_hid.GetR2Axis();
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/commands2/button/CommandPS5Controller.hpp"
|
||||
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandPS5Controller::CommandPS5Controller(int port)
|
||||
: CommandGenericHID(port), m_hid{wpi::PS5Controller(port)} {}
|
||||
|
||||
wpi::PS5Controller& CommandPS5Controller::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::Square(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kSquare, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::Cross(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kCross, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::Circle(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kCircle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::Triangle(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kTriangle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::L1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kL1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::R1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kR1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::L2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kL2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::R2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kR2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::Create(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kCreate, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::Options(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kOptions, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::L3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kL3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::R3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kR3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::PS(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kPS, loop);
|
||||
}
|
||||
|
||||
Trigger CommandPS5Controller::Touchpad(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::PS5Controller::Button::kTouchpad, loop);
|
||||
}
|
||||
|
||||
double CommandPS5Controller::GetLeftX() const {
|
||||
return m_hid.GetLeftX();
|
||||
}
|
||||
|
||||
double CommandPS5Controller::GetLeftY() const {
|
||||
return m_hid.GetLeftY();
|
||||
}
|
||||
|
||||
double CommandPS5Controller::GetRightX() const {
|
||||
return m_hid.GetRightX();
|
||||
}
|
||||
|
||||
double CommandPS5Controller::GetRightY() const {
|
||||
return m_hid.GetRightY();
|
||||
}
|
||||
|
||||
double CommandPS5Controller::GetL2Axis() const {
|
||||
return m_hid.GetL2Axis();
|
||||
}
|
||||
|
||||
double CommandPS5Controller::GetR2Axis() const {
|
||||
return m_hid.GetR2Axis();
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/commands2/button/CommandStadiaController.hpp"
|
||||
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandStadiaController::CommandStadiaController(int port)
|
||||
: CommandGenericHID(port), m_hid{wpi::StadiaController(port)} {}
|
||||
|
||||
wpi::StadiaController& CommandStadiaController::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::A(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kA, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::B(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kB, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::X(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kX, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::Y(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kY, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::LeftBumper(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kLeftBumper, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::RightBumper(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kRightBumper, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::LeftStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kLeftStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::RightStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kRightStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::Ellipses(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kEllipses, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::Hamburger(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kHamburger, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::Stadia(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kStadia, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::RightTrigger(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kRightTrigger, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::LeftTrigger(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kLeftTrigger, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::Google(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kGoogle, loop);
|
||||
}
|
||||
|
||||
Trigger CommandStadiaController::Frame(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::StadiaController::Button::kFrame, loop);
|
||||
}
|
||||
|
||||
double CommandStadiaController::GetLeftX() const {
|
||||
return m_hid.GetLeftX();
|
||||
}
|
||||
|
||||
double CommandStadiaController::GetRightX() const {
|
||||
return m_hid.GetRightX();
|
||||
}
|
||||
|
||||
double CommandStadiaController::GetLeftY() const {
|
||||
return m_hid.GetLeftY();
|
||||
}
|
||||
|
||||
double CommandStadiaController::GetRightY() const {
|
||||
return m_hid.GetRightY();
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./commandsv2/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/commands2/button/CommandXboxController.hpp"
|
||||
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandXboxController::CommandXboxController(int port)
|
||||
: CommandGenericHID(port), m_hid{wpi::XboxController(port)} {}
|
||||
|
||||
wpi::XboxController& CommandXboxController::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::A(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kA, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::B(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kB, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::X(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kX, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::Y(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kY, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::LeftBumper(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kLeftBumper, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::RightBumper(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kRightBumper, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::Back(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kBack, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::Start(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kStart, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::LeftStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kLeftStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::RightStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::XboxController::Button::kRightStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::LeftTrigger(double threshold,
|
||||
wpi::EventLoop* loop) const {
|
||||
return Trigger(loop, [this, threshold] {
|
||||
return m_hid.GetLeftTriggerAxis() > threshold;
|
||||
});
|
||||
}
|
||||
|
||||
Trigger CommandXboxController::RightTrigger(double threshold,
|
||||
wpi::EventLoop* loop) const {
|
||||
return Trigger(loop, [this, threshold] {
|
||||
return m_hid.GetRightTriggerAxis() > threshold;
|
||||
});
|
||||
}
|
||||
|
||||
double CommandXboxController::GetLeftX() const {
|
||||
return m_hid.GetLeftX();
|
||||
}
|
||||
|
||||
double CommandXboxController::GetRightX() const {
|
||||
return m_hid.GetRightX();
|
||||
}
|
||||
|
||||
double CommandXboxController::GetLeftY() const {
|
||||
return m_hid.GetLeftY();
|
||||
}
|
||||
|
||||
double CommandXboxController::GetRightY() const {
|
||||
return m_hid.GetRightY();
|
||||
}
|
||||
|
||||
double CommandXboxController::GetLeftTriggerAxis() const {
|
||||
return m_hid.GetLeftTriggerAxis();
|
||||
}
|
||||
|
||||
double CommandXboxController::GetRightTriggerAxis() const {
|
||||
return m_hid.GetRightTriggerAxis();
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "wpi/driverstation/PS4Controller.hpp"
|
||||
#include "wpi/driverstation/NiDsPS4Controller.hpp"
|
||||
|
||||
#include "wpi/commands2/button/Trigger.hpp"
|
||||
#include "wpi/commands2/CommandScheduler.hpp"
|
||||
@@ -14,12 +14,12 @@
|
||||
|
||||
namespace wpi::cmd {
|
||||
/**
|
||||
* A version of {@link wpi::PS4Controller} with {@link Trigger} factories for
|
||||
* A version of {@link wpi::NiDsPS4Controller} with {@link Trigger} factories for
|
||||
* command-based.
|
||||
*
|
||||
* @see wpi::PS4Controller
|
||||
* @see wpi::NiDsPS4Controller
|
||||
*/
|
||||
class CommandPS4Controller : public CommandGenericHID {
|
||||
class CommandNiDsPS4Controller : public CommandGenericHID {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -27,14 +27,14 @@ class CommandPS4Controller : public CommandGenericHID {
|
||||
* @param port The port index on the Driver Station that the controller is
|
||||
* plugged into.
|
||||
*/
|
||||
explicit CommandPS4Controller(int port);
|
||||
explicit CommandNiDsPS4Controller(int port);
|
||||
|
||||
/**
|
||||
* Get the underlying GenericHID object.
|
||||
*
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
wpi::PS4Controller& GetHID();
|
||||
wpi::NiDsPS4Controller& GetHID();
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance around the square button's
|
||||
@@ -249,6 +249,6 @@ class CommandPS4Controller : public CommandGenericHID {
|
||||
double GetR2Axis() const;
|
||||
|
||||
private:
|
||||
wpi::PS4Controller m_hid;
|
||||
wpi::NiDsPS4Controller m_hid;
|
||||
};
|
||||
} // namespace wpi::cmd
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "wpi/driverstation/PS5Controller.hpp"
|
||||
#include "wpi/driverstation/NiDsPS5Controller.hpp"
|
||||
|
||||
#include "wpi/commands2/button/Trigger.hpp"
|
||||
#include "wpi/commands2/CommandScheduler.hpp"
|
||||
@@ -14,12 +14,12 @@
|
||||
|
||||
namespace wpi::cmd {
|
||||
/**
|
||||
* A version of {@link wpi::PS5Controller} with {@link Trigger} factories for
|
||||
* A version of {@link wpi::NiDsPS5Controller} with {@link Trigger} factories for
|
||||
* command-based.
|
||||
*
|
||||
* @see wpi::PS5Controller
|
||||
* @see wpi::NiDsPS5Controller
|
||||
*/
|
||||
class CommandPS5Controller : public CommandGenericHID {
|
||||
class CommandNiDsPS5Controller : public CommandGenericHID {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -27,14 +27,14 @@ class CommandPS5Controller : public CommandGenericHID {
|
||||
* @param port The port index on the Driver Station that the controller is
|
||||
* plugged into.
|
||||
*/
|
||||
explicit CommandPS5Controller(int port);
|
||||
explicit CommandNiDsPS5Controller(int port);
|
||||
|
||||
/**
|
||||
* Get the underlying GenericHID object.
|
||||
*
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
wpi::PS5Controller& GetHID();
|
||||
wpi::NiDsPS5Controller& GetHID();
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance around the square button's
|
||||
@@ -249,6 +249,6 @@ class CommandPS5Controller : public CommandGenericHID {
|
||||
double GetR2Axis() const;
|
||||
|
||||
private:
|
||||
wpi::PS5Controller m_hid;
|
||||
wpi::NiDsPS5Controller m_hid;
|
||||
};
|
||||
} // namespace wpi::cmd
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "wpi/driverstation/StadiaController.hpp"
|
||||
#include "wpi/driverstation/NiDsStadiaController.hpp"
|
||||
|
||||
#include "wpi/commands2/button/Trigger.hpp"
|
||||
#include "wpi/commands2/CommandScheduler.hpp"
|
||||
@@ -14,12 +14,12 @@
|
||||
|
||||
namespace wpi::cmd {
|
||||
/**
|
||||
* A version of {@link wpi::StadiaController} with {@link Trigger} factories for
|
||||
* A version of {@link wpi::NiDsStadiaController} with {@link Trigger} factories for
|
||||
* command-based.
|
||||
*
|
||||
* @see wpi::StadiaController
|
||||
* @see wpi::NiDsStadiaController
|
||||
*/
|
||||
class CommandStadiaController : public CommandGenericHID {
|
||||
class CommandNiDsStadiaController : public CommandGenericHID {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -27,14 +27,14 @@ class CommandStadiaController : public CommandGenericHID {
|
||||
* @param port The port index on the Driver Station that the controller is
|
||||
* plugged into.
|
||||
*/
|
||||
explicit CommandStadiaController(int port);
|
||||
explicit CommandNiDsStadiaController(int port);
|
||||
|
||||
/**
|
||||
* Get the underlying GenericHID object.
|
||||
*
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
wpi::StadiaController& GetHID();
|
||||
wpi::NiDsStadiaController& GetHID();
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance around the A button's
|
||||
@@ -245,6 +245,6 @@ class CommandStadiaController : public CommandGenericHID {
|
||||
double GetRightY() const;
|
||||
|
||||
private:
|
||||
wpi::StadiaController m_hid;
|
||||
wpi::NiDsStadiaController m_hid;
|
||||
};
|
||||
} // namespace wpi::cmd
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/NiDsXboxController.hpp"
|
||||
|
||||
#include "wpi/commands2/button/Trigger.hpp"
|
||||
#include "wpi/commands2/CommandScheduler.hpp"
|
||||
@@ -14,12 +14,12 @@
|
||||
|
||||
namespace wpi::cmd {
|
||||
/**
|
||||
* A version of {@link wpi::XboxController} with {@link Trigger} factories for
|
||||
* A version of {@link wpi::NiDsXboxController} with {@link Trigger} factories for
|
||||
* command-based.
|
||||
*
|
||||
* @see wpi::XboxController
|
||||
* @see wpi::NiDsXboxController
|
||||
*/
|
||||
class CommandXboxController : public CommandGenericHID {
|
||||
class CommandNiDsXboxController : public CommandGenericHID {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -27,14 +27,14 @@ class CommandXboxController : public CommandGenericHID {
|
||||
* @param port The port index on the Driver Station that the controller is
|
||||
* plugged into.
|
||||
*/
|
||||
explicit CommandXboxController(int port);
|
||||
explicit CommandNiDsXboxController(int port);
|
||||
|
||||
/**
|
||||
* Get the underlying GenericHID object.
|
||||
*
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
wpi::XboxController& GetHID();
|
||||
wpi::NiDsXboxController& GetHID();
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance around the A button's
|
||||
@@ -235,6 +235,6 @@ class CommandXboxController : public CommandGenericHID {
|
||||
double GetRightTriggerAxis() const;
|
||||
|
||||
private:
|
||||
wpi::XboxController m_hid;
|
||||
wpi::NiDsXboxController m_hid;
|
||||
};
|
||||
} // namespace wpi::cmd
|
||||
@@ -1,7 +1,7 @@
|
||||
from .commandgenerichid import CommandGenericHID
|
||||
from .commandjoystick import CommandJoystick
|
||||
from .commandps4controller import CommandPS4Controller
|
||||
from .commandxboxcontroller import CommandXboxController
|
||||
from .commandnidsps4controller import CommandNiDsPS4Controller
|
||||
from .commandnidsxboxcontroller import CommandNiDsXboxController
|
||||
from .joystickbutton import JoystickButton
|
||||
from .networkbutton import NetworkButton
|
||||
from .povbutton import POVButton
|
||||
@@ -11,8 +11,8 @@ __all__ = [
|
||||
"Trigger",
|
||||
"CommandGenericHID",
|
||||
"CommandJoystick",
|
||||
"CommandPS4Controller",
|
||||
"CommandXboxController",
|
||||
"CommandNiDsPS4Controller",
|
||||
"CommandNiDsXboxController",
|
||||
"JoystickButton",
|
||||
"NetworkButton",
|
||||
"POVButton",
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# validated: 2024-01-20 DS d426873ed15b button/CommandPS4Controller.java
|
||||
# validated: 2024-01-20 DS d426873ed15b button/CommandNiDsPS4Controller.java
|
||||
from typing import Optional
|
||||
|
||||
from wpilib import EventLoop, PS4Controller
|
||||
from wpilib import EventLoop, NiDsPS4Controller
|
||||
|
||||
from ..commandscheduler import CommandScheduler
|
||||
from .commandgenerichid import CommandGenericHID
|
||||
from .trigger import Trigger
|
||||
|
||||
|
||||
class CommandPS4Controller(CommandGenericHID):
|
||||
class CommandNiDsPS4Controller(CommandGenericHID):
|
||||
"""
|
||||
A version of PS4Controller with Trigger factories for command-based.
|
||||
A version of NI DS PS4Controller with Trigger factories for command-based.
|
||||
"""
|
||||
|
||||
_hid: PS4Controller
|
||||
_hid: NiDsPS4Controller
|
||||
|
||||
def __init__(self, port: int):
|
||||
"""
|
||||
@@ -22,9 +22,9 @@ class CommandPS4Controller(CommandGenericHID):
|
||||
:param port: The port index on the Driver Station that the device is plugged into.
|
||||
"""
|
||||
super().__init__(port)
|
||||
self._hid = PS4Controller(port)
|
||||
self._hid = NiDsPS4Controller(port)
|
||||
|
||||
def getHID(self) -> PS4Controller:
|
||||
def getHID(self) -> NiDsPS4Controller:
|
||||
"""
|
||||
Get the underlying GenericHID object.
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# validated: 2024-01-20 DS 3ba501f9478a button/CommandXboxController.java
|
||||
from typing import Optional
|
||||
|
||||
from wpilib import EventLoop, XboxController
|
||||
from wpilib import EventLoop, NiDsXboxController
|
||||
|
||||
from ..commandscheduler import CommandScheduler
|
||||
from .commandgenerichid import CommandGenericHID
|
||||
from .trigger import Trigger
|
||||
|
||||
|
||||
class CommandXboxController(CommandGenericHID):
|
||||
class CommandNiDsXboxController(CommandGenericHID):
|
||||
"""
|
||||
A version of XboxController with Trigger factories for command-based.
|
||||
A version of NI DS XboxController with Trigger factories for command-based.
|
||||
"""
|
||||
|
||||
_hid: XboxController
|
||||
_hid: NiDsXboxController
|
||||
|
||||
def __init__(self, port: int):
|
||||
"""
|
||||
@@ -22,9 +22,9 @@ class CommandXboxController(CommandGenericHID):
|
||||
:param port: The port index on the Driver Station that the controller is plugged into.
|
||||
"""
|
||||
super().__init__(port)
|
||||
self._hid = XboxController(port)
|
||||
self._hid = NiDsXboxController(port)
|
||||
|
||||
def getHID(self) -> XboxController:
|
||||
def getHID(self) -> NiDsXboxController:
|
||||
"""
|
||||
Get the underlying GenericHID object.
|
||||
|
||||
@@ -8,17 +8,17 @@ package org.wpilib.command3.button;
|
||||
|
||||
import org.wpilib.command3.Scheduler;
|
||||
import org.wpilib.command3.Trigger;
|
||||
import org.wpilib.driverstation.PS4Controller;
|
||||
import org.wpilib.driverstation.NiDsPS4Controller;
|
||||
import org.wpilib.event.EventLoop;
|
||||
|
||||
/**
|
||||
* A version of {@link PS4Controller} with {@link Trigger} factories for command-based.
|
||||
* A version of {@link NiDsPS4Controller} with {@link Trigger} factories for command-based.
|
||||
*
|
||||
* @see PS4Controller
|
||||
* @see NiDsPS4Controller
|
||||
*/
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CommandPS4Controller extends CommandGenericHID {
|
||||
private final PS4Controller m_hid;
|
||||
public class CommandNiDsPS4Controller extends CommandGenericHID {
|
||||
private final NiDsPS4Controller m_hid;
|
||||
|
||||
/**
|
||||
* Construct an instance of a controller. Commands bound to buttons on the controller will be
|
||||
@@ -26,9 +26,9 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
*
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandPS4Controller(int port) {
|
||||
public CommandNiDsPS4Controller(int port) {
|
||||
super(port);
|
||||
m_hid = new PS4Controller(port);
|
||||
m_hid = new NiDsPS4Controller(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,9 +38,9 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* @param scheduler The scheduler that should execute the triggered commands.
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandPS4Controller(Scheduler scheduler, int port) {
|
||||
public CommandNiDsPS4Controller(Scheduler scheduler, int port) {
|
||||
super(scheduler, port);
|
||||
m_hid = new PS4Controller(port);
|
||||
m_hid = new NiDsPS4Controller(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
@Override
|
||||
public PS4Controller getHID() {
|
||||
public NiDsPS4Controller getHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger square(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kSquare.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kSquare.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger cross(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kCross.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kCross.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger circle(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kCircle.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kCircle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger triangle(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kTriangle.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kTriangle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L1(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kL1.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kL1.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,7 +194,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R1(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kR1.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kR1.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L2(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kL2.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kL2.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,7 +242,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R2(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kR2.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kR2.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,7 +266,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger share(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kShare.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kShare.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,7 +290,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger options(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kOptions.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kOptions.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,7 +314,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L3(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kL3.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kL3.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,7 +338,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R3(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kR3.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kR3.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +362,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger PS(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kPS.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kPS.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -386,7 +386,7 @@ public class CommandPS4Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger touchpad(EventLoop loop) {
|
||||
return button(PS4Controller.Button.kTouchpad.value, loop);
|
||||
return button(NiDsPS4Controller.Button.kTouchpad.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -8,17 +8,17 @@ package org.wpilib.command3.button;
|
||||
|
||||
import org.wpilib.command3.Scheduler;
|
||||
import org.wpilib.command3.Trigger;
|
||||
import org.wpilib.driverstation.PS5Controller;
|
||||
import org.wpilib.driverstation.NiDsPS5Controller;
|
||||
import org.wpilib.event.EventLoop;
|
||||
|
||||
/**
|
||||
* A version of {@link PS5Controller} with {@link Trigger} factories for command-based.
|
||||
* A version of {@link NiDsPS5Controller} with {@link Trigger} factories for command-based.
|
||||
*
|
||||
* @see PS5Controller
|
||||
* @see NiDsPS5Controller
|
||||
*/
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CommandPS5Controller extends CommandGenericHID {
|
||||
private final PS5Controller m_hid;
|
||||
public class CommandNiDsPS5Controller extends CommandGenericHID {
|
||||
private final NiDsPS5Controller m_hid;
|
||||
|
||||
/**
|
||||
* Construct an instance of a controller. Commands bound to buttons on the controller will be
|
||||
@@ -26,9 +26,9 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
*
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandPS5Controller(int port) {
|
||||
public CommandNiDsPS5Controller(int port) {
|
||||
super(port);
|
||||
m_hid = new PS5Controller(port);
|
||||
m_hid = new NiDsPS5Controller(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,9 +38,9 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* @param scheduler The scheduler that should execute the triggered commands.
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandPS5Controller(Scheduler scheduler, int port) {
|
||||
public CommandNiDsPS5Controller(Scheduler scheduler, int port) {
|
||||
super(scheduler, port);
|
||||
m_hid = new PS5Controller(port);
|
||||
m_hid = new NiDsPS5Controller(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
@Override
|
||||
public PS5Controller getHID() {
|
||||
public NiDsPS5Controller getHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger square(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kSquare.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kSquare.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger cross(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kCross.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kCross.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger circle(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kCircle.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kCircle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger triangle(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kTriangle.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kTriangle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L1(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kL1.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kL1.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,7 +194,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R1(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kR1.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kR1.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L2(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kL2.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kL2.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,7 +242,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R2(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kR2.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kR2.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,7 +266,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger create(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kCreate.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kCreate.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,7 +290,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger options(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kOptions.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kOptions.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,7 +314,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger L3(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kL3.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kL3.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,7 +338,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger R3(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kR3.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kR3.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +362,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger PS(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kPS.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kPS.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -386,7 +386,7 @@ public class CommandPS5Controller extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger touchpad(EventLoop loop) {
|
||||
return button(PS5Controller.Button.kTouchpad.value, loop);
|
||||
return button(NiDsPS5Controller.Button.kTouchpad.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -8,17 +8,17 @@ package org.wpilib.command3.button;
|
||||
|
||||
import org.wpilib.command3.Scheduler;
|
||||
import org.wpilib.command3.Trigger;
|
||||
import org.wpilib.driverstation.StadiaController;
|
||||
import org.wpilib.driverstation.NiDsStadiaController;
|
||||
import org.wpilib.event.EventLoop;
|
||||
|
||||
/**
|
||||
* A version of {@link StadiaController} with {@link Trigger} factories for command-based.
|
||||
* A version of {@link NiDsStadiaController} with {@link Trigger} factories for command-based.
|
||||
*
|
||||
* @see StadiaController
|
||||
* @see NiDsStadiaController
|
||||
*/
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CommandStadiaController extends CommandGenericHID {
|
||||
private final StadiaController m_hid;
|
||||
public class CommandNiDsStadiaController extends CommandGenericHID {
|
||||
private final NiDsStadiaController m_hid;
|
||||
|
||||
/**
|
||||
* Construct an instance of a controller. Commands bound to buttons on the controller will be
|
||||
@@ -26,9 +26,9 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
*
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandStadiaController(int port) {
|
||||
public CommandNiDsStadiaController(int port) {
|
||||
super(port);
|
||||
m_hid = new StadiaController(port);
|
||||
m_hid = new NiDsStadiaController(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,9 +38,9 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* @param scheduler The scheduler that should execute the triggered commands.
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandStadiaController(Scheduler scheduler, int port) {
|
||||
public CommandNiDsStadiaController(Scheduler scheduler, int port) {
|
||||
super(scheduler, port);
|
||||
m_hid = new StadiaController(port);
|
||||
m_hid = new NiDsStadiaController(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
@Override
|
||||
public StadiaController getHID() {
|
||||
public NiDsStadiaController getHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger a(EventLoop loop) {
|
||||
return button(StadiaController.Button.kA.value, loop);
|
||||
return button(NiDsStadiaController.Button.kA.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger b(EventLoop loop) {
|
||||
return button(StadiaController.Button.kB.value, loop);
|
||||
return button(NiDsStadiaController.Button.kB.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger x(EventLoop loop) {
|
||||
return button(StadiaController.Button.kX.value, loop);
|
||||
return button(NiDsStadiaController.Button.kX.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger y(EventLoop loop) {
|
||||
return button(StadiaController.Button.kY.value, loop);
|
||||
return button(NiDsStadiaController.Button.kY.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftBumper(EventLoop loop) {
|
||||
return button(StadiaController.Button.kLeftBumper.value, loop);
|
||||
return button(NiDsStadiaController.Button.kLeftBumper.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,7 +194,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightBumper(EventLoop loop) {
|
||||
return button(StadiaController.Button.kRightBumper.value, loop);
|
||||
return button(NiDsStadiaController.Button.kRightBumper.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftStick(EventLoop loop) {
|
||||
return button(StadiaController.Button.kLeftStick.value, loop);
|
||||
return button(NiDsStadiaController.Button.kLeftStick.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,7 +242,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightStick(EventLoop loop) {
|
||||
return button(StadiaController.Button.kRightStick.value, loop);
|
||||
return button(NiDsStadiaController.Button.kRightStick.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,7 +266,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger ellipses(EventLoop loop) {
|
||||
return button(StadiaController.Button.kEllipses.value, loop);
|
||||
return button(NiDsStadiaController.Button.kEllipses.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,7 +290,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger hamburger(EventLoop loop) {
|
||||
return button(StadiaController.Button.kHamburger.value, loop);
|
||||
return button(NiDsStadiaController.Button.kHamburger.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,7 +314,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger stadia(EventLoop loop) {
|
||||
return button(StadiaController.Button.kStadia.value, loop);
|
||||
return button(NiDsStadiaController.Button.kStadia.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,7 +338,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightTrigger(EventLoop loop) {
|
||||
return button(StadiaController.Button.kRightTrigger.value, loop);
|
||||
return button(NiDsStadiaController.Button.kRightTrigger.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +362,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftTrigger(EventLoop loop) {
|
||||
return button(StadiaController.Button.kLeftTrigger.value, loop);
|
||||
return button(NiDsStadiaController.Button.kLeftTrigger.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -386,7 +386,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger google(EventLoop loop) {
|
||||
return button(StadiaController.Button.kGoogle.value, loop);
|
||||
return button(NiDsStadiaController.Button.kGoogle.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -410,7 +410,7 @@ public class CommandStadiaController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger frame(EventLoop loop) {
|
||||
return button(StadiaController.Button.kFrame.value, loop);
|
||||
return button(NiDsStadiaController.Button.kFrame.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -8,17 +8,17 @@ package org.wpilib.command3.button;
|
||||
|
||||
import org.wpilib.command3.Scheduler;
|
||||
import org.wpilib.command3.Trigger;
|
||||
import org.wpilib.driverstation.XboxController;
|
||||
import org.wpilib.driverstation.NiDsXboxController;
|
||||
import org.wpilib.event.EventLoop;
|
||||
|
||||
/**
|
||||
* A version of {@link XboxController} with {@link Trigger} factories for command-based.
|
||||
* A version of {@link NiDsXboxController} with {@link Trigger} factories for command-based.
|
||||
*
|
||||
* @see XboxController
|
||||
* @see NiDsXboxController
|
||||
*/
|
||||
@SuppressWarnings("MethodName")
|
||||
public class CommandXboxController extends CommandGenericHID {
|
||||
private final XboxController m_hid;
|
||||
public class CommandNiDsXboxController extends CommandGenericHID {
|
||||
private final NiDsXboxController m_hid;
|
||||
|
||||
/**
|
||||
* Construct an instance of a controller. Commands bound to buttons on the controller will be
|
||||
@@ -26,9 +26,9 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
*
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandXboxController(int port) {
|
||||
public CommandNiDsXboxController(int port) {
|
||||
super(port);
|
||||
m_hid = new XboxController(port);
|
||||
m_hid = new NiDsXboxController(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,9 +38,9 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* @param scheduler The scheduler that should execute the triggered commands.
|
||||
* @param port The port index on the Driver Station that the controller is plugged into.
|
||||
*/
|
||||
public CommandXboxController(Scheduler scheduler, int port) {
|
||||
public CommandNiDsXboxController(Scheduler scheduler, int port) {
|
||||
super(scheduler, port);
|
||||
m_hid = new XboxController(port);
|
||||
m_hid = new NiDsXboxController(port);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* @return the wrapped GenericHID object
|
||||
*/
|
||||
@Override
|
||||
public XboxController getHID() {
|
||||
public NiDsXboxController getHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger a(EventLoop loop) {
|
||||
return button(XboxController.Button.kA.value, loop);
|
||||
return button(NiDsXboxController.Button.kA.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger b(EventLoop loop) {
|
||||
return button(XboxController.Button.kB.value, loop);
|
||||
return button(NiDsXboxController.Button.kB.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger x(EventLoop loop) {
|
||||
return button(XboxController.Button.kX.value, loop);
|
||||
return button(NiDsXboxController.Button.kX.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger y(EventLoop loop) {
|
||||
return button(XboxController.Button.kY.value, loop);
|
||||
return button(NiDsXboxController.Button.kY.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftBumper(EventLoop loop) {
|
||||
return button(XboxController.Button.kLeftBumper.value, loop);
|
||||
return button(NiDsXboxController.Button.kLeftBumper.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,7 +194,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightBumper(EventLoop loop) {
|
||||
return button(XboxController.Button.kRightBumper.value, loop);
|
||||
return button(NiDsXboxController.Button.kRightBumper.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger back(EventLoop loop) {
|
||||
return button(XboxController.Button.kBack.value, loop);
|
||||
return button(NiDsXboxController.Button.kBack.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,7 +242,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger start(EventLoop loop) {
|
||||
return button(XboxController.Button.kStart.value, loop);
|
||||
return button(NiDsXboxController.Button.kStart.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,7 +266,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger leftStick(EventLoop loop) {
|
||||
return button(XboxController.Button.kLeftStick.value, loop);
|
||||
return button(NiDsXboxController.Button.kLeftStick.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,7 +290,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* to the given loop.
|
||||
*/
|
||||
public Trigger rightStick(EventLoop loop) {
|
||||
return button(XboxController.Button.kRightStick.value, loop);
|
||||
return button(NiDsXboxController.Button.kRightStick.value, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* threshold, attached to the given event loop
|
||||
*/
|
||||
public Trigger leftTrigger(double threshold, EventLoop loop) {
|
||||
return axisGreaterThan(XboxController.Axis.kLeftTrigger.value, threshold, loop);
|
||||
return axisGreaterThan(NiDsXboxController.Axis.kLeftTrigger.value, threshold, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -346,7 +346,7 @@ public class CommandXboxController extends CommandGenericHID {
|
||||
* threshold, attached to the given event loop
|
||||
*/
|
||||
public Trigger rightTrigger(double threshold, EventLoop loop) {
|
||||
return axisGreaterThan(XboxController.Axis.kRightTrigger.value, threshold, loop);
|
||||
return axisGreaterThan(NiDsXboxController.Axis.kRightTrigger.value, threshold, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -19,7 +19,7 @@ import org.wpilib.units.measure.Time;
|
||||
/**
|
||||
* Triggers allow users to specify conditions for when commands should run. Triggers can be set up
|
||||
* to read from joystick and controller buttons (eg {@link
|
||||
* org.wpilib.command3.button.CommandXboxController#x()}) or be customized to read sensor values or
|
||||
* org.wpilib.command3.button.CommandGamepad#southFace()}) or be customized to read sensor values or
|
||||
* any other arbitrary true/false condition.
|
||||
*
|
||||
* <p>It is very easy to link a button to a command. For instance, you could link the trigger button
|
||||
|
||||
@@ -59,7 +59,7 @@ def tagList = [
|
||||
"Digital Output", "Accelerometer", "IMU",
|
||||
|
||||
/* --- HID --- */
|
||||
"XboxController", "PS4Controller", "PS5Controller", "Joystick",
|
||||
"Gamepad", "Joystick",
|
||||
|
||||
/* --- RobotBase --- */
|
||||
"Timed", "Timeslice", "RobotBase", "Educational", "OpMode",
|
||||
|
||||
80
wpilibc/robotpy_pybind_build_info.bzl
generated
80
wpilibc/robotpy_pybind_build_info.bzl
generated
@@ -140,51 +140,51 @@ def wpilib_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includ
|
||||
],
|
||||
),
|
||||
struct(
|
||||
class_name = "PS4Controller",
|
||||
yml_file = "semiwrap/PS4Controller.yml",
|
||||
class_name = "NiDsPS4Controller",
|
||||
yml_file = "semiwrap/NiDsPS4Controller.yml",
|
||||
header_root = "$(execpath :robotpy-native-wpilib.copy_headers)",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/driverstation/PS4Controller.hpp",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/driverstation/NiDsPS4Controller.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::PS4Controller", "wpi__PS4Controller.hpp"),
|
||||
("wpi::PS4Controller::Button", "wpi__PS4Controller__Button.hpp"),
|
||||
("wpi::PS4Controller::Axis", "wpi__PS4Controller__Axis.hpp"),
|
||||
("wpi::NiDsPS4Controller", "wpi__NiDsPS4Controller.hpp"),
|
||||
("wpi::NiDsPS4Controller::Button", "wpi__NiDsPS4Controller__Button.hpp"),
|
||||
("wpi::NiDsPS4Controller::Axis", "wpi__NiDsPS4Controller__Axis.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
class_name = "PS5Controller",
|
||||
yml_file = "semiwrap/PS5Controller.yml",
|
||||
class_name = "NiDsPS5Controller",
|
||||
yml_file = "semiwrap/NiDsPS5Controller.yml",
|
||||
header_root = "$(execpath :robotpy-native-wpilib.copy_headers)",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/driverstation/PS5Controller.hpp",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/driverstation/NiDsPS5Controller.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::PS5Controller", "wpi__PS5Controller.hpp"),
|
||||
("wpi::PS5Controller::Button", "wpi__PS5Controller__Button.hpp"),
|
||||
("wpi::PS5Controller::Axis", "wpi__PS5Controller__Axis.hpp"),
|
||||
("wpi::NiDsPS5Controller", "wpi__NiDsPS5Controller.hpp"),
|
||||
("wpi::NiDsPS5Controller::Button", "wpi__NiDsPS5Controller__Button.hpp"),
|
||||
("wpi::NiDsPS5Controller::Axis", "wpi__NiDsPS5Controller__Axis.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
class_name = "StadiaController",
|
||||
yml_file = "semiwrap/StadiaController.yml",
|
||||
class_name = "NiDsStadiaController",
|
||||
yml_file = "semiwrap/NiDsStadiaController.yml",
|
||||
header_root = "$(execpath :robotpy-native-wpilib.copy_headers)",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/driverstation/StadiaController.hpp",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/driverstation/NiDsStadiaController.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::StadiaController", "wpi__StadiaController.hpp"),
|
||||
("wpi::StadiaController::Button", "wpi__StadiaController__Button.hpp"),
|
||||
("wpi::StadiaController::Axis", "wpi__StadiaController__Axis.hpp"),
|
||||
("wpi::NiDsStadiaController", "wpi__NiDsStadiaController.hpp"),
|
||||
("wpi::NiDsStadiaController::Button", "wpi__NiDsStadiaController__Button.hpp"),
|
||||
("wpi::NiDsStadiaController::Axis", "wpi__NiDsStadiaController__Axis.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
class_name = "XboxController",
|
||||
yml_file = "semiwrap/XboxController.yml",
|
||||
class_name = "NiDsXboxController",
|
||||
yml_file = "semiwrap/NiDsXboxController.yml",
|
||||
header_root = "$(execpath :robotpy-native-wpilib.copy_headers)",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/driverstation/XboxController.hpp",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/driverstation/NiDsXboxController.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::XboxController", "wpi__XboxController.hpp"),
|
||||
("wpi::XboxController::Button", "wpi__XboxController__Button.hpp"),
|
||||
("wpi::XboxController::Axis", "wpi__XboxController__Axis.hpp"),
|
||||
("wpi::NiDsXboxController", "wpi__NiDsXboxController.hpp"),
|
||||
("wpi::NiDsXboxController::Button", "wpi__NiDsXboxController__Button.hpp"),
|
||||
("wpi::NiDsXboxController::Axis", "wpi__NiDsXboxController__Axis.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
@@ -1329,23 +1329,23 @@ def wpilib_simulation_extension(srcs = [], header_to_dat_deps = [], extra_hdrs =
|
||||
],
|
||||
),
|
||||
struct(
|
||||
class_name = "PS4ControllerSim",
|
||||
yml_file = "semiwrap/simulation/PS4ControllerSim.yml",
|
||||
class_name = "NiDsPS4ControllerSim",
|
||||
yml_file = "semiwrap/simulation/NiDsPS4ControllerSim.yml",
|
||||
header_root = "$(execpath :robotpy-native-wpilib.copy_headers)",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/simulation/PS4ControllerSim.hpp",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/simulation/NiDsPS4ControllerSim.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::sim::PS4ControllerSim", "wpi__sim__PS4ControllerSim.hpp"),
|
||||
("wpi::sim::NiDsPS4ControllerSim", "wpi__sim__NiDsPS4ControllerSim.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
class_name = "PS5ControllerSim",
|
||||
yml_file = "semiwrap/simulation/PS5ControllerSim.yml",
|
||||
class_name = "NiDsPS5ControllerSim",
|
||||
yml_file = "semiwrap/simulation/NiDsPS5ControllerSim.yml",
|
||||
header_root = "$(execpath :robotpy-native-wpilib.copy_headers)",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/simulation/PS5ControllerSim.hpp",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/simulation/NiDsPS5ControllerSim.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::sim::PS5ControllerSim", "wpi__sim__PS5ControllerSim.hpp"),
|
||||
("wpi::sim::NiDsPS5ControllerSim", "wpi__sim__NiDsPS5ControllerSim.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
@@ -1467,23 +1467,23 @@ def wpilib_simulation_extension(srcs = [], header_to_dat_deps = [], extra_hdrs =
|
||||
],
|
||||
),
|
||||
struct(
|
||||
class_name = "StadiaControllerSim",
|
||||
yml_file = "semiwrap/simulation/StadiaControllerSim.yml",
|
||||
class_name = "NiDsStadiaControllerSim",
|
||||
yml_file = "semiwrap/simulation/NiDsStadiaControllerSim.yml",
|
||||
header_root = "$(execpath :robotpy-native-wpilib.copy_headers)",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/simulation/StadiaControllerSim.hpp",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/simulation/NiDsStadiaControllerSim.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::sim::StadiaControllerSim", "wpi__sim__StadiaControllerSim.hpp"),
|
||||
("wpi::sim::NiDsStadiaControllerSim", "wpi__sim__NiDsStadiaControllerSim.hpp"),
|
||||
],
|
||||
),
|
||||
struct(
|
||||
class_name = "XboxControllerSim",
|
||||
yml_file = "semiwrap/simulation/XboxControllerSim.yml",
|
||||
class_name = "NiDsXboxControllerSim",
|
||||
yml_file = "semiwrap/simulation/NiDsXboxControllerSim.yml",
|
||||
header_root = "$(execpath :robotpy-native-wpilib.copy_headers)",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/simulation/XboxControllerSim.hpp",
|
||||
header_file = "$(execpath :robotpy-native-wpilib.copy_headers)/wpi/simulation/NiDsXboxControllerSim.hpp",
|
||||
tmpl_class_names = [],
|
||||
trampolines = [
|
||||
("wpi::sim::XboxControllerSim", "wpi__sim__XboxControllerSim.hpp"),
|
||||
("wpi::sim::NiDsXboxControllerSim", "wpi__sim__NiDsXboxControllerSim.hpp"),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
@@ -40,16 +40,3 @@ void {{ ConsoleName }}ControllerSim::Set{{ capitalize_first(button.name) }}Butto
|
||||
SetRawButton({{ ConsoleName }}Controller::Button::k{{ capitalize_first(button.name) }}, value);
|
||||
}
|
||||
{% endfor -%}
|
||||
{% if ConsoleName == "Xbox" %}
|
||||
void {{ ConsoleName }}ControllerSim::SetLeftBumper(bool value) {
|
||||
SetRawButton({{ ConsoleName }}Controller::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void {{ ConsoleName }}ControllerSim::SetRightBumper(bool value) {
|
||||
SetRawButton({{ ConsoleName }}Controller::Button::kRightBumper, value);
|
||||
}
|
||||
{% elif ConsoleName == "PS4" or ConsoleName == "PS5" %}
|
||||
void {{ ConsoleName }}ControllerSim::SetTouchpad(bool value) {
|
||||
SetRawButton({{ ConsoleName }}Controller::Button::kTouchpad, value);
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
@@ -58,40 +58,6 @@ class {{ ConsoleName }}ControllerSim : public GenericHIDSim {
|
||||
*/
|
||||
void Set{{ capitalize_first(button.name) }}Button(bool value);
|
||||
{% endfor -%}
|
||||
{% if ConsoleName == "Xbox" %}
|
||||
/**
|
||||
* Change the left bumper value of the joystick.
|
||||
*
|
||||
* @param value the new value
|
||||
* @deprecated Use SetLeftBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use SetLeftBumperButton instead")]]
|
||||
void SetLeftBumper(bool value);
|
||||
|
||||
/**
|
||||
* Change the right bumper value of the joystick.
|
||||
*
|
||||
* @param value the new value
|
||||
* @deprecated Use SetRightBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use SetRightBumperButton instead")]]
|
||||
void SetRightBumper(bool value);
|
||||
{% elif ConsoleName == "PS4" or ConsoleName == "PS5" %}
|
||||
/**
|
||||
* Change the value of the touchpad button on the controller.
|
||||
*
|
||||
* @param value the new value
|
||||
* @deprecated Use SetTouchpadButton instead. This function is deprecated for
|
||||
* removal to make function names consistent to allow the HID classes to be
|
||||
* automatically generated.
|
||||
*/
|
||||
[[deprecated("Use SetTouchpadButton instead")]]
|
||||
void SetTouchpad(bool value);
|
||||
{% endif %}
|
||||
};
|
||||
|
||||
} // namespace sim
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/driverstation/PS4Controller.hpp"
|
||||
#include "wpi/driverstation/NiDsPS4Controller.hpp"
|
||||
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
@@ -13,273 +13,262 @@
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
PS4Controller::PS4Controller(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "PS4Controller");
|
||||
NiDsPS4Controller::NiDsPS4Controller(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "NiDsPS4Controller");
|
||||
}
|
||||
|
||||
double PS4Controller::GetLeftX() const {
|
||||
double NiDsPS4Controller::GetLeftX() const {
|
||||
return GetRawAxis(Axis::kLeftX);
|
||||
}
|
||||
|
||||
double PS4Controller::GetLeftY() const {
|
||||
double NiDsPS4Controller::GetLeftY() const {
|
||||
return GetRawAxis(Axis::kLeftY);
|
||||
}
|
||||
|
||||
double PS4Controller::GetRightX() const {
|
||||
double NiDsPS4Controller::GetRightX() const {
|
||||
return GetRawAxis(Axis::kRightX);
|
||||
}
|
||||
|
||||
double PS4Controller::GetRightY() const {
|
||||
double NiDsPS4Controller::GetRightY() const {
|
||||
return GetRawAxis(Axis::kRightY);
|
||||
}
|
||||
|
||||
double PS4Controller::GetL2Axis() const {
|
||||
double NiDsPS4Controller::GetL2Axis() const {
|
||||
return GetRawAxis(Axis::kL2);
|
||||
}
|
||||
|
||||
double PS4Controller::GetR2Axis() const {
|
||||
double NiDsPS4Controller::GetR2Axis() const {
|
||||
return GetRawAxis(Axis::kR2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetSquareButton() const {
|
||||
bool NiDsPS4Controller::GetSquareButton() const {
|
||||
return GetRawButton(Button::kSquare);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetSquareButtonPressed() {
|
||||
bool NiDsPS4Controller::GetSquareButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kSquare);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetSquareButtonReleased() {
|
||||
bool NiDsPS4Controller::GetSquareButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kSquare);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Square(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Square(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetSquareButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCrossButton() const {
|
||||
bool NiDsPS4Controller::GetCrossButton() const {
|
||||
return GetRawButton(Button::kCross);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCrossButtonPressed() {
|
||||
bool NiDsPS4Controller::GetCrossButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCross);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCrossButtonReleased() {
|
||||
bool NiDsPS4Controller::GetCrossButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCross);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Cross(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Cross(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCrossButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCircleButton() const {
|
||||
bool NiDsPS4Controller::GetCircleButton() const {
|
||||
return GetRawButton(Button::kCircle);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCircleButtonPressed() {
|
||||
bool NiDsPS4Controller::GetCircleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCircle);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCircleButtonReleased() {
|
||||
bool NiDsPS4Controller::GetCircleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCircle);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Circle(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Circle(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCircleButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTriangleButton() const {
|
||||
bool NiDsPS4Controller::GetTriangleButton() const {
|
||||
return GetRawButton(Button::kTriangle);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTriangleButtonPressed() {
|
||||
bool NiDsPS4Controller::GetTriangleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kTriangle);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTriangleButtonReleased() {
|
||||
bool NiDsPS4Controller::GetTriangleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kTriangle);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Triangle(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Triangle(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetTriangleButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL1Button() const {
|
||||
bool NiDsPS4Controller::GetL1Button() const {
|
||||
return GetRawButton(Button::kL1);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL1ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetL1ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL1);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL1ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetL1ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL1);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::L1(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::L1(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL1Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR1Button() const {
|
||||
bool NiDsPS4Controller::GetR1Button() const {
|
||||
return GetRawButton(Button::kR1);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR1ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetR1ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR1);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR1ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetR1ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR1);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::R1(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::R1(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR1Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL2Button() const {
|
||||
bool NiDsPS4Controller::GetL2Button() const {
|
||||
return GetRawButton(Button::kL2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL2ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetL2ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL2ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetL2ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL2);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::L2(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::L2(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL2Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR2Button() const {
|
||||
bool NiDsPS4Controller::GetR2Button() const {
|
||||
return GetRawButton(Button::kR2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR2ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetR2ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR2ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetR2ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR2);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::R2(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::R2(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR2Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetShareButton() const {
|
||||
bool NiDsPS4Controller::GetShareButton() const {
|
||||
return GetRawButton(Button::kShare);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetShareButtonPressed() {
|
||||
bool NiDsPS4Controller::GetShareButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kShare);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetShareButtonReleased() {
|
||||
bool NiDsPS4Controller::GetShareButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kShare);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Share(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Share(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetShareButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetOptionsButton() const {
|
||||
bool NiDsPS4Controller::GetOptionsButton() const {
|
||||
return GetRawButton(Button::kOptions);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetOptionsButtonPressed() {
|
||||
bool NiDsPS4Controller::GetOptionsButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kOptions);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetOptionsButtonReleased() {
|
||||
bool NiDsPS4Controller::GetOptionsButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kOptions);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Options(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Options(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetOptionsButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL3Button() const {
|
||||
bool NiDsPS4Controller::GetL3Button() const {
|
||||
return GetRawButton(Button::kL3);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL3ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetL3ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL3);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL3ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetL3ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL3);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::L3(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::L3(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL3Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR3Button() const {
|
||||
bool NiDsPS4Controller::GetR3Button() const {
|
||||
return GetRawButton(Button::kR3);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR3ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetR3ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR3);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR3ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetR3ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR3);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::R3(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::R3(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR3Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetPSButton() const {
|
||||
bool NiDsPS4Controller::GetPSButton() const {
|
||||
return GetRawButton(Button::kPS);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetPSButtonPressed() {
|
||||
bool NiDsPS4Controller::GetPSButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kPS);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetPSButtonReleased() {
|
||||
bool NiDsPS4Controller::GetPSButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kPS);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::PS(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::PS(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetPSButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadButton() const {
|
||||
bool NiDsPS4Controller::GetTouchpadButton() const {
|
||||
return GetRawButton(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadButtonPressed() {
|
||||
bool NiDsPS4Controller::GetTouchpadButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadButtonReleased() {
|
||||
bool NiDsPS4Controller::GetTouchpadButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kTouchpad);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Touchpad(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Touchpad(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetTouchpadButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpad() const {
|
||||
return GetRawButton(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadPressed() {
|
||||
return GetRawButtonPressed(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadReleased() {
|
||||
return GetRawButtonReleased(Button::kTouchpad);
|
||||
}
|
||||
|
||||
void PS4Controller::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
void NiDsPS4Controller::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("HID");
|
||||
builder.PublishConstString("ControllerType", "PS4");
|
||||
builder.PublishConstString("ControllerType", "NiDsPS4");
|
||||
builder.AddDoubleProperty("L2 Axis", [this] { return GetL2Axis(); }, nullptr);
|
||||
builder.AddDoubleProperty("R2 Axis", [this] { return GetR2Axis(); }, nullptr);
|
||||
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/driverstation/PS5Controller.hpp"
|
||||
#include "wpi/driverstation/NiDsPS5Controller.hpp"
|
||||
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
@@ -13,273 +13,262 @@
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
PS5Controller::PS5Controller(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "PS5Controller");
|
||||
NiDsPS5Controller::NiDsPS5Controller(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "NiDsPS5Controller");
|
||||
}
|
||||
|
||||
double PS5Controller::GetLeftX() const {
|
||||
double NiDsPS5Controller::GetLeftX() const {
|
||||
return GetRawAxis(Axis::kLeftX);
|
||||
}
|
||||
|
||||
double PS5Controller::GetLeftY() const {
|
||||
double NiDsPS5Controller::GetLeftY() const {
|
||||
return GetRawAxis(Axis::kLeftY);
|
||||
}
|
||||
|
||||
double PS5Controller::GetRightX() const {
|
||||
double NiDsPS5Controller::GetRightX() const {
|
||||
return GetRawAxis(Axis::kRightX);
|
||||
}
|
||||
|
||||
double PS5Controller::GetRightY() const {
|
||||
double NiDsPS5Controller::GetRightY() const {
|
||||
return GetRawAxis(Axis::kRightY);
|
||||
}
|
||||
|
||||
double PS5Controller::GetL2Axis() const {
|
||||
double NiDsPS5Controller::GetL2Axis() const {
|
||||
return GetRawAxis(Axis::kL2);
|
||||
}
|
||||
|
||||
double PS5Controller::GetR2Axis() const {
|
||||
double NiDsPS5Controller::GetR2Axis() const {
|
||||
return GetRawAxis(Axis::kR2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetSquareButton() const {
|
||||
bool NiDsPS5Controller::GetSquareButton() const {
|
||||
return GetRawButton(Button::kSquare);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetSquareButtonPressed() {
|
||||
bool NiDsPS5Controller::GetSquareButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kSquare);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetSquareButtonReleased() {
|
||||
bool NiDsPS5Controller::GetSquareButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kSquare);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Square(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Square(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetSquareButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCrossButton() const {
|
||||
bool NiDsPS5Controller::GetCrossButton() const {
|
||||
return GetRawButton(Button::kCross);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCrossButtonPressed() {
|
||||
bool NiDsPS5Controller::GetCrossButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCross);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCrossButtonReleased() {
|
||||
bool NiDsPS5Controller::GetCrossButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCross);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Cross(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Cross(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCrossButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCircleButton() const {
|
||||
bool NiDsPS5Controller::GetCircleButton() const {
|
||||
return GetRawButton(Button::kCircle);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCircleButtonPressed() {
|
||||
bool NiDsPS5Controller::GetCircleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCircle);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCircleButtonReleased() {
|
||||
bool NiDsPS5Controller::GetCircleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCircle);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Circle(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Circle(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCircleButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTriangleButton() const {
|
||||
bool NiDsPS5Controller::GetTriangleButton() const {
|
||||
return GetRawButton(Button::kTriangle);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTriangleButtonPressed() {
|
||||
bool NiDsPS5Controller::GetTriangleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kTriangle);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTriangleButtonReleased() {
|
||||
bool NiDsPS5Controller::GetTriangleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kTriangle);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Triangle(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Triangle(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetTriangleButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL1Button() const {
|
||||
bool NiDsPS5Controller::GetL1Button() const {
|
||||
return GetRawButton(Button::kL1);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL1ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetL1ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL1);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL1ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetL1ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL1);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::L1(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::L1(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL1Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR1Button() const {
|
||||
bool NiDsPS5Controller::GetR1Button() const {
|
||||
return GetRawButton(Button::kR1);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR1ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetR1ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR1);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR1ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetR1ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR1);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::R1(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::R1(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR1Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL2Button() const {
|
||||
bool NiDsPS5Controller::GetL2Button() const {
|
||||
return GetRawButton(Button::kL2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL2ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetL2ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL2ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetL2ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL2);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::L2(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::L2(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL2Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR2Button() const {
|
||||
bool NiDsPS5Controller::GetR2Button() const {
|
||||
return GetRawButton(Button::kR2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR2ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetR2ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR2ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetR2ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR2);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::R2(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::R2(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR2Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCreateButton() const {
|
||||
bool NiDsPS5Controller::GetCreateButton() const {
|
||||
return GetRawButton(Button::kCreate);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCreateButtonPressed() {
|
||||
bool NiDsPS5Controller::GetCreateButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCreate);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCreateButtonReleased() {
|
||||
bool NiDsPS5Controller::GetCreateButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCreate);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Create(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Create(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCreateButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetOptionsButton() const {
|
||||
bool NiDsPS5Controller::GetOptionsButton() const {
|
||||
return GetRawButton(Button::kOptions);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetOptionsButtonPressed() {
|
||||
bool NiDsPS5Controller::GetOptionsButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kOptions);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetOptionsButtonReleased() {
|
||||
bool NiDsPS5Controller::GetOptionsButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kOptions);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Options(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Options(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetOptionsButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL3Button() const {
|
||||
bool NiDsPS5Controller::GetL3Button() const {
|
||||
return GetRawButton(Button::kL3);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL3ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetL3ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL3);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL3ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetL3ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL3);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::L3(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::L3(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL3Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR3Button() const {
|
||||
bool NiDsPS5Controller::GetR3Button() const {
|
||||
return GetRawButton(Button::kR3);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR3ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetR3ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR3);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR3ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetR3ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR3);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::R3(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::R3(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR3Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetPSButton() const {
|
||||
bool NiDsPS5Controller::GetPSButton() const {
|
||||
return GetRawButton(Button::kPS);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetPSButtonPressed() {
|
||||
bool NiDsPS5Controller::GetPSButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kPS);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetPSButtonReleased() {
|
||||
bool NiDsPS5Controller::GetPSButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kPS);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::PS(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::PS(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetPSButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadButton() const {
|
||||
bool NiDsPS5Controller::GetTouchpadButton() const {
|
||||
return GetRawButton(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadButtonPressed() {
|
||||
bool NiDsPS5Controller::GetTouchpadButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadButtonReleased() {
|
||||
bool NiDsPS5Controller::GetTouchpadButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kTouchpad);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Touchpad(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Touchpad(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetTouchpadButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpad() const {
|
||||
return GetRawButton(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadPressed() {
|
||||
return GetRawButtonPressed(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadReleased() {
|
||||
return GetRawButtonReleased(Button::kTouchpad);
|
||||
}
|
||||
|
||||
void PS5Controller::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
void NiDsPS5Controller::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("HID");
|
||||
builder.PublishConstString("ControllerType", "PS5");
|
||||
builder.PublishConstString("ControllerType", "NiDsPS5");
|
||||
builder.AddDoubleProperty("L2 Axis", [this] { return GetL2Axis(); }, nullptr);
|
||||
builder.AddDoubleProperty("R2 Axis", [this] { return GetR2Axis(); }, nullptr);
|
||||
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/driverstation/StadiaController.hpp"
|
||||
#include "wpi/driverstation/NiDsStadiaController.hpp"
|
||||
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
@@ -13,293 +13,270 @@
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
StadiaController::StadiaController(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "StadiaController");
|
||||
NiDsStadiaController::NiDsStadiaController(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "NiDsStadiaController");
|
||||
}
|
||||
|
||||
double StadiaController::GetLeftX() const {
|
||||
double NiDsStadiaController::GetLeftX() const {
|
||||
return GetRawAxis(Axis::kLeftX);
|
||||
}
|
||||
|
||||
double StadiaController::GetRightX() const {
|
||||
double NiDsStadiaController::GetRightX() const {
|
||||
return GetRawAxis(Axis::kRightX);
|
||||
}
|
||||
|
||||
double StadiaController::GetLeftY() const {
|
||||
double NiDsStadiaController::GetLeftY() const {
|
||||
return GetRawAxis(Axis::kLeftY);
|
||||
}
|
||||
|
||||
double StadiaController::GetRightY() const {
|
||||
double NiDsStadiaController::GetRightY() const {
|
||||
return GetRawAxis(Axis::kRightY);
|
||||
}
|
||||
|
||||
bool StadiaController::GetAButton() const {
|
||||
bool NiDsStadiaController::GetAButton() const {
|
||||
return GetRawButton(Button::kA);
|
||||
}
|
||||
|
||||
bool StadiaController::GetAButtonPressed() {
|
||||
bool NiDsStadiaController::GetAButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kA);
|
||||
}
|
||||
|
||||
bool StadiaController::GetAButtonReleased() {
|
||||
bool NiDsStadiaController::GetAButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kA);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::A(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::A(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetAButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetBButton() const {
|
||||
bool NiDsStadiaController::GetBButton() const {
|
||||
return GetRawButton(Button::kB);
|
||||
}
|
||||
|
||||
bool StadiaController::GetBButtonPressed() {
|
||||
bool NiDsStadiaController::GetBButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kB);
|
||||
}
|
||||
|
||||
bool StadiaController::GetBButtonReleased() {
|
||||
bool NiDsStadiaController::GetBButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kB);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::B(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::B(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetBButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetXButton() const {
|
||||
bool NiDsStadiaController::GetXButton() const {
|
||||
return GetRawButton(Button::kX);
|
||||
}
|
||||
|
||||
bool StadiaController::GetXButtonPressed() {
|
||||
bool NiDsStadiaController::GetXButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kX);
|
||||
}
|
||||
|
||||
bool StadiaController::GetXButtonReleased() {
|
||||
bool NiDsStadiaController::GetXButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kX);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::X(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::X(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetXButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetYButton() const {
|
||||
bool NiDsStadiaController::GetYButton() const {
|
||||
return GetRawButton(Button::kY);
|
||||
}
|
||||
|
||||
bool StadiaController::GetYButtonPressed() {
|
||||
bool NiDsStadiaController::GetYButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kY);
|
||||
}
|
||||
|
||||
bool StadiaController::GetYButtonReleased() {
|
||||
bool NiDsStadiaController::GetYButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kY);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Y(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Y(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetYButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperButton() const {
|
||||
bool NiDsStadiaController::GetLeftBumperButton() const {
|
||||
return GetRawButton(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperButtonPressed() {
|
||||
bool NiDsStadiaController::GetLeftBumperButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperButtonReleased() {
|
||||
bool NiDsStadiaController::GetLeftBumperButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::LeftBumper(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::LeftBumper(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftBumperButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperButton() const {
|
||||
bool NiDsStadiaController::GetRightBumperButton() const {
|
||||
return GetRawButton(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperButtonPressed() {
|
||||
bool NiDsStadiaController::GetRightBumperButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperButtonReleased() {
|
||||
bool NiDsStadiaController::GetRightBumperButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightBumper);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::RightBumper(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::RightBumper(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightBumperButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftStickButton() const {
|
||||
bool NiDsStadiaController::GetLeftStickButton() const {
|
||||
return GetRawButton(Button::kLeftStick);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftStickButtonPressed() {
|
||||
bool NiDsStadiaController::GetLeftStickButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftStick);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftStickButtonReleased() {
|
||||
bool NiDsStadiaController::GetLeftStickButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftStick);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::LeftStick(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::LeftStick(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftStickButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightStickButton() const {
|
||||
bool NiDsStadiaController::GetRightStickButton() const {
|
||||
return GetRawButton(Button::kRightStick);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightStickButtonPressed() {
|
||||
bool NiDsStadiaController::GetRightStickButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightStick);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightStickButtonReleased() {
|
||||
bool NiDsStadiaController::GetRightStickButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightStick);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::RightStick(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::RightStick(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightStickButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetEllipsesButton() const {
|
||||
bool NiDsStadiaController::GetEllipsesButton() const {
|
||||
return GetRawButton(Button::kEllipses);
|
||||
}
|
||||
|
||||
bool StadiaController::GetEllipsesButtonPressed() {
|
||||
bool NiDsStadiaController::GetEllipsesButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kEllipses);
|
||||
}
|
||||
|
||||
bool StadiaController::GetEllipsesButtonReleased() {
|
||||
bool NiDsStadiaController::GetEllipsesButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kEllipses);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Ellipses(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Ellipses(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetEllipsesButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetHamburgerButton() const {
|
||||
bool NiDsStadiaController::GetHamburgerButton() const {
|
||||
return GetRawButton(Button::kHamburger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetHamburgerButtonPressed() {
|
||||
bool NiDsStadiaController::GetHamburgerButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kHamburger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetHamburgerButtonReleased() {
|
||||
bool NiDsStadiaController::GetHamburgerButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kHamburger);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Hamburger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Hamburger(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetHamburgerButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetStadiaButton() const {
|
||||
bool NiDsStadiaController::GetStadiaButton() const {
|
||||
return GetRawButton(Button::kStadia);
|
||||
}
|
||||
|
||||
bool StadiaController::GetStadiaButtonPressed() {
|
||||
bool NiDsStadiaController::GetStadiaButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kStadia);
|
||||
}
|
||||
|
||||
bool StadiaController::GetStadiaButtonReleased() {
|
||||
bool NiDsStadiaController::GetStadiaButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kStadia);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Stadia(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Stadia(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetStadiaButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightTriggerButton() const {
|
||||
bool NiDsStadiaController::GetRightTriggerButton() const {
|
||||
return GetRawButton(Button::kRightTrigger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightTriggerButtonPressed() {
|
||||
bool NiDsStadiaController::GetRightTriggerButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightTrigger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightTriggerButtonReleased() {
|
||||
bool NiDsStadiaController::GetRightTriggerButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightTrigger);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::RightTrigger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::RightTrigger(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightTriggerButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftTriggerButton() const {
|
||||
bool NiDsStadiaController::GetLeftTriggerButton() const {
|
||||
return GetRawButton(Button::kLeftTrigger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftTriggerButtonPressed() {
|
||||
bool NiDsStadiaController::GetLeftTriggerButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftTrigger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftTriggerButtonReleased() {
|
||||
bool NiDsStadiaController::GetLeftTriggerButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftTrigger);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::LeftTrigger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::LeftTrigger(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftTriggerButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetGoogleButton() const {
|
||||
bool NiDsStadiaController::GetGoogleButton() const {
|
||||
return GetRawButton(Button::kGoogle);
|
||||
}
|
||||
|
||||
bool StadiaController::GetGoogleButtonPressed() {
|
||||
bool NiDsStadiaController::GetGoogleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kGoogle);
|
||||
}
|
||||
|
||||
bool StadiaController::GetGoogleButtonReleased() {
|
||||
bool NiDsStadiaController::GetGoogleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kGoogle);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Google(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Google(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetGoogleButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetFrameButton() const {
|
||||
bool NiDsStadiaController::GetFrameButton() const {
|
||||
return GetRawButton(Button::kFrame);
|
||||
}
|
||||
|
||||
bool StadiaController::GetFrameButtonPressed() {
|
||||
bool NiDsStadiaController::GetFrameButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kFrame);
|
||||
}
|
||||
|
||||
bool StadiaController::GetFrameButtonReleased() {
|
||||
bool NiDsStadiaController::GetFrameButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kFrame);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Frame(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Frame(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetFrameButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumper() const {
|
||||
return GetRawButton(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumper() const {
|
||||
return GetRawButton(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperPressed() {
|
||||
return GetRawButtonPressed(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperReleased() {
|
||||
return GetRawButtonReleased(Button::kRightBumper);
|
||||
}
|
||||
|
||||
void StadiaController::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
void NiDsStadiaController::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("HID");
|
||||
builder.PublishConstString("ControllerType", "Stadia");
|
||||
builder.PublishConstString("ControllerType", "NiDsStadia");
|
||||
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
|
||||
builder.AddDoubleProperty("RightX", [this] { return GetRightX(); }, nullptr);
|
||||
builder.AddDoubleProperty("LeftY", [this] { return GetLeftY(); }, nullptr);
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/NiDsXboxController.hpp"
|
||||
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
@@ -13,237 +13,214 @@
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
XboxController::XboxController(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "XboxController");
|
||||
NiDsXboxController::NiDsXboxController(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "NiDsXboxController");
|
||||
}
|
||||
|
||||
double XboxController::GetLeftX() const {
|
||||
double NiDsXboxController::GetLeftX() const {
|
||||
return GetRawAxis(Axis::kLeftX);
|
||||
}
|
||||
|
||||
double XboxController::GetRightX() const {
|
||||
double NiDsXboxController::GetRightX() const {
|
||||
return GetRawAxis(Axis::kRightX);
|
||||
}
|
||||
|
||||
double XboxController::GetLeftY() const {
|
||||
double NiDsXboxController::GetLeftY() const {
|
||||
return GetRawAxis(Axis::kLeftY);
|
||||
}
|
||||
|
||||
double XboxController::GetRightY() const {
|
||||
double NiDsXboxController::GetRightY() const {
|
||||
return GetRawAxis(Axis::kRightY);
|
||||
}
|
||||
|
||||
double XboxController::GetLeftTriggerAxis() const {
|
||||
double NiDsXboxController::GetLeftTriggerAxis() const {
|
||||
return GetRawAxis(Axis::kLeftTrigger);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::LeftTrigger(double threshold, EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::LeftTrigger(double threshold, EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this, threshold] { return this->GetLeftTriggerAxis() > threshold; });
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::LeftTrigger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::LeftTrigger(EventLoop* loop) const {
|
||||
return this->LeftTrigger(0.5, loop);
|
||||
}
|
||||
|
||||
double XboxController::GetRightTriggerAxis() const {
|
||||
double NiDsXboxController::GetRightTriggerAxis() const {
|
||||
return GetRawAxis(Axis::kRightTrigger);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::RightTrigger(double threshold, EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::RightTrigger(double threshold, EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this, threshold] { return this->GetRightTriggerAxis() > threshold; });
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::RightTrigger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::RightTrigger(EventLoop* loop) const {
|
||||
return this->RightTrigger(0.5, loop);
|
||||
}
|
||||
|
||||
bool XboxController::GetAButton() const {
|
||||
bool NiDsXboxController::GetAButton() const {
|
||||
return GetRawButton(Button::kA);
|
||||
}
|
||||
|
||||
bool XboxController::GetAButtonPressed() {
|
||||
bool NiDsXboxController::GetAButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kA);
|
||||
}
|
||||
|
||||
bool XboxController::GetAButtonReleased() {
|
||||
bool NiDsXboxController::GetAButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kA);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::A(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::A(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetAButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetBButton() const {
|
||||
bool NiDsXboxController::GetBButton() const {
|
||||
return GetRawButton(Button::kB);
|
||||
}
|
||||
|
||||
bool XboxController::GetBButtonPressed() {
|
||||
bool NiDsXboxController::GetBButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kB);
|
||||
}
|
||||
|
||||
bool XboxController::GetBButtonReleased() {
|
||||
bool NiDsXboxController::GetBButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kB);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::B(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::B(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetBButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetXButton() const {
|
||||
bool NiDsXboxController::GetXButton() const {
|
||||
return GetRawButton(Button::kX);
|
||||
}
|
||||
|
||||
bool XboxController::GetXButtonPressed() {
|
||||
bool NiDsXboxController::GetXButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kX);
|
||||
}
|
||||
|
||||
bool XboxController::GetXButtonReleased() {
|
||||
bool NiDsXboxController::GetXButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kX);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::X(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::X(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetXButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetYButton() const {
|
||||
bool NiDsXboxController::GetYButton() const {
|
||||
return GetRawButton(Button::kY);
|
||||
}
|
||||
|
||||
bool XboxController::GetYButtonPressed() {
|
||||
bool NiDsXboxController::GetYButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kY);
|
||||
}
|
||||
|
||||
bool XboxController::GetYButtonReleased() {
|
||||
bool NiDsXboxController::GetYButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kY);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::Y(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::Y(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetYButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperButton() const {
|
||||
bool NiDsXboxController::GetLeftBumperButton() const {
|
||||
return GetRawButton(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperButtonPressed() {
|
||||
bool NiDsXboxController::GetLeftBumperButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperButtonReleased() {
|
||||
bool NiDsXboxController::GetLeftBumperButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::LeftBumper(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::LeftBumper(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftBumperButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperButton() const {
|
||||
bool NiDsXboxController::GetRightBumperButton() const {
|
||||
return GetRawButton(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperButtonPressed() {
|
||||
bool NiDsXboxController::GetRightBumperButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperButtonReleased() {
|
||||
bool NiDsXboxController::GetRightBumperButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightBumper);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::RightBumper(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::RightBumper(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightBumperButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetBackButton() const {
|
||||
bool NiDsXboxController::GetBackButton() const {
|
||||
return GetRawButton(Button::kBack);
|
||||
}
|
||||
|
||||
bool XboxController::GetBackButtonPressed() {
|
||||
bool NiDsXboxController::GetBackButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kBack);
|
||||
}
|
||||
|
||||
bool XboxController::GetBackButtonReleased() {
|
||||
bool NiDsXboxController::GetBackButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kBack);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::Back(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::Back(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetBackButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetStartButton() const {
|
||||
bool NiDsXboxController::GetStartButton() const {
|
||||
return GetRawButton(Button::kStart);
|
||||
}
|
||||
|
||||
bool XboxController::GetStartButtonPressed() {
|
||||
bool NiDsXboxController::GetStartButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kStart);
|
||||
}
|
||||
|
||||
bool XboxController::GetStartButtonReleased() {
|
||||
bool NiDsXboxController::GetStartButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kStart);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::Start(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::Start(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetStartButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftStickButton() const {
|
||||
bool NiDsXboxController::GetLeftStickButton() const {
|
||||
return GetRawButton(Button::kLeftStick);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftStickButtonPressed() {
|
||||
bool NiDsXboxController::GetLeftStickButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftStick);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftStickButtonReleased() {
|
||||
bool NiDsXboxController::GetLeftStickButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftStick);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::LeftStick(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::LeftStick(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftStickButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetRightStickButton() const {
|
||||
bool NiDsXboxController::GetRightStickButton() const {
|
||||
return GetRawButton(Button::kRightStick);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightStickButtonPressed() {
|
||||
bool NiDsXboxController::GetRightStickButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightStick);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightStickButtonReleased() {
|
||||
bool NiDsXboxController::GetRightStickButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightStick);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::RightStick(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::RightStick(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightStickButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumper() const {
|
||||
return GetRawButton(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumper() const {
|
||||
return GetRawButton(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperPressed() {
|
||||
return GetRawButtonPressed(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperReleased() {
|
||||
return GetRawButtonReleased(Button::kRightBumper);
|
||||
}
|
||||
|
||||
void XboxController::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
void NiDsXboxController::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("HID");
|
||||
builder.PublishConstString("ControllerType", "Xbox");
|
||||
builder.PublishConstString("ControllerType", "NiDsXbox");
|
||||
builder.AddDoubleProperty("LeftTrigger Axis", [this] { return GetLeftTriggerAxis(); }, nullptr);
|
||||
builder.AddDoubleProperty("RightTrigger Axis", [this] { return GetRightTriggerAxis(); }, nullptr);
|
||||
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
|
||||
105
wpilibc/src/generated/main/native/cpp/simulation/NiDsPS4ControllerSim.cpp
generated
Normal file
105
wpilibc/src/generated/main/native/cpp/simulation/NiDsPS4ControllerSim.cpp
generated
Normal file
@@ -0,0 +1,105 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/NiDsPS4ControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/NiDsPS4Controller.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
NiDsPS4ControllerSim::NiDsPS4ControllerSim(const NiDsPS4Controller& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
NiDsPS4ControllerSim::NiDsPS4ControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetL2Axis(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kL2, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetR2Axis(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kR2, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetSquareButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kSquare, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetCrossButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kCross, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetCircleButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kCircle, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetTriangleButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kTriangle, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetL1Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kL1, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetR1Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kR1, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetL2Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kL2, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetR2Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kR2, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetShareButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kShare, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetOptionsButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kOptions, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetL3Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kL3, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetR3Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kR3, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetPSButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kPS, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetTouchpadButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kTouchpad, value);
|
||||
}
|
||||
105
wpilibc/src/generated/main/native/cpp/simulation/NiDsPS5ControllerSim.cpp
generated
Normal file
105
wpilibc/src/generated/main/native/cpp/simulation/NiDsPS5ControllerSim.cpp
generated
Normal file
@@ -0,0 +1,105 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/NiDsPS5ControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/NiDsPS5Controller.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
NiDsPS5ControllerSim::NiDsPS5ControllerSim(const NiDsPS5Controller& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
NiDsPS5ControllerSim::NiDsPS5ControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetL2Axis(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kL2, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetR2Axis(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kR2, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetSquareButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kSquare, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetCrossButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kCross, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetCircleButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kCircle, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetTriangleButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kTriangle, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetL1Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kL1, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetR1Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kR1, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetL2Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kL2, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetR2Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kR2, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetCreateButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kCreate, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetOptionsButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kOptions, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetL3Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kL3, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetR3Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kR3, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetPSButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kPS, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetTouchpadButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kTouchpad, value);
|
||||
}
|
||||
101
wpilibc/src/generated/main/native/cpp/simulation/NiDsStadiaControllerSim.cpp
generated
Normal file
101
wpilibc/src/generated/main/native/cpp/simulation/NiDsStadiaControllerSim.cpp
generated
Normal file
@@ -0,0 +1,101 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/NiDsStadiaControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/NiDsStadiaController.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
NiDsStadiaControllerSim::NiDsStadiaControllerSim(const NiDsStadiaController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(4);
|
||||
SetButtonsMaximumIndex(15);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
NiDsStadiaControllerSim::NiDsStadiaControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(4);
|
||||
SetButtonsMaximumIndex(15);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(NiDsStadiaController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(NiDsStadiaController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(NiDsStadiaController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(NiDsStadiaController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kA, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kB, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kX, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kY, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kRightStick, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetEllipsesButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kEllipses, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetHamburgerButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kHamburger, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetStadiaButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kStadia, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightTriggerButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftTriggerButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetGoogleButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kGoogle, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetFrameButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kFrame, value);
|
||||
}
|
||||
89
wpilibc/src/generated/main/native/cpp/simulation/NiDsXboxControllerSim.cpp
generated
Normal file
89
wpilibc/src/generated/main/native/cpp/simulation/NiDsXboxControllerSim.cpp
generated
Normal file
@@ -0,0 +1,89 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/NiDsXboxControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/NiDsXboxController.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
NiDsXboxControllerSim::NiDsXboxControllerSim(const NiDsXboxController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(10);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
NiDsXboxControllerSim::NiDsXboxControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(10);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftTriggerAxis(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightTriggerAxis(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kA, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kB, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kX, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kY, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetBackButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kBack, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetStartButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kStart, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kRightStick, value);
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/PS4ControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/PS4Controller.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
PS4ControllerSim::PS4ControllerSim(const PS4Controller& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
PS4ControllerSim::PS4ControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetL2Axis(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kL2, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetR2Axis(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kR2, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetSquareButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kSquare, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetCrossButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kCross, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetCircleButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kCircle, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetTriangleButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kTriangle, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetL1Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kL1, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetR1Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kR1, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetL2Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kL2, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetR2Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kR2, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetShareButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kShare, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetOptionsButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kOptions, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetL3Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kL3, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetR3Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kR3, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetPSButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kPS, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetTouchpadButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kTouchpad, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetTouchpad(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kTouchpad, value);
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/PS5ControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/PS5Controller.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
PS5ControllerSim::PS5ControllerSim(const PS5Controller& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
PS5ControllerSim::PS5ControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetL2Axis(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kL2, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetR2Axis(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kR2, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetSquareButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kSquare, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetCrossButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kCross, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetCircleButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kCircle, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetTriangleButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kTriangle, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetL1Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kL1, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetR1Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kR1, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetL2Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kL2, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetR2Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kR2, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetCreateButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kCreate, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetOptionsButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kOptions, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetL3Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kL3, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetR3Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kR3, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetPSButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kPS, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetTouchpadButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kTouchpad, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetTouchpad(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kTouchpad, value);
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/StadiaControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/StadiaController.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
StadiaControllerSim::StadiaControllerSim(const StadiaController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(4);
|
||||
SetButtonsMaximumIndex(15);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
StadiaControllerSim::StadiaControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(4);
|
||||
SetButtonsMaximumIndex(15);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(StadiaController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(StadiaController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(StadiaController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(StadiaController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kA, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kB, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kX, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kY, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kRightStick, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetEllipsesButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kEllipses, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetHamburgerButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kHamburger, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetStadiaButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kStadia, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightTriggerButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftTriggerButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetGoogleButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kGoogle, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetFrameButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kFrame, value);
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/XboxControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
XboxControllerSim::XboxControllerSim(const XboxController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(10);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
XboxControllerSim::XboxControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(10);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftTriggerAxis(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightTriggerAxis(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kA, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kB, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetBackButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kBack, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetStartButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kStart, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kRightStick, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftBumper(bool value) {
|
||||
SetRawButton(XboxController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightBumper(bool value) {
|
||||
SetRawButton(XboxController::Button::kRightBumper, value);
|
||||
}
|
||||
@@ -14,9 +14,9 @@
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Handle input from PS4 controllers connected to the Driver Station.
|
||||
* Handle input from NiDsPS4 controllers connected to the Driver Station.
|
||||
*
|
||||
* This class handles PS4 input that comes from the Driver Station. Each
|
||||
* 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.
|
||||
@@ -25,9 +25,9 @@ namespace wpi {
|
||||
* correct mapping, and only through the official NI DS. Sim is not guaranteed
|
||||
* to have the same mapping, as well as any 3rd party controllers.
|
||||
*/
|
||||
class PS4Controller : public GenericHID,
|
||||
class NiDsPS4Controller : public GenericHID,
|
||||
public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<PS4Controller> {
|
||||
public wpi::util::SendableHelper<NiDsPS4Controller> {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -37,12 +37,12 @@ class PS4Controller : public GenericHID,
|
||||
* @param port The port on the Driver Station that the controller is plugged
|
||||
* into (0-5).
|
||||
*/
|
||||
explicit PS4Controller(int port);
|
||||
explicit NiDsPS4Controller(int port);
|
||||
|
||||
~PS4Controller() override = default;
|
||||
~NiDsPS4Controller() override = default;
|
||||
|
||||
PS4Controller(PS4Controller&&) = default;
|
||||
PS4Controller& operator=(PS4Controller&&) = default;
|
||||
NiDsPS4Controller(NiDsPS4Controller&&) = default;
|
||||
NiDsPS4Controller& operator=(NiDsPS4Controller&&) = default;
|
||||
|
||||
/**
|
||||
* Get the X axis value of left side of the controller. Right is positive.
|
||||
@@ -522,39 +522,7 @@ class PS4Controller : public GenericHID,
|
||||
*/
|
||||
BooleanEvent Touchpad(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Read the value of the touchpad button on the controller.
|
||||
*
|
||||
* @return The state of the button.
|
||||
* @deprecated Use GetTouchpadButton instead. This function is deprecated for
|
||||
* removal to make function names consistent to allow the HID classes to be
|
||||
* automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetTouchpadButton instead")]]
|
||||
bool GetTouchpad() const;
|
||||
/**
|
||||
* Whether the touchpad was pressed since the last check.
|
||||
*
|
||||
* @return Whether the touchpad was pressed since the last check.
|
||||
* @deprecated Use GetTouchpadButtonPressed instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetTouchpadButtonPressed instead")]]
|
||||
bool GetTouchpadPressed();
|
||||
|
||||
/**
|
||||
* Whether the touchpad was released since the last check.
|
||||
*
|
||||
* @return Whether the touchpad was released since the last check.
|
||||
* @deprecated Use GetLeftBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetTouchpadButtonReleased instead")]]
|
||||
bool GetTouchpadReleased();
|
||||
|
||||
/** Represents a digital button on an PS4Controller. */
|
||||
/** Represents a digital button on an NiDsPS4Controller. */
|
||||
struct Button {
|
||||
/// Square button.
|
||||
static constexpr int kSquare = 0;
|
||||
@@ -586,7 +554,7 @@ class PS4Controller : public GenericHID,
|
||||
static constexpr int kTouchpad = 13;
|
||||
};
|
||||
|
||||
/** Represents an axis on an PS4Controller. */
|
||||
/** Represents an axis on an NiDsPS4Controller. */
|
||||
struct Axis {
|
||||
/// Left X axis.
|
||||
static constexpr int kLeftX = 0;
|
||||
@@ -14,9 +14,9 @@
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Handle input from PS5 controllers connected to the Driver Station.
|
||||
* Handle input from NiDsPS5 controllers connected to the Driver Station.
|
||||
*
|
||||
* This class handles PS5 input that comes from the Driver Station. Each
|
||||
* 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.
|
||||
@@ -25,9 +25,9 @@ namespace wpi {
|
||||
* correct mapping, and only through the official NI DS. Sim is not guaranteed
|
||||
* to have the same mapping, as well as any 3rd party controllers.
|
||||
*/
|
||||
class PS5Controller : public GenericHID,
|
||||
class NiDsPS5Controller : public GenericHID,
|
||||
public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<PS5Controller> {
|
||||
public wpi::util::SendableHelper<NiDsPS5Controller> {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -37,12 +37,12 @@ class PS5Controller : public GenericHID,
|
||||
* @param port The port on the Driver Station that the controller is plugged
|
||||
* into (0-5).
|
||||
*/
|
||||
explicit PS5Controller(int port);
|
||||
explicit NiDsPS5Controller(int port);
|
||||
|
||||
~PS5Controller() override = default;
|
||||
~NiDsPS5Controller() override = default;
|
||||
|
||||
PS5Controller(PS5Controller&&) = default;
|
||||
PS5Controller& operator=(PS5Controller&&) = default;
|
||||
NiDsPS5Controller(NiDsPS5Controller&&) = default;
|
||||
NiDsPS5Controller& operator=(NiDsPS5Controller&&) = default;
|
||||
|
||||
/**
|
||||
* Get the X axis value of left side of the controller. Right is positive.
|
||||
@@ -522,39 +522,7 @@ class PS5Controller : public GenericHID,
|
||||
*/
|
||||
BooleanEvent Touchpad(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Read the value of the touchpad button on the controller.
|
||||
*
|
||||
* @return The state of the button.
|
||||
* @deprecated Use GetTouchpadButton instead. This function is deprecated for
|
||||
* removal to make function names consistent to allow the HID classes to be
|
||||
* automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetTouchpadButton instead")]]
|
||||
bool GetTouchpad() const;
|
||||
/**
|
||||
* Whether the touchpad was pressed since the last check.
|
||||
*
|
||||
* @return Whether the touchpad was pressed since the last check.
|
||||
* @deprecated Use GetTouchpadButtonPressed instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetTouchpadButtonPressed instead")]]
|
||||
bool GetTouchpadPressed();
|
||||
|
||||
/**
|
||||
* Whether the touchpad was released since the last check.
|
||||
*
|
||||
* @return Whether the touchpad was released since the last check.
|
||||
* @deprecated Use GetLeftBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetTouchpadButtonReleased instead")]]
|
||||
bool GetTouchpadReleased();
|
||||
|
||||
/** Represents a digital button on an PS5Controller. */
|
||||
/** Represents a digital button on an NiDsPS5Controller. */
|
||||
struct Button {
|
||||
/// Square button.
|
||||
static constexpr int kSquare = 0;
|
||||
@@ -586,7 +554,7 @@ class PS5Controller : public GenericHID,
|
||||
static constexpr int kTouchpad = 13;
|
||||
};
|
||||
|
||||
/** Represents an axis on an PS5Controller. */
|
||||
/** Represents an axis on an NiDsPS5Controller. */
|
||||
struct Axis {
|
||||
/// Left X axis.
|
||||
static constexpr int kLeftX = 0;
|
||||
@@ -14,9 +14,9 @@
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Handle input from Stadia controllers connected to the Driver Station.
|
||||
* Handle input from NiDsStadia controllers connected to the Driver Station.
|
||||
*
|
||||
* This class handles Stadia input that comes from the Driver Station. Each
|
||||
* 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.
|
||||
@@ -25,9 +25,9 @@ namespace wpi {
|
||||
* correct mapping, and only through the official NI DS. Sim is not guaranteed
|
||||
* to have the same mapping, as well as any 3rd party controllers.
|
||||
*/
|
||||
class StadiaController : public GenericHID,
|
||||
class NiDsStadiaController : public GenericHID,
|
||||
public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<StadiaController> {
|
||||
public wpi::util::SendableHelper<NiDsStadiaController> {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -37,12 +37,12 @@ class StadiaController : public GenericHID,
|
||||
* @param port The port on the Driver Station that the controller is plugged
|
||||
* into (0-5).
|
||||
*/
|
||||
explicit StadiaController(int port);
|
||||
explicit NiDsStadiaController(int port);
|
||||
|
||||
~StadiaController() override = default;
|
||||
~NiDsStadiaController() override = default;
|
||||
|
||||
StadiaController(StadiaController&&) = default;
|
||||
StadiaController& operator=(StadiaController&&) = default;
|
||||
NiDsStadiaController(NiDsStadiaController&&) = default;
|
||||
NiDsStadiaController& operator=(NiDsStadiaController&&) = default;
|
||||
|
||||
/**
|
||||
* Get the X axis value of left side of the controller. Right is positive.
|
||||
@@ -537,73 +537,7 @@ class StadiaController : public GenericHID,
|
||||
*/
|
||||
BooleanEvent Frame(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Read the value of the left bumper (LB) button on the controller.
|
||||
*
|
||||
* @return the state of the button
|
||||
* @deprecated Use GetLeftBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetLeftBumperButton instead")]]
|
||||
bool GetLeftBumper() const;
|
||||
|
||||
/**
|
||||
* Read the value of the right bumper (RB) button on the controller.
|
||||
*
|
||||
* @return the state of the button
|
||||
* @deprecated Use GetRightBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetRightBumperButton instead")]]
|
||||
bool GetRightBumper() const;
|
||||
|
||||
/**
|
||||
* Whether the left bumper (LB) was pressed since the last check.
|
||||
*
|
||||
* @return Whether the button was pressed since the last check
|
||||
* @deprecated Use GetLeftBumperButtonPressed instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetLeftBumperButtonPressed instead")]]
|
||||
bool GetLeftBumperPressed();
|
||||
|
||||
/**
|
||||
* Whether the right bumper (RB) was pressed since the last check.
|
||||
*
|
||||
* @return Whether the button was pressed since the last check
|
||||
* @deprecated Use GetRightBumperButtonPressed instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetRightBumperButtonPressed instead")]]
|
||||
bool GetRightBumperPressed();
|
||||
|
||||
/**
|
||||
* Whether the left bumper (LB) was released since the last check.
|
||||
*
|
||||
* @return Whether the button was released since the last check.
|
||||
* @deprecated Use GetLeftBumperButtonReleased instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetLeftBumperButtonReleased instead")]]
|
||||
bool GetLeftBumperReleased();
|
||||
|
||||
/**
|
||||
* Whether the right bumper (RB) was released since the last check.
|
||||
*
|
||||
* @return Whether the button was released since the last check.
|
||||
* @deprecated Use GetRightBumperButtonReleased instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetRightBumperButtonReleased instead")]]
|
||||
bool GetRightBumperReleased();
|
||||
|
||||
/** Represents a digital button on an StadiaController. */
|
||||
/** Represents a digital button on an NiDsStadiaController. */
|
||||
struct Button {
|
||||
/// A button.
|
||||
static constexpr int kA = 0;
|
||||
@@ -637,7 +571,7 @@ class StadiaController : public GenericHID,
|
||||
static constexpr int kFrame = 14;
|
||||
};
|
||||
|
||||
/** Represents an axis on an StadiaController. */
|
||||
/** Represents an axis on an NiDsStadiaController. */
|
||||
struct Axis {
|
||||
/// Left X axis.
|
||||
static constexpr int kLeftX = 0;
|
||||
@@ -14,9 +14,9 @@
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Handle input from Xbox controllers connected to the Driver Station.
|
||||
* Handle input from NiDsXbox controllers connected to the Driver Station.
|
||||
*
|
||||
* This class handles Xbox input that comes from the Driver Station. Each
|
||||
* 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.
|
||||
@@ -25,9 +25,9 @@ namespace wpi {
|
||||
* correct mapping, and only through the official NI DS. Sim is not guaranteed
|
||||
* to have the same mapping, as well as any 3rd party controllers.
|
||||
*/
|
||||
class XboxController : public GenericHID,
|
||||
class NiDsXboxController : public GenericHID,
|
||||
public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<XboxController> {
|
||||
public wpi::util::SendableHelper<NiDsXboxController> {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -37,12 +37,12 @@ class XboxController : public GenericHID,
|
||||
* @param port The port on the Driver Station that the controller is plugged
|
||||
* into (0-5).
|
||||
*/
|
||||
explicit XboxController(int port);
|
||||
explicit NiDsXboxController(int port);
|
||||
|
||||
~XboxController() override = default;
|
||||
~NiDsXboxController() override = default;
|
||||
|
||||
XboxController(XboxController&&) = default;
|
||||
XboxController& operator=(XboxController&&) = default;
|
||||
NiDsXboxController(NiDsXboxController&&) = default;
|
||||
NiDsXboxController& operator=(NiDsXboxController&&) = default;
|
||||
|
||||
/**
|
||||
* Get the X axis value of left side of the controller. Right is positive.
|
||||
@@ -442,73 +442,7 @@ class XboxController : public GenericHID,
|
||||
*/
|
||||
BooleanEvent RightStick(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Read the value of the left bumper (LB) button on the controller.
|
||||
*
|
||||
* @return the state of the button
|
||||
* @deprecated Use GetLeftBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetLeftBumperButton instead")]]
|
||||
bool GetLeftBumper() const;
|
||||
|
||||
/**
|
||||
* Read the value of the right bumper (RB) button on the controller.
|
||||
*
|
||||
* @return the state of the button
|
||||
* @deprecated Use GetRightBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetRightBumperButton instead")]]
|
||||
bool GetRightBumper() const;
|
||||
|
||||
/**
|
||||
* Whether the left bumper (LB) was pressed since the last check.
|
||||
*
|
||||
* @return Whether the button was pressed since the last check
|
||||
* @deprecated Use GetLeftBumperButtonPressed instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetLeftBumperButtonPressed instead")]]
|
||||
bool GetLeftBumperPressed();
|
||||
|
||||
/**
|
||||
* Whether the right bumper (RB) was pressed since the last check.
|
||||
*
|
||||
* @return Whether the button was pressed since the last check
|
||||
* @deprecated Use GetRightBumperButtonPressed instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetRightBumperButtonPressed instead")]]
|
||||
bool GetRightBumperPressed();
|
||||
|
||||
/**
|
||||
* Whether the left bumper (LB) was released since the last check.
|
||||
*
|
||||
* @return Whether the button was released since the last check.
|
||||
* @deprecated Use GetLeftBumperButtonReleased instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetLeftBumperButtonReleased instead")]]
|
||||
bool GetLeftBumperReleased();
|
||||
|
||||
/**
|
||||
* Whether the right bumper (RB) was released since the last check.
|
||||
*
|
||||
* @return Whether the button was released since the last check.
|
||||
* @deprecated Use GetRightBumperButtonReleased instead. This function is
|
||||
* deprecated for removal to make function names consistent to allow the HID
|
||||
* classes to be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use GetRightBumperButtonReleased instead")]]
|
||||
bool GetRightBumperReleased();
|
||||
|
||||
/** Represents a digital button on an XboxController. */
|
||||
/** Represents a digital button on an NiDsXboxController. */
|
||||
struct Button {
|
||||
/// A button.
|
||||
static constexpr int kA = 0;
|
||||
@@ -532,7 +466,7 @@ class XboxController : public GenericHID,
|
||||
static constexpr int kRightStick = 9;
|
||||
};
|
||||
|
||||
/** Represents an axis on an XboxController. */
|
||||
/** Represents an axis on an NiDsXboxController. */
|
||||
struct Axis {
|
||||
/// Left X axis.
|
||||
static constexpr int kLeftX = 0;
|
||||
@@ -10,28 +10,28 @@
|
||||
|
||||
namespace wpi {
|
||||
|
||||
class PS4Controller;
|
||||
class NiDsPS4Controller;
|
||||
|
||||
namespace sim {
|
||||
|
||||
/**
|
||||
* Class to control a simulated PS4 controller.
|
||||
* Class to control a simulated NiDsPS4 controller.
|
||||
*/
|
||||
class PS4ControllerSim : public GenericHIDSim {
|
||||
class NiDsPS4ControllerSim : public GenericHIDSim {
|
||||
public:
|
||||
/**
|
||||
* Constructs from a PS4Controller object.
|
||||
* Constructs from a NiDsPS4Controller object.
|
||||
*
|
||||
* @param joystick controller to simulate
|
||||
*/
|
||||
explicit PS4ControllerSim(const PS4Controller& joystick);
|
||||
explicit NiDsPS4ControllerSim(const NiDsPS4Controller& joystick);
|
||||
|
||||
/**
|
||||
* Constructs from a joystick port number.
|
||||
*
|
||||
* @param port port number
|
||||
*/
|
||||
explicit PS4ControllerSim(int port);
|
||||
explicit NiDsPS4ControllerSim(int port);
|
||||
|
||||
/**
|
||||
* Change the left X value of the controller's joystick.
|
||||
@@ -172,18 +172,6 @@ class PS4ControllerSim : public GenericHIDSim {
|
||||
* @param value the new value
|
||||
*/
|
||||
void SetTouchpadButton(bool value);
|
||||
|
||||
/**
|
||||
* Change the value of the touchpad button on the controller.
|
||||
*
|
||||
* @param value the new value
|
||||
* @deprecated Use SetTouchpadButton instead. This function is deprecated for
|
||||
* removal to make function names consistent to allow the HID classes to be
|
||||
* automatically generated.
|
||||
*/
|
||||
[[deprecated("Use SetTouchpadButton instead")]]
|
||||
void SetTouchpad(bool value);
|
||||
|
||||
};
|
||||
|
||||
} // namespace sim
|
||||
@@ -10,28 +10,28 @@
|
||||
|
||||
namespace wpi {
|
||||
|
||||
class PS5Controller;
|
||||
class NiDsPS5Controller;
|
||||
|
||||
namespace sim {
|
||||
|
||||
/**
|
||||
* Class to control a simulated PS5 controller.
|
||||
* Class to control a simulated NiDsPS5 controller.
|
||||
*/
|
||||
class PS5ControllerSim : public GenericHIDSim {
|
||||
class NiDsPS5ControllerSim : public GenericHIDSim {
|
||||
public:
|
||||
/**
|
||||
* Constructs from a PS5Controller object.
|
||||
* Constructs from a NiDsPS5Controller object.
|
||||
*
|
||||
* @param joystick controller to simulate
|
||||
*/
|
||||
explicit PS5ControllerSim(const PS5Controller& joystick);
|
||||
explicit NiDsPS5ControllerSim(const NiDsPS5Controller& joystick);
|
||||
|
||||
/**
|
||||
* Constructs from a joystick port number.
|
||||
*
|
||||
* @param port port number
|
||||
*/
|
||||
explicit PS5ControllerSim(int port);
|
||||
explicit NiDsPS5ControllerSim(int port);
|
||||
|
||||
/**
|
||||
* Change the left X value of the controller's joystick.
|
||||
@@ -172,18 +172,6 @@ class PS5ControllerSim : public GenericHIDSim {
|
||||
* @param value the new value
|
||||
*/
|
||||
void SetTouchpadButton(bool value);
|
||||
|
||||
/**
|
||||
* Change the value of the touchpad button on the controller.
|
||||
*
|
||||
* @param value the new value
|
||||
* @deprecated Use SetTouchpadButton instead. This function is deprecated for
|
||||
* removal to make function names consistent to allow the HID classes to be
|
||||
* automatically generated.
|
||||
*/
|
||||
[[deprecated("Use SetTouchpadButton instead")]]
|
||||
void SetTouchpad(bool value);
|
||||
|
||||
};
|
||||
|
||||
} // namespace sim
|
||||
@@ -10,28 +10,28 @@
|
||||
|
||||
namespace wpi {
|
||||
|
||||
class StadiaController;
|
||||
class NiDsStadiaController;
|
||||
|
||||
namespace sim {
|
||||
|
||||
/**
|
||||
* Class to control a simulated Stadia controller.
|
||||
* Class to control a simulated NiDsStadia controller.
|
||||
*/
|
||||
class StadiaControllerSim : public GenericHIDSim {
|
||||
class NiDsStadiaControllerSim : public GenericHIDSim {
|
||||
public:
|
||||
/**
|
||||
* Constructs from a StadiaController object.
|
||||
* Constructs from a NiDsStadiaController object.
|
||||
*
|
||||
* @param joystick controller to simulate
|
||||
*/
|
||||
explicit StadiaControllerSim(const StadiaController& joystick);
|
||||
explicit NiDsStadiaControllerSim(const NiDsStadiaController& joystick);
|
||||
|
||||
/**
|
||||
* Constructs from a joystick port number.
|
||||
*
|
||||
* @param port port number
|
||||
*/
|
||||
explicit StadiaControllerSim(int port);
|
||||
explicit NiDsStadiaControllerSim(int port);
|
||||
|
||||
/**
|
||||
* Change the left X value of the controller's joystick.
|
||||
@@ -165,7 +165,6 @@ class StadiaControllerSim : public GenericHIDSim {
|
||||
* @param value the new value
|
||||
*/
|
||||
void SetFrameButton(bool value);
|
||||
|
||||
};
|
||||
|
||||
} // namespace sim
|
||||
@@ -10,28 +10,28 @@
|
||||
|
||||
namespace wpi {
|
||||
|
||||
class XboxController;
|
||||
class NiDsXboxController;
|
||||
|
||||
namespace sim {
|
||||
|
||||
/**
|
||||
* Class to control a simulated Xbox controller.
|
||||
* Class to control a simulated NiDsXbox controller.
|
||||
*/
|
||||
class XboxControllerSim : public GenericHIDSim {
|
||||
class NiDsXboxControllerSim : public GenericHIDSim {
|
||||
public:
|
||||
/**
|
||||
* Constructs from a XboxController object.
|
||||
* Constructs from a NiDsXboxController object.
|
||||
*
|
||||
* @param joystick controller to simulate
|
||||
*/
|
||||
explicit XboxControllerSim(const XboxController& joystick);
|
||||
explicit NiDsXboxControllerSim(const NiDsXboxController& joystick);
|
||||
|
||||
/**
|
||||
* Constructs from a joystick port number.
|
||||
*
|
||||
* @param port port number
|
||||
*/
|
||||
explicit XboxControllerSim(int port);
|
||||
explicit NiDsXboxControllerSim(int port);
|
||||
|
||||
/**
|
||||
* Change the left X value of the controller's joystick.
|
||||
@@ -144,29 +144,6 @@ class XboxControllerSim : public GenericHIDSim {
|
||||
* @param value the new value
|
||||
*/
|
||||
void SetRightStickButton(bool value);
|
||||
|
||||
/**
|
||||
* Change the left bumper value of the joystick.
|
||||
*
|
||||
* @param value the new value
|
||||
* @deprecated Use SetLeftBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use SetLeftBumperButton instead")]]
|
||||
void SetLeftBumper(bool value);
|
||||
|
||||
/**
|
||||
* Change the right bumper value of the joystick.
|
||||
*
|
||||
* @param value the new value
|
||||
* @deprecated Use SetRightBumperButton instead. This function is deprecated
|
||||
* for removal to make function names consistent to allow the HID classes to
|
||||
* be automatically generated.
|
||||
*/
|
||||
[[deprecated("Use SetRightBumperButton instead")]]
|
||||
void SetRightBumper(bool value);
|
||||
|
||||
};
|
||||
|
||||
} // namespace sim
|
||||
@@ -109,10 +109,10 @@ DriverStation = "wpi/driverstation/DriverStation.hpp"
|
||||
Gamepad = "wpi/driverstation/Gamepad.hpp"
|
||||
GenericHID = "wpi/driverstation/GenericHID.hpp"
|
||||
Joystick = "wpi/driverstation/Joystick.hpp"
|
||||
PS4Controller = "wpi/driverstation/PS4Controller.hpp"
|
||||
PS5Controller = "wpi/driverstation/PS5Controller.hpp"
|
||||
StadiaController = "wpi/driverstation/StadiaController.hpp"
|
||||
XboxController = "wpi/driverstation/XboxController.hpp"
|
||||
NiDsPS4Controller = "wpi/driverstation/NiDsPS4Controller.hpp"
|
||||
NiDsPS5Controller = "wpi/driverstation/NiDsPS5Controller.hpp"
|
||||
NiDsStadiaController = "wpi/driverstation/NiDsStadiaController.hpp"
|
||||
NiDsXboxController = "wpi/driverstation/NiDsXboxController.hpp"
|
||||
|
||||
# wpi/event
|
||||
BooleanEvent = "wpi/event/BooleanEvent.hpp"
|
||||
@@ -264,8 +264,8 @@ GamepadSim = "wpi/simulation/GamepadSim.hpp"
|
||||
GenericHIDSim = "wpi/simulation/GenericHIDSim.hpp"
|
||||
JoystickSim = "wpi/simulation/JoystickSim.hpp"
|
||||
LinearSystemSim = "wpi/simulation/LinearSystemSim.hpp"
|
||||
PS4ControllerSim = "wpi/simulation/PS4ControllerSim.hpp"
|
||||
PS5ControllerSim = "wpi/simulation/PS5ControllerSim.hpp"
|
||||
NiDsPS4ControllerSim = "wpi/simulation/NiDsPS4ControllerSim.hpp"
|
||||
NiDsPS5ControllerSim = "wpi/simulation/NiDsPS5ControllerSim.hpp"
|
||||
PWMSim = "wpi/simulation/PWMSim.hpp"
|
||||
PneumaticsBaseSim = "wpi/simulation/PneumaticsBaseSim.hpp"
|
||||
PowerDistributionSim = "wpi/simulation/PowerDistributionSim.hpp"
|
||||
@@ -278,5 +278,5 @@ SimDeviceSim = "wpi/simulation/SimDeviceSim.hpp"
|
||||
SimHooks = "wpi/simulation/SimHooks.hpp"
|
||||
SingleJointedArmSim = "wpi/simulation/SingleJointedArmSim.hpp"
|
||||
SolenoidSim = "wpi/simulation/SolenoidSim.hpp"
|
||||
StadiaControllerSim = "wpi/simulation/StadiaControllerSim.hpp"
|
||||
XboxControllerSim = "wpi/simulation/XboxControllerSim.hpp"
|
||||
NiDsStadiaControllerSim = "wpi/simulation/NiDsStadiaControllerSim.hpp"
|
||||
NiDsXboxControllerSim = "wpi/simulation/NiDsXboxControllerSim.hpp"
|
||||
|
||||
@@ -3,11 +3,11 @@ extra_includes:
|
||||
- wpi/event/BooleanEvent.hpp
|
||||
|
||||
classes:
|
||||
wpi::PS4Controller:
|
||||
wpi::NiDsPS4Controller:
|
||||
ignored_bases:
|
||||
- wpi::util::SendableHelper<PS4Controller>
|
||||
- wpi::util::SendableHelper<NiDsPS4Controller>
|
||||
methods:
|
||||
PS4Controller:
|
||||
NiDsPS4Controller:
|
||||
GetLeftX:
|
||||
GetRightX:
|
||||
GetLeftY:
|
||||
@@ -66,15 +66,12 @@ classes:
|
||||
GetPSButtonPressed:
|
||||
GetPSButtonReleased:
|
||||
PS:
|
||||
GetTouchpad:
|
||||
GetTouchpadPressed:
|
||||
GetTouchpadReleased:
|
||||
Touchpad:
|
||||
GetTouchpadButton:
|
||||
GetTouchpadButtonPressed:
|
||||
GetTouchpadButtonReleased:
|
||||
InitSendable:
|
||||
wpi::PS4Controller::Button:
|
||||
wpi::NiDsPS4Controller::Button:
|
||||
attributes:
|
||||
kSquare:
|
||||
kCross:
|
||||
@@ -90,7 +87,7 @@ classes:
|
||||
kR3:
|
||||
kPS:
|
||||
kTouchpad:
|
||||
wpi::PS4Controller::Axis:
|
||||
wpi::NiDsPS4Controller::Axis:
|
||||
attributes:
|
||||
kLeftX:
|
||||
kLeftY:
|
||||
@@ -2,11 +2,11 @@ extra_includes:
|
||||
- wpi/util/sendable/SendableBuilder.hpp
|
||||
|
||||
classes:
|
||||
wpi::PS5Controller:
|
||||
wpi::NiDsPS5Controller:
|
||||
ignored_bases:
|
||||
- wpi::util::SendableHelper<PS5Controller>
|
||||
- wpi::util::SendableHelper<NiDsPS5Controller>
|
||||
methods:
|
||||
PS5Controller:
|
||||
NiDsPS5Controller:
|
||||
GetLeftX:
|
||||
GetRightX:
|
||||
GetLeftY:
|
||||
@@ -65,15 +65,12 @@ classes:
|
||||
GetPSButtonPressed:
|
||||
GetPSButtonReleased:
|
||||
PS:
|
||||
GetTouchpad:
|
||||
GetTouchpadPressed:
|
||||
GetTouchpadReleased:
|
||||
Touchpad:
|
||||
GetTouchpadButton:
|
||||
GetTouchpadButtonPressed:
|
||||
GetTouchpadButtonReleased:
|
||||
InitSendable:
|
||||
wpi::PS5Controller::Button:
|
||||
wpi::NiDsPS5Controller::Button:
|
||||
attributes:
|
||||
kSquare:
|
||||
kCross:
|
||||
@@ -89,7 +86,7 @@ classes:
|
||||
kR3:
|
||||
kPS:
|
||||
kTouchpad:
|
||||
wpi::PS5Controller::Axis:
|
||||
wpi::NiDsPS5Controller::Axis:
|
||||
attributes:
|
||||
kLeftX:
|
||||
kLeftY:
|
||||
@@ -2,21 +2,15 @@ extra_includes:
|
||||
- wpi/util/sendable/SendableBuilder.hpp
|
||||
|
||||
classes:
|
||||
wpi::StadiaController:
|
||||
wpi::NiDsStadiaController:
|
||||
ignored_bases:
|
||||
- wpi::util::SendableHelper<StadiaController>
|
||||
- wpi::util::SendableHelper<NiDsStadiaController>
|
||||
methods:
|
||||
StadiaController:
|
||||
NiDsStadiaController:
|
||||
GetLeftX:
|
||||
GetRightX:
|
||||
GetLeftY:
|
||||
GetRightY:
|
||||
GetLeftBumper:
|
||||
GetRightBumper:
|
||||
GetLeftBumperPressed:
|
||||
GetRightBumperPressed:
|
||||
GetLeftBumperReleased:
|
||||
GetRightBumperReleased:
|
||||
LeftBumper:
|
||||
RightBumper:
|
||||
GetLeftStickButton:
|
||||
@@ -78,7 +72,7 @@ classes:
|
||||
GetRightBumperButtonPressed:
|
||||
GetRightBumperButtonReleased:
|
||||
InitSendable:
|
||||
wpi::StadiaController::Button:
|
||||
wpi::NiDsStadiaController::Button:
|
||||
attributes:
|
||||
kA:
|
||||
kB:
|
||||
@@ -95,7 +89,7 @@ classes:
|
||||
kLeftTrigger:
|
||||
kGoogle:
|
||||
kFrame:
|
||||
wpi::StadiaController::Axis:
|
||||
wpi::NiDsStadiaController::Axis:
|
||||
attributes:
|
||||
kLeftX:
|
||||
kRightX:
|
||||
@@ -4,23 +4,17 @@ extra_includes:
|
||||
- wpi/event/BooleanEvent.hpp
|
||||
|
||||
classes:
|
||||
wpi::XboxController:
|
||||
wpi::NiDsXboxController:
|
||||
ignored_bases:
|
||||
- wpi::util::SendableHelper<XboxController>
|
||||
- wpi::util::SendableHelper<NiDsXboxController>
|
||||
methods:
|
||||
XboxController:
|
||||
NiDsXboxController:
|
||||
GetLeftX:
|
||||
GetRightX:
|
||||
GetLeftY:
|
||||
GetRightY:
|
||||
GetLeftTriggerAxis:
|
||||
GetRightTriggerAxis:
|
||||
GetLeftBumper:
|
||||
GetRightBumper:
|
||||
GetLeftBumperPressed:
|
||||
GetRightBumperPressed:
|
||||
GetLeftBumperReleased:
|
||||
GetRightBumperReleased:
|
||||
LeftBumper:
|
||||
RightBumper:
|
||||
GetLeftStickButton:
|
||||
@@ -70,7 +64,7 @@ classes:
|
||||
GetRightBumperButtonPressed:
|
||||
GetRightBumperButtonReleased:
|
||||
InitSendable:
|
||||
wpi::XboxController::Button:
|
||||
wpi::NiDsXboxController::Button:
|
||||
attributes:
|
||||
kLeftBumper:
|
||||
kRightBumper:
|
||||
@@ -82,7 +76,7 @@ classes:
|
||||
kY:
|
||||
kBack:
|
||||
kStart:
|
||||
wpi::XboxController::Axis:
|
||||
wpi::NiDsXboxController::Axis:
|
||||
attributes:
|
||||
kLeftX:
|
||||
kRightX:
|
||||
@@ -1,13 +1,13 @@
|
||||
extra_includes:
|
||||
- wpi/driverstation/PS4Controller.hpp
|
||||
- wpi/driverstation/NiDsPS4Controller.hpp
|
||||
|
||||
classes:
|
||||
wpi::sim::PS4ControllerSim:
|
||||
wpi::sim::NiDsPS4ControllerSim:
|
||||
force_no_trampoline: true
|
||||
methods:
|
||||
PS4ControllerSim:
|
||||
NiDsPS4ControllerSim:
|
||||
overloads:
|
||||
const PS4Controller&:
|
||||
const NiDsPS4Controller&:
|
||||
int:
|
||||
SetLeftX:
|
||||
SetRightX:
|
||||
@@ -28,6 +28,4 @@ classes:
|
||||
SetL3Button:
|
||||
SetR3Button:
|
||||
SetPSButton:
|
||||
SetTouchpad:
|
||||
ignore: true
|
||||
SetTouchpadButton:
|
||||
@@ -1,13 +1,13 @@
|
||||
extra_includes:
|
||||
- wpi/driverstation/PS5Controller.hpp
|
||||
- wpi/driverstation/NiDsPS5Controller.hpp
|
||||
|
||||
classes:
|
||||
wpi::sim::PS5ControllerSim:
|
||||
wpi::sim::NiDsPS5ControllerSim:
|
||||
force_no_trampoline: true
|
||||
methods:
|
||||
PS5ControllerSim:
|
||||
NiDsPS5ControllerSim:
|
||||
overloads:
|
||||
const PS5Controller&:
|
||||
const NiDsPS5Controller&:
|
||||
int:
|
||||
SetLeftX:
|
||||
SetRightX:
|
||||
@@ -28,6 +28,4 @@ classes:
|
||||
SetL3Button:
|
||||
SetR3Button:
|
||||
SetPSButton:
|
||||
SetTouchpad:
|
||||
ignore: true
|
||||
SetTouchpadButton:
|
||||
@@ -1,13 +1,13 @@
|
||||
extra_includes:
|
||||
- wpi/driverstation/StadiaController.hpp
|
||||
- wpi/driverstation/NiDsStadiaController.hpp
|
||||
|
||||
classes:
|
||||
wpi::sim::StadiaControllerSim:
|
||||
wpi::sim::NiDsStadiaControllerSim:
|
||||
force_no_trampoline: true
|
||||
methods:
|
||||
StadiaControllerSim:
|
||||
NiDsStadiaControllerSim:
|
||||
overloads:
|
||||
const StadiaController&:
|
||||
const NiDsStadiaController&:
|
||||
int:
|
||||
SetLeftX:
|
||||
SetRightX:
|
||||
@@ -1,15 +1,15 @@
|
||||
extra_includes:
|
||||
- wpi/driverstation/XboxController.hpp
|
||||
- wpi/driverstation/NiDsXboxController.hpp
|
||||
|
||||
classes:
|
||||
wpi::sim::XboxControllerSim:
|
||||
wpi::sim::NiDsXboxControllerSim:
|
||||
force_no_trampoline: true
|
||||
typealias:
|
||||
- wpi::XboxController
|
||||
- wpi::NiDsXboxController
|
||||
methods:
|
||||
XboxControllerSim:
|
||||
NiDsXboxControllerSim:
|
||||
overloads:
|
||||
const XboxController&:
|
||||
const NiDsXboxController&:
|
||||
int:
|
||||
SetLeftX:
|
||||
SetRightX:
|
||||
@@ -17,10 +17,6 @@ classes:
|
||||
SetRightY:
|
||||
SetLeftTriggerAxis:
|
||||
SetRightTriggerAxis:
|
||||
SetLeftBumper:
|
||||
ignore: true
|
||||
SetRightBumper:
|
||||
ignore: true
|
||||
SetLeftStickButton:
|
||||
SetRightStickButton:
|
||||
SetAButton:
|
||||
@@ -53,8 +53,8 @@ from ._wpilib import (
|
||||
OnboardIMU,
|
||||
OpMode,
|
||||
OpModeRobotBase,
|
||||
PS4Controller,
|
||||
PS5Controller,
|
||||
NiDsPS4Controller,
|
||||
NiDsPS5Controller,
|
||||
PWM,
|
||||
PWMMotorController,
|
||||
PWMSparkFlex,
|
||||
@@ -84,7 +84,7 @@ from ._wpilib import (
|
||||
Solenoid,
|
||||
Spark,
|
||||
SparkMini,
|
||||
StadiaController,
|
||||
NiDsStadiaController,
|
||||
SystemServer,
|
||||
Tachometer,
|
||||
Talon,
|
||||
@@ -95,7 +95,7 @@ from ._wpilib import (
|
||||
UpDownCounter,
|
||||
VictorSP,
|
||||
Watchdog,
|
||||
XboxController,
|
||||
NiDsXboxController,
|
||||
getCurrentThreadPriority,
|
||||
getDeployDirectory,
|
||||
getErrorMessage,
|
||||
@@ -157,8 +157,8 @@ __all__ = [
|
||||
"OnboardIMU",
|
||||
"OpMode",
|
||||
"OpModeRobotBase",
|
||||
"PS4Controller",
|
||||
"PS5Controller",
|
||||
"NiDsPS4Controller",
|
||||
"NiDsPS5Controller",
|
||||
"PWM",
|
||||
"PWMMotorController",
|
||||
"PWMSparkFlex",
|
||||
@@ -188,7 +188,7 @@ __all__ = [
|
||||
"Solenoid",
|
||||
"Spark",
|
||||
"SparkMini",
|
||||
"StadiaController",
|
||||
"NiDsStadiaController",
|
||||
"SystemServer",
|
||||
"Tachometer",
|
||||
"Talon",
|
||||
@@ -199,7 +199,7 @@ __all__ = [
|
||||
"UpDownCounter",
|
||||
"VictorSP",
|
||||
"Watchdog",
|
||||
"XboxController",
|
||||
"NiDsXboxController",
|
||||
"getCurrentThreadPriority",
|
||||
"getDeployDirectory",
|
||||
"getErrorMessage",
|
||||
|
||||
@@ -30,8 +30,8 @@ from ._simulation import (
|
||||
LinearSystemSim_2_2_1,
|
||||
LinearSystemSim_2_2_2,
|
||||
OpModeOptions,
|
||||
PS4ControllerSim,
|
||||
PS5ControllerSim,
|
||||
NiDsPS4ControllerSim,
|
||||
NiDsPS5ControllerSim,
|
||||
PWMMotorControllerSim,
|
||||
PWMSim,
|
||||
PneumaticsBaseSim,
|
||||
@@ -43,8 +43,8 @@ from ._simulation import (
|
||||
SimDeviceSim,
|
||||
SingleJointedArmSim,
|
||||
SolenoidSim,
|
||||
StadiaControllerSim,
|
||||
XboxControllerSim,
|
||||
NiDsStadiaControllerSim,
|
||||
NiDsXboxControllerSim,
|
||||
getProgramStarted,
|
||||
getProgramState,
|
||||
isTimingPaused,
|
||||
@@ -88,8 +88,8 @@ __all__ = [
|
||||
"LinearSystemSim_2_2_1",
|
||||
"LinearSystemSim_2_2_2",
|
||||
"OpModeOptions",
|
||||
"PS4ControllerSim",
|
||||
"PS5ControllerSim",
|
||||
"NiDsPS4ControllerSim",
|
||||
"NiDsPS5ControllerSim",
|
||||
"PWMMotorControllerSim",
|
||||
"PWMSim",
|
||||
"PneumaticsBaseSim",
|
||||
@@ -101,8 +101,8 @@ __all__ = [
|
||||
"SimDeviceSim",
|
||||
"SingleJointedArmSim",
|
||||
"SolenoidSim",
|
||||
"StadiaControllerSim",
|
||||
"XboxControllerSim",
|
||||
"NiDsStadiaControllerSim",
|
||||
"NiDsXboxControllerSim",
|
||||
"getProgramStarted",
|
||||
"getProgramState",
|
||||
"isTimingPaused",
|
||||
|
||||
38
wpilibc/src/test/native/cpp/NiDsPS4ControllerTest.cpp
Normal file
38
wpilibc/src/test/native/cpp/NiDsPS4ControllerTest.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/driverstation/NiDsPS4Controller.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "JoystickTestMacros.hpp"
|
||||
#include "wpi/simulation/NiDsPS4ControllerSim.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
BUTTON_TEST(NiDsPS4Controller, SquareButton)
|
||||
BUTTON_TEST(NiDsPS4Controller, CrossButton)
|
||||
BUTTON_TEST(NiDsPS4Controller, CircleButton)
|
||||
BUTTON_TEST(NiDsPS4Controller, TriangleButton)
|
||||
|
||||
BUTTON_TEST(NiDsPS4Controller, L1Button)
|
||||
BUTTON_TEST(NiDsPS4Controller, R1Button)
|
||||
BUTTON_TEST(NiDsPS4Controller, L2Button)
|
||||
BUTTON_TEST(NiDsPS4Controller, R2Button)
|
||||
|
||||
BUTTON_TEST(NiDsPS4Controller, ShareButton)
|
||||
BUTTON_TEST(NiDsPS4Controller, OptionsButton)
|
||||
|
||||
BUTTON_TEST(NiDsPS4Controller, L3Button)
|
||||
BUTTON_TEST(NiDsPS4Controller, R3Button)
|
||||
|
||||
BUTTON_TEST(NiDsPS4Controller, PSButton)
|
||||
BUTTON_TEST(NiDsPS4Controller, TouchpadButton)
|
||||
|
||||
AXIS_TEST(NiDsPS4Controller, LeftX)
|
||||
AXIS_TEST(NiDsPS4Controller, RightX)
|
||||
AXIS_TEST(NiDsPS4Controller, LeftY)
|
||||
AXIS_TEST(NiDsPS4Controller, RightY)
|
||||
AXIS_TEST(NiDsPS4Controller, L2Axis)
|
||||
AXIS_TEST(NiDsPS4Controller, R2Axis)
|
||||
38
wpilibc/src/test/native/cpp/NiDsPS5ControllerTest.cpp
Normal file
38
wpilibc/src/test/native/cpp/NiDsPS5ControllerTest.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/driverstation/NiDsPS5Controller.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "JoystickTestMacros.hpp"
|
||||
#include "wpi/simulation/NiDsPS5ControllerSim.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
BUTTON_TEST(NiDsPS5Controller, SquareButton)
|
||||
BUTTON_TEST(NiDsPS5Controller, CrossButton)
|
||||
BUTTON_TEST(NiDsPS5Controller, CircleButton)
|
||||
BUTTON_TEST(NiDsPS5Controller, TriangleButton)
|
||||
|
||||
BUTTON_TEST(NiDsPS5Controller, L1Button)
|
||||
BUTTON_TEST(NiDsPS5Controller, R1Button)
|
||||
BUTTON_TEST(NiDsPS5Controller, L2Button)
|
||||
BUTTON_TEST(NiDsPS5Controller, R2Button)
|
||||
|
||||
BUTTON_TEST(NiDsPS5Controller, CreateButton)
|
||||
BUTTON_TEST(NiDsPS5Controller, OptionsButton)
|
||||
|
||||
BUTTON_TEST(NiDsPS5Controller, L3Button)
|
||||
BUTTON_TEST(NiDsPS5Controller, R3Button)
|
||||
|
||||
BUTTON_TEST(NiDsPS5Controller, PSButton)
|
||||
BUTTON_TEST(NiDsPS5Controller, TouchpadButton)
|
||||
|
||||
AXIS_TEST(NiDsPS5Controller, LeftX)
|
||||
AXIS_TEST(NiDsPS5Controller, RightX)
|
||||
AXIS_TEST(NiDsPS5Controller, LeftY)
|
||||
AXIS_TEST(NiDsPS5Controller, RightY)
|
||||
AXIS_TEST(NiDsPS5Controller, L2Axis)
|
||||
AXIS_TEST(NiDsPS5Controller, R2Axis)
|
||||
32
wpilibc/src/test/native/cpp/NiDsXboxControllerTest.cpp
Normal file
32
wpilibc/src/test/native/cpp/NiDsXboxControllerTest.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/driverstation/NiDsXboxController.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "JoystickTestMacros.hpp"
|
||||
#include "wpi/simulation/NiDsXboxControllerSim.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
BUTTON_TEST(NiDsXboxController, LeftBumperButton)
|
||||
BUTTON_TEST(NiDsXboxController, RightBumperButton)
|
||||
|
||||
BUTTON_TEST(NiDsXboxController, LeftStickButton)
|
||||
BUTTON_TEST(NiDsXboxController, RightStickButton)
|
||||
BUTTON_TEST(NiDsXboxController, AButton)
|
||||
BUTTON_TEST(NiDsXboxController, BButton)
|
||||
BUTTON_TEST(NiDsXboxController, XButton)
|
||||
BUTTON_TEST(NiDsXboxController, YButton)
|
||||
BUTTON_TEST(NiDsXboxController, BackButton)
|
||||
BUTTON_TEST(NiDsXboxController, StartButton)
|
||||
|
||||
AXIS_TEST(NiDsXboxController, LeftX)
|
||||
AXIS_TEST(NiDsXboxController, RightX)
|
||||
AXIS_TEST(NiDsXboxController, LeftY)
|
||||
AXIS_TEST(NiDsXboxController, RightY)
|
||||
|
||||
AXIS_TEST(NiDsXboxController, LeftTriggerAxis)
|
||||
AXIS_TEST(NiDsXboxController, RightTriggerAxis)
|
||||
@@ -1,38 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/driverstation/PS4Controller.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "JoystickTestMacros.hpp"
|
||||
#include "wpi/simulation/PS4ControllerSim.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
BUTTON_TEST(PS4Controller, SquareButton)
|
||||
BUTTON_TEST(PS4Controller, CrossButton)
|
||||
BUTTON_TEST(PS4Controller, CircleButton)
|
||||
BUTTON_TEST(PS4Controller, TriangleButton)
|
||||
|
||||
BUTTON_TEST(PS4Controller, L1Button)
|
||||
BUTTON_TEST(PS4Controller, R1Button)
|
||||
BUTTON_TEST(PS4Controller, L2Button)
|
||||
BUTTON_TEST(PS4Controller, R2Button)
|
||||
|
||||
BUTTON_TEST(PS4Controller, ShareButton)
|
||||
BUTTON_TEST(PS4Controller, OptionsButton)
|
||||
|
||||
BUTTON_TEST(PS4Controller, L3Button)
|
||||
BUTTON_TEST(PS4Controller, R3Button)
|
||||
|
||||
BUTTON_TEST(PS4Controller, PSButton)
|
||||
BUTTON_TEST(PS4Controller, TouchpadButton)
|
||||
|
||||
AXIS_TEST(PS4Controller, LeftX)
|
||||
AXIS_TEST(PS4Controller, RightX)
|
||||
AXIS_TEST(PS4Controller, LeftY)
|
||||
AXIS_TEST(PS4Controller, RightY)
|
||||
AXIS_TEST(PS4Controller, L2Axis)
|
||||
AXIS_TEST(PS4Controller, R2Axis)
|
||||
@@ -1,38 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/driverstation/PS5Controller.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "JoystickTestMacros.hpp"
|
||||
#include "wpi/simulation/PS5ControllerSim.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
BUTTON_TEST(PS5Controller, SquareButton)
|
||||
BUTTON_TEST(PS5Controller, CrossButton)
|
||||
BUTTON_TEST(PS5Controller, CircleButton)
|
||||
BUTTON_TEST(PS5Controller, TriangleButton)
|
||||
|
||||
BUTTON_TEST(PS5Controller, L1Button)
|
||||
BUTTON_TEST(PS5Controller, R1Button)
|
||||
BUTTON_TEST(PS5Controller, L2Button)
|
||||
BUTTON_TEST(PS5Controller, R2Button)
|
||||
|
||||
BUTTON_TEST(PS5Controller, CreateButton)
|
||||
BUTTON_TEST(PS5Controller, OptionsButton)
|
||||
|
||||
BUTTON_TEST(PS5Controller, L3Button)
|
||||
BUTTON_TEST(PS5Controller, R3Button)
|
||||
|
||||
BUTTON_TEST(PS5Controller, PSButton)
|
||||
BUTTON_TEST(PS5Controller, TouchpadButton)
|
||||
|
||||
AXIS_TEST(PS5Controller, LeftX)
|
||||
AXIS_TEST(PS5Controller, RightX)
|
||||
AXIS_TEST(PS5Controller, LeftY)
|
||||
AXIS_TEST(PS5Controller, RightY)
|
||||
AXIS_TEST(PS5Controller, L2Axis)
|
||||
AXIS_TEST(PS5Controller, R2Axis)
|
||||
@@ -1,33 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "JoystickTestMacros.hpp"
|
||||
#include "wpi/simulation/XboxControllerSim.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
BUTTON_TEST(XboxController, LeftBumperButton)
|
||||
BUTTON_TEST(XboxController, RightBumperButton)
|
||||
|
||||
BUTTON_TEST(XboxController, LeftStickButton)
|
||||
BUTTON_TEST(XboxController, RightStickButton)
|
||||
|
||||
BUTTON_TEST(XboxController, AButton)
|
||||
BUTTON_TEST(XboxController, BButton)
|
||||
BUTTON_TEST(XboxController, XButton)
|
||||
BUTTON_TEST(XboxController, YButton)
|
||||
BUTTON_TEST(XboxController, BackButton)
|
||||
BUTTON_TEST(XboxController, StartButton)
|
||||
|
||||
AXIS_TEST(XboxController, LeftX)
|
||||
AXIS_TEST(XboxController, RightX)
|
||||
AXIS_TEST(XboxController, LeftY)
|
||||
AXIS_TEST(XboxController, RightY)
|
||||
|
||||
AXIS_TEST(XboxController, LeftTriggerAxis)
|
||||
AXIS_TEST(XboxController, RightTriggerAxis)
|
||||
@@ -2,7 +2,7 @@ EXAMPLE_FOLDERS = [
|
||||
"AddressableLED",
|
||||
"AprilTagsVision",
|
||||
"ArcadeDrive",
|
||||
"ArcadeDriveXboxController",
|
||||
"ArcadeDriveGamepad",
|
||||
"ArmSimulation",
|
||||
"CANPDP",
|
||||
"DifferentialDriveBot",
|
||||
@@ -49,7 +49,7 @@ EXAMPLE_FOLDERS = [
|
||||
"SwerveDrivePoseEstimator",
|
||||
"SysIdRoutine",
|
||||
"TankDrive",
|
||||
"TankDriveXboxController",
|
||||
"TankDriveGamepad",
|
||||
"UnitTest",
|
||||
"XRPReference",
|
||||
]
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/drive/DifferentialDrive.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/hardware/motor/PWMSparkMax.hpp"
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of the DifferentialDrive class.
|
||||
* Runs the motors with split arcade steering and an Xbox controller.
|
||||
* Runs the motors with split arcade steering and a Gamepad.
|
||||
*/
|
||||
class Robot : public wpi::TimedRobot {
|
||||
wpi::PWMSparkMax m_leftMotor{0};
|
||||
@@ -17,7 +17,7 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::DifferentialDrive m_robotDrive{
|
||||
[&](double output) { m_leftMotor.Set(output); },
|
||||
[&](double output) { m_rightMotor.Set(output); }};
|
||||
wpi::XboxController m_driverController{0};
|
||||
wpi::Gamepad m_driverController{0};
|
||||
|
||||
public:
|
||||
Robot() {
|
||||
@@ -3,7 +3,7 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "Drivetrain.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/math/filter/SlewRateLimiter.hpp"
|
||||
|
||||
@@ -15,14 +15,14 @@ class Robot : public wpi::TimedRobot {
|
||||
}
|
||||
|
||||
void TeleopPeriodic() override {
|
||||
// Get the x speed. We are inverting this because Xbox controllers return
|
||||
// Get the x speed. We are inverting this because gamepads return
|
||||
// negative values when we push forward.
|
||||
const auto xSpeed = -m_speedLimiter.Calculate(m_controller.GetLeftY()) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the rate of angular rotation. We are inverting this because we want a
|
||||
// positive value when we pull to the left (remember, CCW is positive in
|
||||
// mathematics). Xbox controllers return positive values when you pull to
|
||||
// mathematics). Gamepads return positive values when you pull to
|
||||
// the right by default.
|
||||
const auto rot = -m_rotLimiter.Calculate(m_controller.GetRightX()) *
|
||||
Drivetrain::kMaxAngularSpeed;
|
||||
@@ -31,7 +31,7 @@ class Robot : public wpi::TimedRobot {
|
||||
}
|
||||
|
||||
private:
|
||||
wpi::XboxController m_controller{0};
|
||||
wpi::Gamepad m_controller{0};
|
||||
|
||||
// Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0
|
||||
// to 1.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "Drivetrain.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/math/filter/SlewRateLimiter.hpp"
|
||||
|
||||
@@ -17,14 +17,14 @@ class Robot : public wpi::TimedRobot {
|
||||
void RobotPeriodic() override { m_drive.Periodic(); }
|
||||
|
||||
void TeleopPeriodic() override {
|
||||
// Get the x speed. We are inverting this because Xbox controllers return
|
||||
// Get the x speed. We are inverting this because gamepads return
|
||||
// negative values when we push forward.
|
||||
const auto xSpeed = -m_speedLimiter.Calculate(m_controller.GetLeftY()) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the rate of angular rotation. We are inverting this because we want a
|
||||
// positive value when we pull to the left (remember, CCW is positive in
|
||||
// mathematics). Xbox controllers return positive values when you pull to
|
||||
// mathematics). Gamepads return positive values when you pull to
|
||||
// the right by default.
|
||||
const auto rot = -m_rotLimiter.Calculate(m_controller.GetRightX()) *
|
||||
Drivetrain::kMaxAngularSpeed;
|
||||
@@ -35,7 +35,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void SimulationPeriodic() override { m_drive.SimulationPeriodic(); }
|
||||
|
||||
private:
|
||||
wpi::XboxController m_controller{0};
|
||||
wpi::Gamepad m_controller{0};
|
||||
|
||||
// Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0
|
||||
// to 1.
|
||||
|
||||
@@ -25,18 +25,18 @@ void RobotContainer::ConfigureButtonBindings() {
|
||||
// Configure your button bindings here
|
||||
|
||||
// While holding the shoulder button, drive at half speed
|
||||
m_driverController.RightBumper()
|
||||
m_driverController.RightShoulder()
|
||||
.OnTrue(m_driveHalfSpeed.get())
|
||||
.OnFalse(m_driveFullSpeed.get());
|
||||
|
||||
// Drive forward by 3 meters when the 'A' button is pressed, with a timeout of
|
||||
// 10 seconds
|
||||
m_driverController.A().OnTrue(
|
||||
// Drive forward by 3 meters when the 'South Face' button is pressed, with a
|
||||
// timeout of 10 seconds
|
||||
m_driverController.SouthFace().OnTrue(
|
||||
m_drive.ProfiledDriveDistance(3_m).WithTimeout(10_s));
|
||||
|
||||
// Do the same thing as above when the 'B' button is pressed, but without
|
||||
// resetting the encoders
|
||||
m_driverController.B().OnTrue(
|
||||
// Do the same thing as above when the 'East Face' button is pressed, but
|
||||
// without resetting the encoders
|
||||
m_driverController.EastFace().OnTrue(
|
||||
m_drive.DynamicProfiledDriveDistance(3_m).WithTimeout(10_s));
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "wpi/commands2/Command.hpp"
|
||||
#include "wpi/commands2/CommandPtr.hpp"
|
||||
#include "wpi/commands2/Commands.hpp"
|
||||
#include "wpi/commands2/button/CommandXboxController.hpp"
|
||||
#include "wpi/commands2/button/CommandGamepad.hpp"
|
||||
|
||||
/**
|
||||
* This class is where the bulk of the robot should be declared. Since
|
||||
@@ -26,7 +26,7 @@ class RobotContainer {
|
||||
|
||||
private:
|
||||
// The driver's controller
|
||||
wpi::cmd::CommandXboxController m_driverController{
|
||||
wpi::cmd::CommandGamepad m_driverController{
|
||||
OIConstants::kDriverControllerPort};
|
||||
|
||||
// The robot's subsystems and commands are defined here...
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/drive/DifferentialDrive.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/hardware/motor/PWMSparkMax.hpp"
|
||||
#include "wpi/system/Timer.hpp"
|
||||
@@ -55,7 +55,7 @@ class Robot : public wpi::TimedRobot {
|
||||
[&](double output) { m_left.Set(output); },
|
||||
[&](double output) { m_right.Set(output); }};
|
||||
|
||||
wpi::XboxController m_controller{0};
|
||||
wpi::Gamepad m_controller{0};
|
||||
wpi::Timer m_timer;
|
||||
};
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ RobotContainer::RobotContainer() {
|
||||
void RobotContainer::ConfigureButtonBindings() {
|
||||
// Configure your button bindings here
|
||||
|
||||
// Grab the hatch when the 'Circle' button is pressed.
|
||||
m_driverController.Circle().OnTrue(m_hatch.GrabHatchCommand());
|
||||
// Release the hatch when the 'Square' button is pressed.
|
||||
m_driverController.Square().OnTrue(m_hatch.ReleaseHatchCommand());
|
||||
// While holding R1, drive at half speed
|
||||
m_driverController.R1()
|
||||
// Grab the hatch when the 'East Face' button is pressed.
|
||||
m_driverController.EastFace().OnTrue(m_hatch.GrabHatchCommand());
|
||||
// Release the hatch when the 'West Face' button is pressed.
|
||||
m_driverController.WestFace().OnTrue(m_hatch.ReleaseHatchCommand());
|
||||
// While holding Right Bumper, drive at half speed
|
||||
m_driverController.RightShoulder()
|
||||
.OnTrue(wpi::cmd::cmd::RunOnce([this] { m_drive.SetMaxOutput(0.5); }, {}))
|
||||
.OnFalse(
|
||||
wpi::cmd::cmd::RunOnce([this] { m_drive.SetMaxOutput(1.0); }, {}));
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "subsystems/HatchSubsystem.hpp"
|
||||
#include "wpi/commands2/Command.hpp"
|
||||
#include "wpi/commands2/Commands.hpp"
|
||||
#include "wpi/commands2/button/CommandPS4Controller.hpp"
|
||||
#include "wpi/commands2/button/CommandGamepad.hpp"
|
||||
#include "wpi/smartdashboard/SendableChooser.hpp"
|
||||
|
||||
namespace ac = AutoConstants;
|
||||
@@ -30,7 +30,7 @@ class RobotContainer {
|
||||
|
||||
private:
|
||||
// The driver's controller
|
||||
wpi::cmd::CommandPS4Controller m_driverController{
|
||||
wpi::cmd::CommandGamepad m_driverController{
|
||||
OIConstants::kDriverControllerPort};
|
||||
|
||||
// The robot's subsystems and commands are defined here...
|
||||
|
||||
@@ -39,15 +39,16 @@ void RobotContainer::ConfigureButtonBindings() {
|
||||
// NOTE: since we're binding a CommandPtr, command ownership here is moved to
|
||||
// the scheduler thus, no memory leaks!
|
||||
|
||||
// Grab the hatch when the 'A' button is pressed.
|
||||
wpi::cmd::JoystickButton(&m_driverController, wpi::XboxController::Button::kA)
|
||||
// Grab the hatch when the 'South Face' button is pressed.
|
||||
wpi::cmd::JoystickButton(&m_driverController,
|
||||
wpi::Gamepad::Button::kSouthFace)
|
||||
.OnTrue(GrabHatch(&m_hatch).ToPtr());
|
||||
// Release the hatch when the 'B' button is pressed.
|
||||
wpi::cmd::JoystickButton(&m_driverController, wpi::XboxController::Button::kB)
|
||||
// Release the hatch when the 'East Face' button is pressed.
|
||||
wpi::cmd::JoystickButton(&m_driverController, wpi::Gamepad::Button::kEastFace)
|
||||
.OnTrue(ReleaseHatch(&m_hatch).ToPtr());
|
||||
// While holding the shoulder button, drive at half speed
|
||||
wpi::cmd::JoystickButton(&m_driverController,
|
||||
wpi::XboxController::Button::kRightBumper)
|
||||
wpi::Gamepad::Button::kRightShoulder)
|
||||
.WhileTrue(HalveDriveSpeed(&m_drive).ToPtr());
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "subsystems/DriveSubsystem.hpp"
|
||||
#include "subsystems/HatchSubsystem.hpp"
|
||||
#include "wpi/commands2/Command.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/smartdashboard/SendableChooser.hpp"
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ class RobotContainer {
|
||||
wpi::SendableChooser<wpi::cmd::Command*> m_chooser;
|
||||
|
||||
// The driver's controller
|
||||
wpi::XboxController m_driverController{OIConstants::kDriverControllerPort};
|
||||
wpi::Gamepad m_driverController{OIConstants::kDriverControllerPort};
|
||||
|
||||
void ConfigureButtonBindings();
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "Drivetrain.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/math/filter/SlewRateLimiter.hpp"
|
||||
|
||||
@@ -17,7 +17,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void TeleopPeriodic() override { DriveWithJoystick(true); }
|
||||
|
||||
private:
|
||||
wpi::XboxController m_controller{0};
|
||||
wpi::Gamepad m_controller{0};
|
||||
Drivetrain m_mecanum;
|
||||
|
||||
// Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0
|
||||
@@ -27,20 +27,20 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::math::SlewRateLimiter<wpi::units::scalar> m_rotLimiter{3 / 1_s};
|
||||
|
||||
void DriveWithJoystick(bool fieldRelative) {
|
||||
// Get the x speed. We are inverting this because Xbox controllers return
|
||||
// Get the x speed. We are inverting this because gamepads return
|
||||
// negative values when we push forward.
|
||||
const auto xSpeed = -m_xspeedLimiter.Calculate(m_controller.GetLeftY()) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the y speed or sideways/strafe speed. We are inverting this because
|
||||
// we want a positive value when we pull to the left. Xbox controllers
|
||||
// we want a positive value when we pull to the left. Gamepads
|
||||
// return positive values when you pull to the right by default.
|
||||
const auto ySpeed = -m_yspeedLimiter.Calculate(m_controller.GetLeftX()) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the rate of angular rotation. We are inverting this because we want a
|
||||
// positive value when we pull to the left (remember, CCW is positive in
|
||||
// mathematics). Xbox controllers return positive values when you pull to
|
||||
// mathematics). Gamepads return positive values when you pull to
|
||||
// the right by default.
|
||||
const auto rot = -m_rotLimiter.Calculate(m_controller.GetRightX()) *
|
||||
Drivetrain::kMaxAngularSpeed;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "Drivetrain.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/math/filter/SlewRateLimiter.hpp"
|
||||
|
||||
@@ -17,7 +17,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void TeleopPeriodic() override { DriveWithJoystick(true); }
|
||||
|
||||
private:
|
||||
wpi::XboxController m_controller{0};
|
||||
wpi::Gamepad m_controller{0};
|
||||
Drivetrain m_mecanum;
|
||||
|
||||
// Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0
|
||||
@@ -27,20 +27,20 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::math::SlewRateLimiter<wpi::units::scalar> m_rotLimiter{3 / 1_s};
|
||||
|
||||
void DriveWithJoystick(bool fieldRelative) {
|
||||
// Get the x speed. We are inverting this because Xbox controllers return
|
||||
// Get the x speed. We are inverting this because gamepads return
|
||||
// negative values when we push forward.
|
||||
const auto xSpeed = -m_xspeedLimiter.Calculate(m_controller.GetLeftY()) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the y speed or sideways/strafe speed. We are inverting this because
|
||||
// we want a positive value when we pull to the left. Xbox controllers
|
||||
// we want a positive value when we pull to the left. Gamepads
|
||||
// return positive values when you pull to the right by default.
|
||||
const auto ySpeed = -m_yspeedLimiter.Calculate(m_controller.GetLeftX()) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the rate of angular rotation. We are inverting this because we want a
|
||||
// positive value when we pull to the left (remember, CCW is positive in
|
||||
// mathematics). Xbox controllers return positive values when you pull to
|
||||
// mathematics). Gamepads return positive values when you pull to
|
||||
// the right by default.
|
||||
const auto rot = -m_rotLimiter.Calculate(m_controller.GetRightX()) *
|
||||
Drivetrain::kMaxAngularSpeed;
|
||||
|
||||
@@ -24,13 +24,13 @@ void RapidReactCommandBot::ConfigureBindings() {
|
||||
[this] { return -m_driverController.GetLeftY(); },
|
||||
[this] { return -m_driverController.GetRightX(); }));
|
||||
|
||||
// Deploy the intake with the X button
|
||||
m_driverController.X().OnTrue(m_intake.IntakeCommand());
|
||||
// Retract the intake with the Y button
|
||||
m_driverController.Y().OnTrue(m_intake.RetractCommand());
|
||||
// Deploy the intake with the West Face button
|
||||
m_driverController.WestFace().OnTrue(m_intake.IntakeCommand());
|
||||
// Retract the intake with the North Face button
|
||||
m_driverController.NorthFace().OnTrue(m_intake.RetractCommand());
|
||||
|
||||
// Fire the shooter with the A button
|
||||
m_driverController.A().OnTrue(
|
||||
// Fire the shooter with the South Face button
|
||||
m_driverController.SouthFace().OnTrue(
|
||||
wpi::cmd::cmd::Parallel(
|
||||
m_shooter.ShootCommand(ShooterConstants::kShooterTarget),
|
||||
m_storage.RunCommand())
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "subsystems/Shooter.hpp"
|
||||
#include "subsystems/Storage.hpp"
|
||||
#include "wpi/commands2/CommandPtr.hpp"
|
||||
#include "wpi/commands2/button/CommandXboxController.hpp"
|
||||
#include "wpi/commands2/button/CommandGamepad.hpp"
|
||||
|
||||
/**
|
||||
* This class is where the bulk of the robot should be declared. Since
|
||||
@@ -48,6 +48,6 @@ class RapidReactCommandBot {
|
||||
Pneumatics m_pneumatics;
|
||||
|
||||
// The driver's controller
|
||||
wpi::cmd::CommandXboxController m_driverController{
|
||||
wpi::cmd::CommandGamepad m_driverController{
|
||||
OIConstants::kDriverControllerPort};
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "Drivetrain.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/math/controller/LTVUnicycleController.hpp"
|
||||
#include "wpi/math/filter/SlewRateLimiter.hpp"
|
||||
@@ -52,7 +52,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void SimulationPeriodic() override { m_drive.SimulationPeriodic(); }
|
||||
|
||||
private:
|
||||
wpi::XboxController m_controller{0};
|
||||
wpi::Gamepad m_controller{0};
|
||||
|
||||
// Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0
|
||||
// to 1.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <numbers>
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/hardware/motor/PWMSparkMax.hpp"
|
||||
#include "wpi/hardware/rotation/Encoder.hpp"
|
||||
@@ -85,7 +85,7 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::Encoder m_encoder{kEncoderAChannel, kEncoderBChannel};
|
||||
|
||||
wpi::PWMSparkMax m_motor{kMotorPort};
|
||||
wpi::XboxController m_joystick{kJoystickPort};
|
||||
wpi::Gamepad m_joystick{kJoystickPort};
|
||||
|
||||
wpi::math::TrapezoidProfile<wpi::units::radians> m_profile{
|
||||
{45_deg_per_s, 90_deg_per_s / 1_s}};
|
||||
@@ -112,7 +112,7 @@ class Robot : public wpi::TimedRobot {
|
||||
// Sets the target position of our arm. This is similar to setting the
|
||||
// setpoint of a PID controller.
|
||||
wpi::math::TrapezoidProfile<wpi::units::radians>::State goal;
|
||||
if (m_joystick.GetRightBumperButton()) {
|
||||
if (m_joystick.GetRightShoulderButton()) {
|
||||
// We pressed the bumper, so let's set our next reference
|
||||
goal = {kRaisedPosition, 0_rad_per_s};
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <numbers>
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/hardware/motor/PWMSparkMax.hpp"
|
||||
#include "wpi/hardware/rotation/Encoder.hpp"
|
||||
@@ -84,7 +84,7 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::Encoder m_encoder{kEncoderAChannel, kEncoderBChannel};
|
||||
|
||||
wpi::PWMSparkMax m_motor{kMotorPort};
|
||||
wpi::XboxController m_joystick{kJoystickPort};
|
||||
wpi::Gamepad m_joystick{kJoystickPort};
|
||||
|
||||
wpi::math::TrapezoidProfile<wpi::units::meters> m_profile{{3_fps, 6_fps_sq}};
|
||||
|
||||
@@ -112,7 +112,7 @@ class Robot : public wpi::TimedRobot {
|
||||
// Sets the target height of our elevator. This is similar to setting the
|
||||
// setpoint of a PID controller.
|
||||
wpi::math::TrapezoidProfile<wpi::units::meters>::State goal;
|
||||
if (m_joystick.GetRightBumperButton()) {
|
||||
if (m_joystick.GetRightShoulderButton()) {
|
||||
// We pressed the bumper, so let's set our next reference
|
||||
goal = {kRaisedPosition, 0_fps};
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <numbers>
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/hardware/motor/PWMSparkMax.hpp"
|
||||
#include "wpi/hardware/rotation/Encoder.hpp"
|
||||
@@ -76,7 +76,7 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::Encoder m_encoder{kEncoderAChannel, kEncoderBChannel};
|
||||
|
||||
wpi::PWMSparkMax m_motor{kMotorPort};
|
||||
wpi::XboxController m_joystick{kJoystickPort};
|
||||
wpi::Gamepad m_joystick{kJoystickPort};
|
||||
|
||||
public:
|
||||
Robot() {
|
||||
@@ -91,7 +91,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void TeleopPeriodic() override {
|
||||
// Sets the target speed of our flywheel. This is similar to setting the
|
||||
// setpoint of a PID controller.
|
||||
if (m_joystick.GetRightBumperButton()) {
|
||||
if (m_joystick.GetRightShoulderButton()) {
|
||||
// We pressed the bumper, so let's set our next reference
|
||||
m_loop.SetNextR(wpi::math::Vectord<1>{kSpinup.value()});
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <numbers>
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/hardware/motor/PWMSparkMax.hpp"
|
||||
#include "wpi/hardware/rotation/Encoder.hpp"
|
||||
@@ -73,7 +73,7 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::Encoder m_encoder{kEncoderAChannel, kEncoderBChannel};
|
||||
|
||||
wpi::PWMSparkMax m_motor{kMotorPort};
|
||||
wpi::XboxController m_joystick{kJoystickPort};
|
||||
wpi::Gamepad m_joystick{kJoystickPort};
|
||||
|
||||
public:
|
||||
Robot() {
|
||||
@@ -88,7 +88,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void TeleopPeriodic() override {
|
||||
// Sets the target speed of our flywheel. This is similar to setting the
|
||||
// setpoint of a PID controller.
|
||||
if (m_joystick.GetRightBumperButton()) {
|
||||
if (m_joystick.GetRightShoulderButton()) {
|
||||
// We pressed the bumper, so let's set our next reference
|
||||
m_loop.SetNextR(wpi::math::Vectord<1>{kSpinup.value()});
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "Drivetrain.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/math/filter/SlewRateLimiter.hpp"
|
||||
#include "wpi/math/util/MathUtil.hpp"
|
||||
@@ -18,7 +18,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void TeleopPeriodic() override { DriveWithJoystick(true); }
|
||||
|
||||
private:
|
||||
wpi::XboxController m_controller{0};
|
||||
wpi::Gamepad m_controller{0};
|
||||
Drivetrain m_swerve;
|
||||
|
||||
// Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0
|
||||
@@ -28,14 +28,14 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::math::SlewRateLimiter<wpi::units::scalar> m_rotLimiter{3 / 1_s};
|
||||
|
||||
void DriveWithJoystick(bool fieldRelative) {
|
||||
// Get the x speed. We are inverting this because Xbox controllers return
|
||||
// Get the x speed. We are inverting this because gamepads return
|
||||
// negative values when we push forward.
|
||||
const auto xSpeed = -m_xspeedLimiter.Calculate(wpi::math::ApplyDeadband(
|
||||
m_controller.GetLeftY(), 0.02)) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the y speed or sideways/strafe speed. We are inverting this because
|
||||
// we want a positive value when we pull to the left. Xbox controllers
|
||||
// we want a positive value when we pull to the left. Gamepads
|
||||
// return positive values when you pull to the right by default.
|
||||
const auto ySpeed = -m_yspeedLimiter.Calculate(wpi::math::ApplyDeadband(
|
||||
m_controller.GetLeftX(), 0.02)) *
|
||||
@@ -43,7 +43,7 @@ class Robot : public wpi::TimedRobot {
|
||||
|
||||
// Get the rate of angular rotation. We are inverting this because we want a
|
||||
// positive value when we pull to the left (remember, CCW is positive in
|
||||
// mathematics). Xbox controllers return positive values when you pull to
|
||||
// mathematics). Gamepads return positive values when you pull to
|
||||
// the right by default.
|
||||
const auto rot = -m_rotLimiter.Calculate(wpi::math::ApplyDeadband(
|
||||
m_controller.GetRightX(), 0.02)) *
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "Drivetrain.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/math/filter/SlewRateLimiter.hpp"
|
||||
|
||||
@@ -17,7 +17,7 @@ class Robot : public wpi::TimedRobot {
|
||||
void TeleopPeriodic() override { DriveWithJoystick(true); }
|
||||
|
||||
private:
|
||||
wpi::XboxController m_controller{0};
|
||||
wpi::Gamepad m_controller{0};
|
||||
Drivetrain m_swerve;
|
||||
|
||||
// Slew rate limiters to make joystick inputs more gentle; 1/3 sec from 0
|
||||
@@ -27,20 +27,20 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::math::SlewRateLimiter<wpi::units::scalar> m_rotLimiter{3 / 1_s};
|
||||
|
||||
void DriveWithJoystick(bool fieldRelative) {
|
||||
// Get the x speed. We are inverting this because Xbox controllers return
|
||||
// Get the x speed. We are inverting this because gamepads return
|
||||
// negative values when we push forward.
|
||||
const auto xSpeed = -m_xspeedLimiter.Calculate(m_controller.GetLeftY()) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the y speed or sideways/strafe speed. We are inverting this because
|
||||
// we want a positive value when we pull to the left. Xbox controllers
|
||||
// we want a positive value when we pull to the left. Gamepads
|
||||
// return positive values when you pull to the right by default.
|
||||
const auto ySpeed = -m_yspeedLimiter.Calculate(m_controller.GetLeftX()) *
|
||||
Drivetrain::kMaxSpeed;
|
||||
|
||||
// Get the rate of angular rotation. We are inverting this because we want a
|
||||
// positive value when we pull to the left (remember, CCW is positive in
|
||||
// mathematics). Xbox controllers return positive values when you pull to
|
||||
// mathematics). Gamepads return positive values when you pull to
|
||||
// the right by default.
|
||||
const auto rot = -m_rotLimiter.Calculate(m_controller.GetRightX()) *
|
||||
Drivetrain::kMaxAngularSpeed;
|
||||
|
||||
@@ -17,29 +17,29 @@ void SysIdRoutineBot::ConfigureBindings() {
|
||||
|
||||
// Using bumpers as a modifier and combining it with the buttons so that we
|
||||
// can have both sets of bindings at once
|
||||
(m_driverController.A() && m_driverController.RightBumper())
|
||||
(m_driverController.SouthFace() && m_driverController.RightShoulder())
|
||||
.WhileTrue(
|
||||
m_drive.SysIdQuasistatic(wpi::cmd::sysid::Direction::kForward));
|
||||
(m_driverController.B() && m_driverController.RightBumper())
|
||||
(m_driverController.EastFace() && m_driverController.RightShoulder())
|
||||
.WhileTrue(
|
||||
m_drive.SysIdQuasistatic(wpi::cmd::sysid::Direction::kReverse));
|
||||
(m_driverController.X() && m_driverController.RightBumper())
|
||||
(m_driverController.WestFace() && m_driverController.RightShoulder())
|
||||
.WhileTrue(m_drive.SysIdDynamic(wpi::cmd::sysid::Direction::kForward));
|
||||
(m_driverController.Y() && m_driverController.RightBumper())
|
||||
(m_driverController.NorthFace() && m_driverController.RightShoulder())
|
||||
.WhileTrue(m_drive.SysIdDynamic(wpi::cmd::sysid::Direction::kReverse));
|
||||
|
||||
m_shooter.SetDefaultCommand(m_shooter.RunShooterCommand(
|
||||
[this] { return m_driverController.GetLeftTriggerAxis(); }));
|
||||
|
||||
(m_driverController.A() && m_driverController.LeftBumper())
|
||||
(m_driverController.SouthFace() && m_driverController.LeftShoulder())
|
||||
.WhileTrue(
|
||||
m_shooter.SysIdQuasistatic(wpi::cmd::sysid::Direction::kForward));
|
||||
(m_driverController.B() && m_driverController.LeftBumper())
|
||||
(m_driverController.EastFace() && m_driverController.LeftShoulder())
|
||||
.WhileTrue(
|
||||
m_shooter.SysIdQuasistatic(wpi::cmd::sysid::Direction::kReverse));
|
||||
(m_driverController.X() && m_driverController.LeftBumper())
|
||||
(m_driverController.WestFace() && m_driverController.LeftShoulder())
|
||||
.WhileTrue(m_shooter.SysIdDynamic(wpi::cmd::sysid::Direction::kForward));
|
||||
(m_driverController.Y() && m_driverController.LeftBumper())
|
||||
(m_driverController.NorthFace() && m_driverController.LeftShoulder())
|
||||
.WhileTrue(m_shooter.SysIdDynamic(wpi::cmd::sysid::Direction::kReverse));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "subsystems/Drive.hpp"
|
||||
#include "subsystems/Shooter.hpp"
|
||||
#include "wpi/commands2/CommandPtr.hpp"
|
||||
#include "wpi/commands2/button/CommandXboxController.hpp"
|
||||
#include "wpi/commands2/button/CommandGamepad.hpp"
|
||||
|
||||
class SysIdRoutineBot {
|
||||
public:
|
||||
@@ -18,7 +18,7 @@ class SysIdRoutineBot {
|
||||
|
||||
private:
|
||||
void ConfigureBindings();
|
||||
wpi::cmd::CommandXboxController m_driverController{
|
||||
wpi::cmd::CommandGamepad m_driverController{
|
||||
constants::oi::kDriverControllerPort};
|
||||
Drive m_drive;
|
||||
Shooter m_shooter;
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/drive/DifferentialDrive.hpp"
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/Gamepad.hpp"
|
||||
#include "wpi/framework/TimedRobot.hpp"
|
||||
#include "wpi/hardware/motor/PWMSparkMax.hpp"
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of the DifferentialDrive class.
|
||||
* Runs the motors with tank steering and an Xbox controller.
|
||||
* Runs the motors with tank steering and a gamepad.
|
||||
*/
|
||||
class Robot : public wpi::TimedRobot {
|
||||
wpi::PWMSparkMax m_leftMotor{0};
|
||||
@@ -17,7 +17,7 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::DifferentialDrive m_robotDrive{
|
||||
[&](double output) { m_leftMotor.Set(output); },
|
||||
[&](double output) { m_rightMotor.Set(output); }};
|
||||
wpi::XboxController m_driverController{0};
|
||||
wpi::Gamepad m_driverController{0};
|
||||
|
||||
public:
|
||||
Robot() {
|
||||
@@ -146,7 +146,7 @@
|
||||
"description": "Make human interface devices (HID) rumble.",
|
||||
"tags": [
|
||||
"Hardware",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "HidRumble",
|
||||
"gradlebase": "cpp",
|
||||
@@ -305,7 +305,7 @@
|
||||
"Sendable",
|
||||
"DataLog",
|
||||
"Pneumatics",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "HatchbotTraditional",
|
||||
"gradlebase": "cpp",
|
||||
@@ -322,7 +322,7 @@
|
||||
"Sendable",
|
||||
"DataLog",
|
||||
"Pneumatics",
|
||||
"PS4Controller"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "HatchbotInlined",
|
||||
"gradlebase": "cpp",
|
||||
@@ -343,7 +343,7 @@
|
||||
"PID",
|
||||
"Gyro",
|
||||
"Profiled PID",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "RapidReactCommandBot",
|
||||
"gradlebase": "cpp",
|
||||
@@ -365,7 +365,7 @@
|
||||
"tags": [
|
||||
"Swerve Drive",
|
||||
"Odometry",
|
||||
"XboxController",
|
||||
"Gamepad",
|
||||
"Gyro",
|
||||
"Encoder"
|
||||
],
|
||||
@@ -381,7 +381,7 @@
|
||||
"Odometry",
|
||||
"Encoder",
|
||||
"Gyro",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "MecanumBot",
|
||||
"gradlebase": "cpp",
|
||||
@@ -395,7 +395,7 @@
|
||||
"Odometry",
|
||||
"Encoder",
|
||||
"Gyro",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "DifferentialDriveBot",
|
||||
"gradlebase": "cpp",
|
||||
@@ -407,21 +407,21 @@
|
||||
"tags": [
|
||||
"Basic Robot",
|
||||
"Differential Drive",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "ArcadeDriveXboxController",
|
||||
"foldername": "ArcadeDriveGamepad",
|
||||
"gradlebase": "cpp",
|
||||
"commandversion": 2
|
||||
},
|
||||
{
|
||||
"name": "Tank Drive Xbox Controller",
|
||||
"description": "Control a differential drive with Xbox tank drive in teleop.",
|
||||
"name": "Tank Drive Gamepad",
|
||||
"description": "Control a differential drive with gamepad tank drive in teleop.",
|
||||
"tags": [
|
||||
"Basic Robot",
|
||||
"Differential Drive",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "TankDriveXboxController",
|
||||
"foldername": "TankDriveGamepad",
|
||||
"gradlebase": "cpp",
|
||||
"commandversion": 2
|
||||
},
|
||||
@@ -470,7 +470,7 @@
|
||||
"Differential Drive",
|
||||
"Trapezoid Profile",
|
||||
"Smart Motor Controller",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "DriveDistanceOffboard",
|
||||
"gradlebase": "cpp",
|
||||
@@ -611,7 +611,7 @@
|
||||
"Pose Estimator",
|
||||
"Vision",
|
||||
"PID",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "DifferentialDrivePoseEstimator",
|
||||
"gradlebase": "cpp",
|
||||
@@ -626,7 +626,7 @@
|
||||
"Pose Estimator",
|
||||
"Vision",
|
||||
"PID",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "MecanumDrivePoseEstimator",
|
||||
"gradlebase": "cpp",
|
||||
@@ -670,7 +670,7 @@
|
||||
"Path Following",
|
||||
"Trajectory",
|
||||
"Encoder",
|
||||
"XboxController",
|
||||
"Gamepad",
|
||||
"Simulation"
|
||||
],
|
||||
"foldername": "SimpleDifferentialDriveSimulation",
|
||||
@@ -686,7 +686,7 @@
|
||||
"Pose Estimator",
|
||||
"Vision",
|
||||
"PID",
|
||||
"XboxController"
|
||||
"Gamepad"
|
||||
],
|
||||
"foldername": "SwerveDrivePoseEstimator",
|
||||
"gradlebase": "cpp",
|
||||
|
||||
@@ -23,9 +23,9 @@ void RobotContainer::ConfigureBindings() {
|
||||
return m_subsystem.ExampleCondition();
|
||||
}).OnTrue(ExampleCommand(&m_subsystem).ToPtr());
|
||||
|
||||
// Schedule `ExampleMethodCommand` when the Xbox controller's B button is
|
||||
// Schedule `ExampleMethodCommand` when the Gamepad's East Face button is
|
||||
// pressed, cancelling on release.
|
||||
m_driverController.B().WhileTrue(m_subsystem.ExampleMethodCommand());
|
||||
m_driverController.EastFace().WhileTrue(m_subsystem.ExampleMethodCommand());
|
||||
}
|
||||
|
||||
wpi::cmd::CommandPtr RobotContainer::GetAutonomousCommand() {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "Constants.hpp"
|
||||
#include "subsystems/ExampleSubsystem.hpp"
|
||||
#include "wpi/commands2/CommandPtr.hpp"
|
||||
#include "wpi/commands2/button/CommandXboxController.hpp"
|
||||
#include "wpi/commands2/button/CommandGamepad.hpp"
|
||||
|
||||
/**
|
||||
* This class is where the bulk of the robot should be declared. Since
|
||||
@@ -24,7 +24,7 @@ class RobotContainer {
|
||||
|
||||
private:
|
||||
// Replace with CommandPS4Controller or CommandJoystick if needed
|
||||
wpi::cmd::CommandXboxController m_driverController{
|
||||
wpi::cmd::CommandGamepad m_driverController{
|
||||
OperatorConstants::kDriverControllerPort};
|
||||
|
||||
// The robot's subsystems are defined here...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"ConsoleName": "Xbox",
|
||||
"ConsoleName": "NiDsXbox",
|
||||
"Manufacturer": "Microsoft",
|
||||
"AxisNameSuffix": "Trigger",
|
||||
"buttons": [
|
||||
@@ -103,7 +103,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"ConsoleName": "PS4",
|
||||
"ConsoleName": "NiDsPS4",
|
||||
"Manufacturer": "Sony",
|
||||
"AxisNameSuffix": "2",
|
||||
"buttons": [
|
||||
@@ -221,7 +221,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"ConsoleName": "PS5",
|
||||
"ConsoleName": "NiDsPS5",
|
||||
"Manufacturer": "Sony",
|
||||
"AxisNameSuffix": "2",
|
||||
"buttons": [
|
||||
@@ -339,7 +339,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"ConsoleName": "Stadia",
|
||||
"ConsoleName": "NiDsStadia",
|
||||
"Manufacturer": "Google",
|
||||
"AxisNameSuffix": "Trigger",
|
||||
"buttons": [
|
||||
|
||||
@@ -67,53 +67,4 @@ public class {{ ConsoleName }}ControllerSim extends GenericHIDSim {
|
||||
setRawButton({{ ConsoleName }}Controller.Button.k{{ capitalize_first(button.name) }}.value, value);
|
||||
}
|
||||
{% endfor -%}
|
||||
{% if ConsoleName == "Xbox" %}
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
{% elif ConsoleName == "PS4" %}
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
{% elif ConsoleName == "PS5" %}
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
{% endif -%}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user