Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Oculus Quest OpenVR support #214

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
319844b
All the things needed to get the touch scrolling to work.
StephenHodgson May 14, 2019
ba271f8
Fixed a regression with registering for events
StephenHodgson May 16, 2019
3f0402b
removed always true expression
StephenHodgson May 17, 2019
fea43b7
Merge branch 'development' into dev-input-updates
StephenHodgson May 17, 2019
7d97436
Merge branch 'dev-always-true-expression' into dev-input-updates
StephenHodgson May 17, 2019
3cf5e27
updated sdk checkout for input updates
StephenHodgson May 18, 2019
2bbd40e
Merge branch 'development' into dev-input-updates
StephenHodgson May 18, 2019
e613fd2
Merge branch 'development' into dev-input-updates
StephenHodgson May 18, 2019
3b22704
ported deadzone fixes
StephenHodgson May 19, 2019
44d3a04
Merge branch 'dev-ports' into dev-input-updates
StephenHodgson May 19, 2019
088719d
Merge branch 'development' into dev-input-updates
StephenHodgson May 19, 2019
7ef3a9b
updated controller popout window to include inverted axes
StephenHodgson May 20, 2019
a0b0ff2
sdk changes for last commit
StephenHodgson May 20, 2019
67306fa
Get the proper SDK checkout
StephenHodgson May 20, 2019
cd83e51
preliminary scroll support
StephenHodgson May 20, 2019
fbaafc8
cleaned up focus provider a bit
StephenHodgson May 20, 2019
51cb29d
Merge branch 'development' into dev-input-updates
StephenHodgson May 21, 2019
648abb1
added is parent or child helper extension
StephenHodgson May 22, 2019
0fb3261
default bounds. not new
StephenHodgson May 24, 2019
9a4ca8d
added a few more checks just in case
StephenHodgson May 25, 2019
cc25a8f
Cancel the async stuff if the editor changes playmode states
StephenHodgson May 26, 2019
932c9d6
Fix build error
StephenHodgson May 26, 2019
f3d269d
added a few helper methods to the clipping primitive
StephenHodgson May 26, 2019
1429bae
added some parem docs
StephenHodgson May 27, 2019
8ce491a
Merge branch 'development' into dev-input-updates
StephenHodgson May 28, 2019
4cfa2a1
Merge branch 'development' into dev-input-updates
StephenHodgson May 30, 2019
7811254
Fixed common root lookup
StephenHodgson May 31, 2019
b3c1f6f
Merge branch 'development' into dev-input-updates
StephenHodgson Jun 6, 2019
0ff0ba3
disabled wysisyg
StephenHodgson Jun 6, 2019
76d0458
Merge branch 'development' into dev-input-updates
StephenHodgson Jun 6, 2019
7a99d57
Merge branch 'development' into dev-input-updates
StephenHodgson Jun 8, 2019
5b1656a
Fixed merge conflict
StephenHodgson Jun 8, 2019
61becdd
Initial Update for Oculus support
SimonDarksideJ Jun 19, 2019
fd2931a
Merge branch 'dev-input-updates' of https://github.com/XRTK/XRTK-Core…
SimonDarksideJ Jun 19, 2019
56573d7
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
SimonDarksideJ Jun 19, 2019
f0c5872
Added missing Menu button
SimonDarksideJ Jun 19, 2019
4c9b413
Merge branch 'development' into OculusSupport
StephenHodgson Jun 24, 2019
f45766e
Merge branch 'development' into OculusSupport
StephenHodgson Jun 24, 2019
15516ca
Merge branch 'development' into OculusSupport
StephenHodgson Jun 25, 2019
069938f
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
SimonDarksideJ Jun 29, 2019
e098a90
Extended Interaction mapping for 2rd party enum support using strings
SimonDarksideJ Jun 29, 2019
46a53d2
Merge branch 'development' into OculusSupport
StephenHodgson Jul 8, 2019
7d7ea16
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
SimonDarksideJ Jul 10, 2019
8dc8934
Fixed outstanding issues. Tested / working
SimonDarksideJ Jul 10, 2019
865a03c
Merge branch 'OculusSupport' of https://github.com/XRTK/XRTK-Core int…
SimonDarksideJ Jul 10, 2019
afc71d3
Revert Interaction mapping change back to dev
SimonDarksideJ Jul 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these copied from the mrtk?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these copied from the mrtk?

// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEngine;
using XRTK.Definitions.Devices;
using XRTK.Definitions.Utilities;

namespace XRTK.Providers.Controllers.OpenVR
{
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Mappings/Oculus Quest Controller Mapping Profile", fileName = "OculusQuestControllerMappingProfile")]
public class OculusQuestControllerMappingProfile : BaseMixedRealityControllerMappingProfile
{
/// <inheritdoc />
public override SupportedControllerType ControllerType => SupportedControllerType.OculusQuest;

/// <inheritdoc />
public override string TexturePath => $"{base.TexturePath}OculusControllersTouch";

protected override void Awake()
{
if (!HasSetupDefaults)
{
ControllerMappings = new[]
{
new MixedRealityControllerMapping("Oculus Quest Controller Left", typeof(OculusQuestController), Handedness.Left),
new MixedRealityControllerMapping("Oculus Quest Controller Right", typeof(OculusQuestController), Handedness.Right),
};
}

base.Awake();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEditor;
using XRTK.Inspectors.Profiles;

namespace XRTK.Providers.Controllers.OpenVR.Inspectors.Profiles
{
[CustomEditor(typeof(OculusQuestControllerMappingProfile))]
public class OculusQuestControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector { }
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEngine;
using XRTK.Definitions.Devices;
using XRTK.Definitions.InputSystem;
using XRTK.Definitions.Utilities;
using XRTK.Interfaces.InputSystem;

namespace XRTK.Providers.Controllers.OpenVR
{
public class OculusQuestController : GenericOpenVRController
{
/// <summary>
/// Constructor.
/// </summary>
/// <param name="trackingState"></param>
/// <param name="controllerHandedness"></param>
/// <param name="inputSource"></param>
/// <param name="interactions"></param>
public OculusQuestController(TrackingState trackingState, Handedness controllerHandedness,
IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null)
: base(trackingState, controllerHandedness, inputSource, interactions)
{
}

/// <inheritdoc />
public override MixedRealityInteractionMapping[] DefaultLeftHandedInteractions => new[]
{
new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None),
new MixedRealityInteractionMapping(1, "Spatial Grip", AxisType.SixDof, DeviceInputType.SpatialGrip, MixedRealityInputAction.None),
new MixedRealityInteractionMapping(2, "Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_9),
new MixedRealityInteractionMapping(3, "Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch, KeyCode.JoystickButton14),
new MixedRealityInteractionMapping(4, "Axis1D.PrimaryIndexTrigger Near Touch", AxisType.Digital, DeviceInputType.TriggerNearTouch, ControllerMappingLibrary.AXIS_13),
new MixedRealityInteractionMapping(5, "Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, DeviceInputType.TriggerPress, ControllerMappingLibrary.AXIS_9),
new MixedRealityInteractionMapping(6, "Axis1D.PrimaryHandTrigger", AxisType.Digital, DeviceInputType.Trigger, KeyCode.JoystickButton4),
new MixedRealityInteractionMapping(7, "Axis1D.PrimaryHandTrigger Press", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_11),
new MixedRealityInteractionMapping(8, "Axis2D.PrimaryThumbstick", AxisType.DualAxis, DeviceInputType.ThumbStick, ControllerMappingLibrary.AXIS_1, ControllerMappingLibrary.AXIS_2),
new MixedRealityInteractionMapping(9, "Button.PrimaryThumbstick Press", AxisType.Digital, DeviceInputType.ThumbStickPress, KeyCode.JoystickButton16),
new MixedRealityInteractionMapping(10, "Button.Three Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton12),
new MixedRealityInteractionMapping(11, "Button.Four Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton13),
new MixedRealityInteractionMapping(12, "Button.Start Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton7),
new MixedRealityInteractionMapping(13, "Thumb Touch", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_15),
new MixedRealityInteractionMapping(14, "Menu Button", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton6)
};

/// <inheritdoc />
public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => new[]
{
new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None),
new MixedRealityInteractionMapping(1, "Spatial Grip", AxisType.SixDof, DeviceInputType.SpatialGrip, MixedRealityInputAction.None),
new MixedRealityInteractionMapping(2, "Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_10),
new MixedRealityInteractionMapping(3, "Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch, KeyCode.JoystickButton15),
new MixedRealityInteractionMapping(4, "Axis1D.PrimaryIndexTrigger Near Touch", AxisType.Digital, DeviceInputType.TriggerNearTouch, ControllerMappingLibrary.AXIS_14),
new MixedRealityInteractionMapping(5, "Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, DeviceInputType.TriggerPress, ControllerMappingLibrary.AXIS_10),
new MixedRealityInteractionMapping(6, "Axis1D.PrimaryHandTrigger", AxisType.Digital, DeviceInputType.Trigger, KeyCode.JoystickButton5),
new MixedRealityInteractionMapping(7, "Axis1D.PrimaryHandTrigger Press", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_11),
new MixedRealityInteractionMapping(8, "Axis2D.PrimaryThumbstick", AxisType.DualAxis, DeviceInputType.ThumbStick, ControllerMappingLibrary.AXIS_4, ControllerMappingLibrary.AXIS_5),
new MixedRealityInteractionMapping(9, "Button.PrimaryThumbstick Press", AxisType.Digital, DeviceInputType.ThumbStickPress, KeyCode.JoystickButton17),
new MixedRealityInteractionMapping(10, "Button.Three Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton10),
new MixedRealityInteractionMapping(11, "Button.Four Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton11),
new MixedRealityInteractionMapping(12, "Button.Start Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton7),
new MixedRealityInteractionMapping(13, "Thumb Touch", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_17)
};

/// <inheritdoc />
public override void SetupDefaultInteractions(Handedness controllerHandedness)
{
AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ protected override GenericJoystickController GetOrAddController(string joystickN
case SupportedControllerType.OculusGo:
controllerType = typeof(OculusGoOpenVRController);
break;
case SupportedControllerType.OculusQuest:
controllerType = typeof(OculusQuestController);
break;
case SupportedControllerType.WindowsMixedReality:
controllerType = typeof(WindowsMixedRealityOpenVRMotionController);
break;
Expand Down Expand Up @@ -131,6 +134,11 @@ protected override SupportedControllerType GetCurrentControllerType(string joyst
return SupportedControllerType.OculusGo;
}

if (joystickName.Contains("Oculus Quest"))
{
return SupportedControllerType.OculusQuest;
}

if (joystickName.Contains("Oculus remote"))
{
return SupportedControllerType.OculusRemote;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ protected void UpdateSingleAxisData(MixedRealityInteractionMapping interactionMa
// If our value was updated, raise it.
if (interactionMapping.Updated)
{
Debug.LogError($"Interaction updated {interactionMapping.Description} - Value [{interactionMapping.FloatData}]");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these errors here?

Just to verify you're getting data?

// Raise input system Event if it enabled
MixedRealityToolkit.InputSystem?.RaiseOnInputPressed(InputSource, ControllerHandedness, interactionMapping.MixedRealityInputAction, interactionMapping.FloatData);
}
Expand All @@ -176,6 +177,7 @@ protected void UpdateSingleAxisData(MixedRealityInteractionMapping interactionMa
// If our value was updated, raise it.
if (interactionMapping.Updated)
{
Debug.LogError($"Interaction updated {interactionMapping.Description} - Value [{interactionMapping.FloatData}]");
MixedRealityToolkit.InputSystem?.RaiseOnInputPressed(InputSource, ControllerHandedness, interactionMapping.MixedRealityInputAction, singleAxisValue);
}
}
Expand Down