mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11: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:
@@ -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)
|
||||
Reference in New Issue
Block a user