简体   繁体   English

如何使用 MRTK 向 HoloLens 1 添加基本的近距离交互?

[英]How can I add basic near interaction to HoloLens 1 using MRTK?

Possibly related to How can I simulate hand rays on HoloLens 1?可能与如何在 HoloLens 1 上模拟手部光线有关?

I want to use HoloLens 1 devices to simulate basic near interactions as provided by HoloLens 2.我想使用 HoloLens 1 设备来模拟 HoloLens 2 提供的基本近距离交互。

Specifically, how can I perform the following mappings:具体来说,如何执行以下映射:

  1. Use hand position during "Ready" gesture to control PokePointer?在“就绪”手势期间使用手 position 来控制 PokePointer?
  2. Use hand position during "Tap-and-hold" gesture to control GrabPointer?在“长按”手势期间使用手 position 来控制 GrabPointer?

Since HL1 does not track hand orientation, I expect these need to be estimated similar to the example with hand rays.由于 HL1 不跟踪手的方向,我希望这些估计需要类似于手部光线的示例。

I have tried creating a custom pointer per the answer above, and it works for hand rays but not for poke/grab as far as I can tell.我已经尝试根据上面的答案创建一个自定义指针,据我所知,它适用于手部光线,但不适用于戳/抓。

I've also created a custom poke pointer according to the example for WMR controllers at How to mimic HoloLens 2 hand tracking wIth Windows Mixed Reality controllers [MRTK2]?我还根据如何使用 Windows 混合现实控制器 [MRTK2] 模仿 HoloLens 2 手部跟踪中的 WMR 控制器示例创建了一个自定义戳指针? , and assigned it to the GGV controller in the same fashion, but somehow the hands don't seem to get detected for poke (or grab), only for hand rays. ,并以相同的方式将其分配给 GGV controller,但不知何故,手似乎没有被检测到戳(或抓),仅检测到手部光线。

(I'm using the Grab pose since HL1 does not seem to return index finger pose during Ready gesture, and since pointer pose seems to refer to the gaze pointer for HL1) (我正在使用 Grab 姿势,因为 HL1 在就绪手势期间似乎没有返回食指姿势,并且由于指针姿势似乎指的是 HL1 的凝视指针)

Ok,好的,

In case someone else is trying to get near interactions on HoloLens 1, this is how I got it working in the end:如果其他人试图在 HoloLens 1 上进行近距离交互,这就是我最终让它工作的方式:

  1. Create a custom input profile创建自定义输入配置文件
  2. Based on PokePointer, create a custom poke pointer component for the GGV (Gaze-Gesture-Voice) Controller of HL1 with the following modifications:基于PokePointer,为HL1的GGV(Gaze-Gesture-Voice)Controller创建一个自定义的poke指针组件,修改如下:
    • use the (grip) Position from the base controller component instead of gaze position.使用来自基础 controller 组件的(握把)Position 代替凝视 position。
    • calculate the Rotation from Position (interpolate using head position as in the hand ray example)从 Position 计算旋转(使用头部 position 进行插值,如手射线示例)
    • updateEnabled toggle set to not check for hand enabled since GGV always returns false during Ready updateEnabled 切换设置为不检查手动启用,因为 GGV 在就绪期间总是返回 false
    • make sure to inherit from PokePointer (needed for event handlers that only allow near interactions from PokePointer or derived classes)确保从 PokePointer 继承(仅允许来自 PokePointer 或派生类的近距离交互的事件处理程序需要)
  3. Create a custom pointer prefab that uses the custom pointer component.创建一个使用自定义指针组件的自定义指针预制件。
  4. Update the pointer section to use the custom pointer更新指针部分以使用自定义指针
  5. Modify buttons to only require proximity, and not require pushing from the front since the push direction is not working/unreliable on HoloLens 1将按钮修改为只需要接近,并且不需要从前面推动,因为推动方向在 HoloLens 1 上不起作用/不可靠

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM