Jump to content

Recommended Posts

Posted

Hello,

I'm developing a native openxr application on HTC Vive Focus 3, that should support controller and hand interactions. I'm using the following HTC extensions:

to enable the interaction profiles for the controllers and the hands as mentioned in the documentation of OpenXR. As an example of the issue, when I try to call xrLocatSpace to get the location of the AimPose and the GripPose of the hands relative to the used space (StageSpace/LocalSpace) the function call doesn't return any result and gets stuck which cause the app to get into a weird state. In the following you can find a sample code similar to my implementation:

 

XrActionSet BaseActionSet = XR_NULL_HANDLE; 
/// HAND INTERACTION
XrPath LeftHandPath = XR_NULL_PATH;
XrPath RightHandPath = XR_NULL_PATH;

// Interaction Spaces
XrSpace LeftHandAimSpace = XR_NULL_HANDLE;
XrSpace RightHandAimSpace = XR_NULL_HANDLE;
XrSpace LeftHandGripSpace = XR_NULL_HANDLE;
XrSpace RightHandGripSpace = XR_NULL_HANDLE;

// Hand Interaction Actions
XrAction HandAimPoseAction = XR_NULL_HANDLE;
XrAction HandGripPoseAction = XR_NULL_HANDLE;
XrAction PinchAction = XR_NULL_HANDLE;
XrAction GraspAction = XR_NULL_HANDLE;


// Creating hand interaction actions
BaseActionSet = CreateActionSet(1, "base_action_set", "Action Set used on main loop"); 
OXR(xrStringToPath(Instance, "/user/hand_htc/left", &LeftHandPath));
OXR(xrStringToPath(Instance, "/user/hand_htc/right", &RightHandPath));
XrPath handSubactionPaths[2] = {LeftHandPath, RightHandPath};

// CreateAction function calls xrCreateAction and returns the action handle
HandAimPoseAction = CreateAction(BaseActionSet, XR_ACTION_TYPE_POSE_INPUT, "hand_aim_pose", NULL, 2, handSubactionPaths);
HandGripPoseAction = CreateAction(BaseActionSet, XR_ACTION_TYPE_POSE_INPUT, "hand_grip_pose", NULL, 2, handSubactionPaths);
PinchAction = CreateAction(BaseActionSet, XR_ACTION_TYPE_FLOAT_INPUT, "pinch_value", NULL, 2, handSubactionPaths);
GraspAction = CreateAction(BaseActionSet, XR_ACTION_TYPE_FLOAT_INPUT, "grasp_value", NULL, 2, handSubactionPaths);

//// Action Bindings ////
std::unordered_map<XrPath, std::vector<XrActionSuggestedBinding>> allSuggestedBindings{};
XrPath htcHandInteractionProfile = XR_NULL_PATH;
OXR(xrStringToPath(
instance, "/interaction_profiles/htc/hand_interaction", &htcHandInteractionProfile));
// -----------------------------------------
// Bindings /htc/hand_interaction
// -----------------------------------------
// Note: using the fact that operator[] creates an object if it doesn't exist in the map
allSuggestedBindings[htcHandInteractionProfile].emplace_back(
ActionSuggestedBinding(HandAimPoseAction, "/user/hand_htc/left/input/aim/pose"));
allSuggestedBindings[htcHandInteractionProfile].emplace_back(
ActionSuggestedBinding(HandAimPoseAction, "/user/hand_htc/right/input/aim/pose"));
allSuggestedBindings[htcHandInteractionProfile].emplace_back(
ActionSuggestedBinding(HandGripPoseAction, "/user/hand_htc/left/input/grip/pose"));
allSuggestedBindings[htcHandInteractionProfile].emplace_back(
ActionSuggestedBinding(HandGripPoseAction, "/user/hand_htc/right/input/grip/pose"));
allSuggestedBindings[htcHandInteractionProfile].emplace_back(
ActionSuggestedBinding(PinchAction, "/user/hand_htc/left/input/select/value"));
allSuggestedBindings[htcHandInteractionProfile].emplace_back(
ActionSuggestedBinding(PinchAction, "/user/hand_htc/right/input/select/value"));
allSuggestedBindings[htcHandInteractionProfile].emplace_back(
ActionSuggestedBinding(GraspAction, "/user/hand_htc/left/input/squeeze/value"));
allSuggestedBindings[htcHandInteractionProfile].emplace_back(
ActionSuggestedBinding(GraspAction, "/user/hand_htc/right/input/squeeze/value"));


for (auto& [interactionProfilePath, bindings] : allSuggestedBindings) {
  XrInteractionProfileSuggestedBinding suggestedBindings = {};
  suggestedBindings.type = XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING;
  suggestedBindings.next = NULL;
  suggestedBindings.interactionProfile = interactionProfilePath;
  suggestedBindings.suggestedBindings = (const XrActionSuggestedBinding*)bindings.data();
  suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size();

  XrResult xrResult = XR_SUCCESS;
  OXR(xrResult = xrSuggestInteractionProfileBindings(Instance, &suggestedBindings));
  ALOGV("xrResult = %d",xrResult);
}

/// Creating the action spaces
// CreateActionSpace function calls xrCreateActionSpace and returns the actionSpace handle
LeftHandAimSpace = CreateActionSpace(HandAimPoseAction, LeftHandPath);
RightHandAimSpace = CreateActionSpace(HandAimPoseAction, RightHandPath);
LeftHandGripSpace = CreateActionSpace(HandGripPoseAction, LeftHandPath);
RightHandGripSpace = CreateActionSpace(HandGripPoseAction, RightHandPath);

XrSpace handSpaces[] = {LeftHandAimSpace, LeftHandGripSpace, RightHandAimSpace, RightHandGripSpace};

/// Trying to locate the ACTION spaces handSpaces[] relative to the CurrentSpace
for (int i = 0; i < 4; i++) {
  	XrResult result = XR_SUCCESS;
    XrSpaceLocation location = {};
    location.type = XR_TYPE_SPACE_LOCATION;
  
// This line never returns any result, although I'm sure that all the passed parameters are supposedly valid.
    OXR(result = xrLocateSpace(handSpaces[i], CurrentSpace, time, &location));
  ALOGV("xrResult = %d",xrResult);
}

 

As mentioned in the code comments the line:
 

OXR(result = xrLocateSpace(handSpaces[i], CurrentSpace, time, &location));

 DOES NOT return any result and that caused the app to get into a weird state. is there any idea why that is happening ? or maybe if there is any known runtime issue ??!

**I'm using OpenXR loader v1.0.26**

could you please guide me how to fix this issue.

Thanks

Posted

Hi @VIVE_chengnay,

These are the information that I have in "About page" as the following:
1- Release version 6.3
2- System version 6.0.999.972
3- Launcher version 1.6.0.83a
4- Android security patch level 2023-02-05
5- Kernel Version 4.19.81-perf-dirty
6- Build number QKQ1.210528.001 release-keys
7- Wave SDK Version 6.0.0-u26

I'm not sure how to get the ROM Version that you asked about.

  • Thanks 1
  • 2 weeks later...
Posted

Hi @MohamedSoliman,

It is System version.

We couldn't reproduce the issue you mentioned.

Are you able to share APK to me(Can PM me) for further investigation?

Please also provide full log for us to check.

adb logcat > filename

Collect starting from device boot until your APK launch and hit the issue.

  • 5 weeks later...

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...