Skip to content
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

Analogue thrust #3237

Closed

Conversation

fluffyfreak
Copy link
Contributor

Add support for splitting the axes for pitch/yaw/roll (#3147) (@radius75)

Add support for mapping the thrusters to joystick/pad axes (#27)

Also #3236 is a part of this PR so should be merged first.

@impaktor
Copy link
Member

Maybe @kuroneko has opinions, feedback, or want to test this before merge?

@fluffyfreak
Copy link
Contributor Author

Also @kuroneko you might be interested in these if you're still doing controller stuff?

@fluffyfreak
Copy link
Contributor Author

Ah, good morning @impaktor, I just had exactly the same thought :D

@radius75
Copy link
Contributor

Hi, I tested your branch.
bez tytulu
Settings for Pitch and Yaw working properly.

For Roll i must:

  • settings

Roll Left - press to maximum left trigger and click OK
Roll Right - press to maximum right trigger and click OK

  • in game

press to maximum left then right trigger, always after starting game and take off:

Otherwise I have symptoms like #3147
After these actions steering works well.

note:
Left trigger release = -4Axis
Left triger pressed = 4Axis
Right trigger release = -5Axis
Right triger pressed = 5Axis

Trigger pressed halfway changing /-/ on /"+"/

@fluffyfreak
Copy link
Contributor Author

Yep I can repro that, not sure why it's happening yet. Thanks for testing it though @radius75 :)

@fluffyfreak
Copy link
Contributor Author

Well that's a bugger, basically the triggers on a pad run from -1:1 not 0:1 so the reason it works once you've pressed both triggers is because they're then passing in -1 + 1 which cancels out to no input, but if they were unbalanced because you had done something crazy like map on trigger to shoot and the other to yaw then you'd just spin in a circle whenever you weren't holding it at exactly 50% pressed.

Damn, this will need some more thinking because I can fix it for the specific case of the Xbox360 pad but that won't fix it for other controllers which might behave differently.

@fluffyfreak fluffyfreak added the WIP label Nov 3, 2014
@fluffyfreak fluffyfreak self-assigned this Nov 3, 2014
@fluffyfreak
Copy link
Contributor Author

As far as I can tell the problem is that the controller doesn't start sending any values until you've pressed it. Then the value it's sends are different than when it was at rest!!!

@kuroneko
Copy link
Contributor

More specifically, that's because the input system assumes all axes are self-centering or have a centre position, and assumes that they start in the centre position.

Rather than initialising the axes to 0, it should be polling the axes positions from the API.

@fluffyfreak
Copy link
Contributor Author

@kuroneko ah ha! yes that'd do it, thanks :)

@fluffyfreak
Copy link
Contributor Author

Trouble is that when you try and poll it the value it returns really is 0.0f, it's only once it's running and you've pressed the trigger (xbox360 pad) that it starts to return values in the -1 to 1.

This might require an actual configuration step so that the min/max can be found. Nasty.
Means it will need storing with the config mapping somehow if it does.
Alternatively I can just assume that for single axis mapping it will always run from -1 to 1, or the negative of the axis it's trying to read anyway.

...needs more thought/practice.

@kuroneko
Copy link
Contributor

Wrong layer - go back one further - the assumption exists between the main pioneer object and the SDL layer -- SDL joystick positions are provided as 16 bit integers, not as float - there's code in Ps? (I've forgotten it's name right now) which translates that to the -1..1 FP range.

@fluffyfreak
Copy link
Contributor Author

@kuroneko that's not relevant this time, that value gets blindly converted into a float regardless of what it is so whether I catch it then, which is not practical, or after it's converted to float doesn't matter.

The point is that even when it's an Sint16 it still gets a value of 0 at the start, but then gives -32768 afterwards. The problem isn't in Pioneer, it's either in SDL2 or the drivers. My money is on the pad drivers.

@fluffyfreak
Copy link
Contributor Author

Although I do see what you mean now, it should be fetching the initial value from the API rather than waiting for the axis event...

@fluffyfreak
Copy link
Contributor Author

I'm closing this for now, if someone else wants to pick it up then feel free but I'm going to do something else less frustrating for a bit. Might come back to it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants