flybywiresim / aircraft

The A32NX & A380X Project are community driven open source projects to create free Airbus aircraft in Microsoft Flight Simulator that are as close to reality as possible.
https://flybywiresim.com
GNU General Public License v3.0
4.97k stars 1.03k forks source link

VR controller - cannot push/pull autopilot knobs #6607

Open dataslug1 opened 2 years ago

dataslug1 commented 2 years ago

Aircraft Version

Experimental

Build info

{
  "built": "2022-01-04T08:12:39+00:00",
  "ref": "experimental",
  "sha": "00c94c19d48c6d75b813cc5d8abd0d7b64c47b02",
  "actor": "aguther",
  "event_name": "manual"
}

Describe the bug

Cannot push/pull heading, altitude or speed knobs when flying with VR controllers

Expected behavior

The default Asobo A320 allows us to grab and push/pull these knobs by highlighting them, squeezing the trigger, and then pulling or pushing the controller forwards or backwards in the air. The FBW A320 does not seem to respond to these gestures.

Steps to reproduce

Any flight in A320

References (optional)

No response

Additional info (optional)

Using Quest 2 controllers, but I expect will be same for all VR controllers

Discord Username (optional)

No response

tracernz commented 2 years ago

If there are any devs out there that are into VR and able to help with VR related issues please do get in touch with us. Most of us don't do VR so we're not aware of VR issues, nor able to fix or test them.

CORNU76 commented 2 years ago

je rencontre exactement le même problème avec l'A320nx, je ne suis pas en VR car je n'emploie pas de casque

CBRadi0 commented 2 years ago

Have you set your Cockpit interaction system setting to Legacy in the flight sim General Options > Accessibility menu?

hzyoni commented 2 years ago

It doesn’t matter. It won’t push/pull. This is soooo essential for Vr. I hope someone comes up with a fix

chrisaut commented 2 years ago

You need to assign cockpit interaction secondary/tertiary action. Secondary pushes, tertiary pulls, I have push set to thumbstick click, and pull to the grip button.

If you also assign cockpit interaction increase/decrease to thumbstick X axis it's a breeze to turn knobs, eg. to change ALT, reach forward to highlight, thumb right, ok, push thumbstick to push knob, AP goes into CLB.

<Context ContextName="COCKPIT_INTERACTIONS">
    <Action ActionName="KEY_COCKPIT_INTERACTION_DECREASE" Flag="2">
        <Primary>
            <KEY Information="Thumbstick X">15</KEY>
        </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_INCREASE" Flag="130">
        <Primary>
            <KEY Information="Thumbstick X">15</KEY>
        </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_PRIMARY_VR_RIGHT" Flag="2">
        <Primary>
            <KEY Information="Trigger">24</KEY>
        </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_SECONDARY" Flag="2">
        <Primary>
            <KEY Information="Thumbstick">13</KEY>
        </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_TERTIARY" Flag="2">
        <Primary>
            <KEY Information="Squeeze">9</KEY>
        </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_Y_AXIS" Flag="4">
        <Primary>
            <KEY Information="Thumbstick Y">16</KEY>
        </Primary>
    </Action>
</Context>

Took me forever to find a this configuration, but now everything is nicely switchable, the only thing that seems a bit of a pain is the flyPad. It kind of works but its seems you have to click 3 or 4 times and wiggle around a bit to make it work.

hzyoni commented 2 years ago

You need to assign cockpit interaction secondary/tertiary action. Secondary pushes, tertiary pulls, I have push set to thumbstick click, and pull to the grip button.

If you also assign cockpit interaction increase/decrease to thumbstick X axis it's a breeze to turn knobs, eg. to change ALT, reach forward to highlight, thumb right, ok, push thumbstick to push knob, AP goes into CLB.

<Context ContextName="COCKPIT_INTERACTIONS">
    <Action ActionName="KEY_COCKPIT_INTERACTION_DECREASE" Flag="2">
      <Primary>
          <KEY Information="Thumbstick X">15</KEY>
      </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_INCREASE" Flag="130">
      <Primary>
          <KEY Information="Thumbstick X">15</KEY>
      </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_PRIMARY_VR_RIGHT" Flag="2">
      <Primary>
          <KEY Information="Trigger">24</KEY>
      </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_SECONDARY" Flag="2">
      <Primary>
          <KEY Information="Thumbstick">13</KEY>
      </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_TERTIARY" Flag="2">
      <Primary>
          <KEY Information="Squeeze">9</KEY>
      </Primary>
    </Action>
    <Action ActionName="KEY_COCKPIT_INTERACTION_Y_AXIS" Flag="4">
      <Primary>
          <KEY Information="Thumbstick Y">16</KEY>
      </Primary>
    </Action>
</Context>

Took me forever to find a this configuration, but now everything is nicely switchable, the only thing that seems a bit of a pain is the flyPad. It kind of works but its seems you have to click 3 or 4 times and wiggle around a bit to make it work.

Thank you. By the way what do I do with the context you just wrote? Do I place it somewhere ?

Edit: I tried it and it didn't work. I heard it only works in the default asobo (clowns) a320

chrisaut commented 2 years ago

Hmm, it definitely works for me, I did 2 full flights in VR last night and it was for sure in the FBW (experimental).

Did you unassign the default actions from the buttons? I think maybe the FS window on the desktop needs to have focus, but I'm not sure. Maybe I can try to get a video later.

hzyoni commented 2 years ago

I am at the develop version. I use it for my X and Y G2 controller . I did make sure that all other actions are cleared. Not sure if I FS window was focus or not. A video would be awesome! Thank you

dataslug1 commented 2 years ago

Took me forever to find a this configuration, but now everything is nicely switchable, the only thing that seems a bit of a pain is the flyPad. It kind of works but its seems you have to click 3 or 4 times and wiggle around a bit to make it work.

Hi, This didn't seem to work for me either - here's a screenshot of my controller config, could you please let me know if I am doing anything wrong? This is with Oculus Quest 2, latest experimental FBW like you. Many thanks!

image

chrisaut commented 2 years ago

