Jump to content

VIU not working on user defined binding


vasanthkalai

Recommended Posts

@chengnay, Please find below controller bindings data,

{
  "app_key": "steam.flo.vr",
  "controller_type": "vive_controller",
  "description": "",
  "name": "FLOVR_VIVE",
  "bindings": {
    "/actions/flo": {
      "chords": [],
      "sources": [
        {
          "path": "/user/hand/left/input/grip",
          "mode": "button",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/flo/in/teleport"
            }
          }
        },
        {
          "path": "/user/hand/right/input/grip",
          "mode": "button",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/flo/in/teleport"
            }
          }
        },
        {
          "path": "/user/hand/left/input/trackpad",
          "mode": "trackpad",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/flo/in/playbackactivate"
            },
            "position": {
              "output": "/actions/flo/in/playback"
            }
          }
        },
        {
          "path": "/user/hand/right/input/trackpad",
          "mode": "trackpad",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/flo/in/playbackactivate"
            },
            "position": {
              "output": "/actions/flo/in/playback"
            }
          }
        },
        {
          "path": "/user/hand/left/input/trackpad",
          "mode": "trackpad",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/flo/in/flyactivate"
            },
            "position": {
              "output": "/actions/flo/in/flydirection"
            }
          }
        },
        {
          "path": "/user/hand/right/input/trackpad",
          "mode": "trackpad",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/flo/in/flyactivate"
            },
            "position": {
              "output": "/actions/flo/in/flydirection"
            }
          }
        }
      ],
      "poses": [
        {
          "output": "/actions/flo/in/pose",
          "path": "/user/hand/left/pose/raw"
        },
        {
          "output": "/actions/flo/in/pose",
          "path": "/user/hand/right/pose/raw"
        }
      ],
      "haptics": [],
      "skeleton": [
        {
          "output": "/actions/flo/in/skeletonleft",
          "path": "/user/hand/left/input/skeleton/left"
        },
        {
          "output": "/actions/flo/in/skeletonright",
          "path": "/user/hand/right/input/skeleton/right"
        }
      ]
    },
    "/actions/buggy": {
      "chords": [],
      "sources": [],
      "poses": [],
      "haptics": [],
      "skeleton": []
    },
    "/actions/default": {
      "chords": [],
      "sources": [],
      "poses": [],
      "haptics": [],
      "skeleton": []
    },
    "/actions/platformer": {
      "chords": [],
      "sources": [],
      "poses": [],
      "haptics": [],
      "skeleton": []
    },
    "/actions/htc_viu": {
      "chords": [],
      "sources": [
        {
          "path": "/user/hand/left/input/grip",
          "mode": "button",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_press_02"
            }
          }
        },
        {
          "path": "/user/hand/right/input/grip",
          "mode": "button",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_press_02"
            }
          }
        },
        {
          "path": "/user/hand/right/input/application_menu",
          "mode": "button",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_press_01"
            }
          }
        },
        {
          "path": "/user/hand/left/input/application_menu",
          "mode": "button",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_press_01"
            }
          }
        },
        {
          "path": "/user/hand/left/input/trigger",
          "mode": "trigger",
          "parameters": {},
          "inputs": {
            "pull": {
              "output": "/actions/htc_viu/in/viu_axis_1x"
            }
          }
        },
        {
          "path": "/user/hand/right/input/trigger",
          "mode": "trigger",
          "parameters": {},
          "inputs": {
            "pull": {
              "output": "/actions/htc_viu/in/viu_axis_1x"
            }
          }
        },
        {
          "path": "/user/hand/left/input/trackpad",
          "mode": "trackpad",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_press_32"
            },
            "position": {
              "output": "/actions/htc_viu/in/viu_axis_0xy"
            },
            "touch": {
              "output": "/actions/htc_viu/in/viu_touch_32"
            }
          }
        },
        {
          "path": "/user/hand/right/input/trackpad",
          "mode": "trackpad",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_press_32"
            },
            "position": {
              "output": "/actions/htc_viu/in/viu_axis_0xy"
            },
            "touch": {
              "output": "/actions/htc_viu/in/viu_touch_32"
            }
          }
        },
        {
          "path": "/user/hand/right/input/trigger",
          "mode": "button",
          "parameters": {
            "click_activate_threshold": "0.55",
            "click_deactivate_threshold": "0.45",
            "haptic_amplitude": "0.2"
          },
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_press_33"
            }
          }
        },
        {
          "path": "/user/hand/left/input/trigger",
          "mode": "button",
          "parameters": {
            "click_activate_threshold": "0.55",
            "click_deactivate_threshold": "0.45",
            "haptic_amplitude": "0.2"
          },
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_press_33"
            }
          }
        },
        {
          "path": "/user/hand/left/input/trigger",
          "mode": "button",
          "parameters": {
            "haptic_amplitude": "0"
          },
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_touch_33"
            }
          }
        },
        {
          "path": "/user/hand/right/input/trigger",
          "mode": "button",
          "parameters": {},
          "inputs": {
            "click": {
              "output": "/actions/htc_viu/in/viu_touch_33"
            }
          }
        }
      ],
      "poses": [],
      "haptics": [
        {
          "output": "/actions/htc_viu/out/viu_vib_01",
          "path": "/user/hand/left/output/haptic"
        },
        {
          "output": "/actions/htc_viu/out/viu_vib_01",
          "path": "/user/hand/right/output/haptic"
        }
      ],
      "skeleton": []
    }
  }
}

Link to comment
Share on other sites

@vasanthkalai Currently, I found out that you can do the below method to allow VIU + Custom bindings to work together.

1. Create your own script

2. Add SteamVR_ActivateActionSetOnLoad.cs and your script

3. In your own script,

public SteamVR_Input_Sources LeftInputSource = SteamVR_Input_Sources.LeftHand;
public SteamVR_Input_Sources RightInputSource = SteamVR_Input_Sources.RightHand;

private void Update()

{

    Debug.Log("Left Teleport value:" + SteamVR_Actions.FLO.Teleport.GetState(LeftInputSource));

    Debug.Log("Right Teleport value:" + SteamVR_Actions.FLO.Teleport.GetState(RightInputSource));

}

image.png.1f690c8cab9ed8015164cb8e36c057b5.png

 

Let me know if you still need more help. Cheers!

Link to comment
Share on other sites

@vasanthkalai It seems that GetStateDown's logic is wrong.

 

I printed the values from GetStateDown,

When I pull the trigger,

active is true, actionData.bState is true, but actionData.bChanged is false.

When I release the trigger,

active is true, actionData.bState is false, and actionData.bChanged is false.

 

From below note, I think state changes from false to true, bChanged should be true.

/// <summary>True when the action's state changes from false to true. Note: Will only return true if the action is also active.</summary>
/// <remarks>Will only return true if the action is also active.</remarks>

Probably you should report bug to SteamVR, and try using GetState instead for now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...