-
Notifications
You must be signed in to change notification settings - Fork 611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the PS5 DualSense controller #5257
Conversation
Does this add any functionality or changed button mappings compared to the PS4Controller class? If not I’d probably rather just rename PS4Controller to PSController |
Yes, if you look at the two structs, the mapping is different. PS5: struct Button {
static constexpr int kSquare = 3;
static constexpr int kCross = 1;
static constexpr int kCircle = 2;
static constexpr int kTriangle = 4;
static constexpr int kL1 = 5;
static constexpr int kR1 = 6;
static constexpr int kL2 = 7;
static constexpr int kR2 = 8;
static constexpr int kCreate = 9;
static constexpr int kOptions = 10;
static constexpr int kL3 = 12;
static constexpr int kR3 = 13;
static constexpr int kPS = 11;
static constexpr int kTouchpad = 14;
};
struct Axis {
static constexpr int kLeftX = 0;
static constexpr int kLeftY = 1;
static constexpr int kRightX = 3;
static constexpr int kRightY = 4;
static constexpr int kL2 = 2;
static constexpr int kR2 = 5;
}; PS4: struct Button {
static constexpr int kSquare = 1;
static constexpr int kCross = 2;
static constexpr int kCircle = 3;
static constexpr int kTriangle = 4;
static constexpr int kL1 = 5;
static constexpr int kR1 = 6;
static constexpr int kL2 = 7;
static constexpr int kR2 = 8;
static constexpr int kShare = 9;
static constexpr int kOptions = 10;
static constexpr int kL3 = 11;
static constexpr int kR3 = 12;
static constexpr int kPS = 13;
static constexpr int kTouchpad = 14;
};
struct Axis {
static constexpr int kLeftX = 0;
static constexpr int kLeftY = 1;
static constexpr int kRightX = 2;
static constexpr int kRightY = 5;
static constexpr int kL2 = 3;
static constexpr int kR2 = 4;
}; |
There's another trivial change. The share button is now called create on the DualSense. |
Are there more changes planned here, or is this ready for review? |
Yes |
Yes....to what? |
This does still need a Java implementation. |
Sorry. Ready for review. |
This should also add a |
I have added the CommandPS5Controller, Java classes, tests, etc. I believe I have added everything. Let me know if something appears to be missing. |
/format |
@PeterJohnson the resource ID needs to be confirmed with NI, right? |
Correct, and PS4 needs to be changed as well (but that should be a separate PR). |
@maxolasersquad Were you using an official stock PS5 controller for this? The mappings I'm seeing are wrong, and on my controller actually map what the PS4 controller does. Also, were you testing with a DS, or with simulation? |
I was using a PlayStation DualSense. We just got a new laptop, and last weekend got it all setup to test our non-competition bot, but we were testing with the XBox input (we have an XBox and PS5 controller). With the upcoming holidays, it may be a couple weeks before I can test again, but will make sure to do that. |
Testing with the XBox input makes it sound like you were using simulation. The xbox checkbox should only be used for xbox controllers, and not for non xbox controllers. And for mappings, the ones we need are with the official DS. We don't guarantee simulation matches the official DS, especially on non windows platforms. |
What I meant was that we were testing our new laptop on our non-competition bot with the XBox mapping, meaning we were not using the PS5 controller and mappings. I will test with the PS5 controller and mappings the next time we meetup again. |
This adds support for the PS5 DualSense controller.