Sorry the slow response. I recorded a quick video (note I didn't set up the flight just spawned in air so no nav/managed climb but it shows I can reliably push/pull the speed knob.

I'm not sure why it's not working for you.

Some additional info: I make sure the sim is running fullscreen, has focus. I'm running the Reverb G2 with the openXR beta runtime and the openXR toolkit, although I doubt these matter for how controllers behave.

In the G1000 planes I find that knob push interaction doesn't work unless you give the mouse a little push so the mouse cursor shows up, then press squeeze on the controllers (mouse cursor disappears) but then for some time pushing eg. the little FMS rotary/push thingy works. But for me the FBW doesn't seem to need this (although I've been flying more GA lately).

If you want me to show/try a specific scenario let me know, but I'm not sure how much it helps to show it's working for me.

https://user-images.githubusercontent.com/8252355/160242466-0d63202a-7473-4837-96e5-73f4c9e14bbf.mp4

dataslug1 commented 2 years ago

Sorry the slow response. I recorded a quick video (note I didn't set up the flight just spawned in air so no nav/managed climb but it shows I can reliably push/pull the speed knob.

I'm not sure why it's not working for you.

Thanks for replying. For some reason your video is not playing for me. I wondered, next time you are in the sim could you please confirm that your bindings look the same/similar to what I showed in my screenshot above, or are you binding something else?

Many thanks!

chrisaut commented 2 years ago

Hmm, yes doesn't seem to play on mobile, does on desktop for me though. Sorry about that not sure what is going on.

I'll get a screenshot for you later today or tomorrow when I'm back home, but you can see my config export above or in the video if you try on desktop.

shameelx commented 2 years ago

hi, can i get a guide on how to get the push pull to work properly in VR? where can i enter that long code ?

hzyoni commented 2 years ago

Hmm, yes doesn't seem to play on mobile, does on desktop for me though. Sorry about that not sure what is going on.

I'll get a screenshot for you later today or tomorrow when I'm back home, but you can see my config export above or in the video if you try on desktop.

Doesn't play on Desktop or mobile for me. really eager to know how you did it.

chrisaut commented 2 years ago

I'm sorry I don't know why it's not playing for you :( Maybe you can download it and play it locally? It should be 1:35 long image

Here's a screenshot of my config. The important 2 are: tertiary action: squeeze secondary action: thumbstick for pull/push respectively image

hzyoni commented 2 years ago

yup.... I don't know why it doesn't work for me (us). I consider you lucky thou.

dataslug1 commented 2 years ago

Hello all, I am pleased to say that it is working for me. I didn't make any changes to my config since my screenshot above (so the same setup as in @chrisaut screenshot) so I am not sure why it did not work for me last time - when I have more time I will try to reproduce.

So please all do follow @chrisaut binding suggestions as it does indeed work. I look forward to trying a full flight with it when I have time.

Many thanks @chrisaut for your help on this !

shameelx commented 2 years ago

hi all, can someone please tell me where the config file is located so that i can update it?

dataslug1 commented 2 years ago

I was also not able to find the config file, but doing it in the sim as per screenshot worked for me

shameelx commented 2 years ago

so the settings in the screenshot are letting me turn the knobs using the thumbstick. but i still cant push and pull knobs like the altitude selector. is this working for others? what button is supposed to do that?

chrisaut commented 2 years ago

Obviously depends on how you configure it, but pushing the thumbstick on the right hand controllers should push the knob in (go to managed mode), and the squeeze button should pull.

The config files are in (for store version, I don't know about steam sorry)

%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\SystemAppData\wgs

inside weirdly named paths, for example mine is

0009000000FFC2F0_0000.....\9AA9C5E62B6241....

and the actual file is

4A9DF1ACB89......13A36D

with no extension, but they are just xml files

image

(I have replaced some alpha numericals with ... in all of the above as I'm not sure if these strings are user identifyable)

shameelx commented 2 years ago

so my secondary and tertiary are assigned just like yours but they do not push or pull the knobs. using fbw experimental and reverb g2 controllers.

chrisaut commented 2 years ago

Did you remove other actions from the buttons? Are you running fullscreen? Did you try nudging the mouse just before you try to interact (and just to double check you assigned them to the (right/left) side controller that you are trying to use)? Are you trying with the direct interaction mode or the raycast mode (and ensured the controller you are trying to use is the active one)?

Otherwise can you show a video of what you are doing, maybe it's just a small misunderstand somewhere?

It seems pretty fiddly, but it does work reliably for me once it was setup.

shameelx commented 2 years ago

yeah i confirmed all the things you said. il try to get a video. the rest of the interactions are working so im using the correct controller. i tried the mouse thing and i do run msfs in full screen. the buttons arent assigned to anything else cause i cleared all other bindings

dataslug1 commented 2 years ago

Bizarrely, whilst it works with my left controller, I can#t seem to get it to work with my right, with the same bindings. I will keep trying and it could be an error on my side, but wanted to mention it in case it is a real bug and helps someone else.

dataslug1 commented 2 years ago

I have found the issue and now working on both left and right controllers. There seems to be a bug in the MSFS controller settings page, on my Quest2+SteamVR at least:

For the right controller, for some reason I need to select the "system" button instead of the expected "squeeze", and indeed this is what appears if I search for input and press the squeeze button. On the left controller it is labelled "squeeze" as expected. I think this is why it would not work for me initially, and I was probably initially taesting @chrisaut's suggestion using the right controller as well.

Here are screenshots of the working bindings: Left image

Right image

hzyoni commented 2 years ago

What do you mean by the “system” button? Slightly confused

dataslug1 commented 2 years ago

The squeeze button on the right controller is incorrectly labelled "system" (see my screenshot for right controller above). When I previously had it set to "squeeze" it did not work, but it works when set to "system".

AndLindemann commented 2 years ago

It would anyways be cool to get proper implementation for knob rotation via controllers into the plane. OpenXR toolkit is working on implementing hand tracking and is looking quite good in that regard, but as with hand tracking you can't use touchpad axis to rotate knobs, you'd need proper knob reaction to controller rotation axis. It's working on the Asobo standard planes, but on the A32NX the knobs don't really rotate when rotating the controllers, it more looks like a completely random outcome when you're trying to do it.

Issue title should probably be renamed to something like "VR controller - several improvements needed" to get away from the autopilot specific focus, because I think that's not the only issue with controller support here.

fjch1997 commented 2 years ago

I briefly tried to understand the code here. It appears that this project is using the pre-SU8 ASOBO_GT_Knob_Infinite_PushPull templates for push/pull knobs in src/behavior/src/A32NX_Interior_FCU.xml. The SDK documentation Creating Interactions Using InputEvents calls for using ASOBO_Interaction_Base_Template with ASOBO_Interaction_Push_Event_Base_Template and ASOBO_Interaction_Pull_Event_Base_Template, which should work in VR just like the default a320. However, I have no knowledge in MSFS development. This is a huge project and I have no idea where to begin fixing it

chrisaut commented 2 years ago

Interesting, TBH I don't think I ever tried in the Asobo 320.

It sounds like this specific issue (turning knobs) then is due to the hard fork that occurred and those changes never got ported over after Asobo changes them in the default bus, if I understand your post correctly.

fjch1997 commented 2 years ago

Knobs with push/pull like altitude and heading works in VR in the Asobo A320. Interestingly, the Landing Lights 3-state switch doesn't work properly even in Asobo's A320 I am still quite confused about how this project is forking over the Asobo A320. Where is the original code for Asobo? How is it combined with this repo?

After some further digging, I found that there is a separate concept of KeyEvent and InputEvent. Seems that the latter is added after SU8 for Xbox and VR interactions, and is completely missing in this project.

chrisaut commented 2 years ago

I am still quite confused about how this project is forking over the Asobo A320. Where is the original code for Asobo? How is it combined with this repo?

I'm not a team member, but my understand is that originally it was just a mod that applied on top of the Asobo 320, then mod expanded to appear as a separate aircraft inside the sim, and sometime last year it was completely separated, my understanding is they took (with Asobo's blessing I guess) the existing aircraft at some point in time and have been working off of that (the hard fork). Anything Asobo might have done after that to the base A320 is not at all merged or combine automatically, it would have to be ported over manually. Including it appears these SU8 changes to input handling.

The code bases must have diverged so far by now that probably only surgical specific changes can be ported over. That template change sounds like it could be one such case.

dataslug1 commented 2 years ago

Knobs with push/pull like altitude and heading works in VR in the Asobo A320. Interestingly, the Landing Lights 3-state switch doesn't work properly even in Asobo's A320

Do you mean how you cannot "grab and pull" the 3+ way switches like you can with 2 way switches? This seems to be the same for all Asobo aircraft... It means different switches require different controller actions to use, which are not visually obvious. For example there are at least 3 different types in the TBM:

  1. 2 way switches activate as soon as you press trigger - For example TBM 2 way switches to the left of the Yoke such as de-ice
  2. 3+ way switches where they will move in a random direciton if you click them, and you must use the “increase cockpit interaction” binding to actually control them - For example TBM bleed air
  3. Switches and levers that do nothing on trigger, and require them to be grabbed/triggered and then dragged in the direction you wish to move them - example TBM Flaps, TBM throttle.

In my opinion Asobo should implement some consistency- In my opinion, all switches (2 way and 3+way) should be moveable with "grab and pull" (this is the method used in the excellent VTOL VR) and also with the increase cockpit interaction bindings (this works surprisingly nicely when bound to the thumbstick, especially with small switches). None should move by click alone.

AndLindemann commented 2 years ago

Still ALT/HDG/SPD autopilot knobs work differently for me in stock Asobo A320 and A32NX. Using Raycast controller mode, I can grab and "turn" the stock Asobo A320 autopilot knobs in both directions to increase/decrease values. The A32NX knobs for me don't work in this way. I can't turn them the same, but they do work if I use the increase/decrease cockpit interaction bindings. Still it would be nice to get these to react to the turn gesture in the same way as the stock Asobo A320 knobs do.

shameelx commented 1 year ago

Can you advise on how to edit the config file? Where is it located?

Sent from my iPhone

On Mar 28, 2022, at 1:25 PM, dataslug1 @.***> wrote:

 Hello all, I am pleased to say that it is working for me. I didn't make any changes to my config since my screenshot above (so the same setup as in @chrisaut screenshot) so I am not sure why it did not work for me last time - when I have more time I will try to reproduce.

So please all do follow @chrisaut binding suggestions as it does indeed work. I look forward to trying a full flight with it when I have time.

Many thanks @chrisaut for your help on this !

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

Tesch1933 commented 1 year ago

The Asobo A320 allows push and pull via the secondary and tertiary key assignment. This is not the case with the FBW. To solve the problem, the FBW team would have to make it possible to control the knobs with secondary and tertiary. Like it is with the Asobo A320. This can't be that difficult. It is only an assignment of the function

tracernz commented 1 year ago

The knobs can already be controlled with secondary/tertiary in lock mode. I am using them through mouse button bindings to push/pull the knobs.

Again though, nobody on the dev team is using VR controllers and no VR users have contributed any patches.