VR系列——Oculus Rift 开发者指南:七、SDK样品和手柄的使用及低级传感器详述

SDK样品和手柄的使用

Oculus SDK的一些样品通过使用手柄控制器来支持在虚拟世界的运动。本节介绍目前支持的设备和安装说明。

Xbox 360有线控制器支持Windows系统

建立控制器

  • 将该设备插入USB端口。window应该能识别控制器并自动地安装一些必要的驱动程序。

罗技F710无线游戏手柄

设置Windows游戏手柄:

  1. 通过将控制器前面的开关移动到“X”位置来把控制器调为“XInput”模式。
  2. 按下控制器上的一个按钮,使“模式”按钮旁边的绿色灯开始闪烁。
  3. 当LED灯开始闪烁时,将USB接收器插入电脑。
  4. Windows可以识别控制器并自动安装一些必要的驱动程序

低级传感器详述

在通常的使用中,应用程序通过API函数来处理传感器的融合,校正和预测。

注:这一节是作为参考;在DK2的外部定位跟踪器的介绍后,部分信息可能已经过时。

在通常的使用中,应用程序通过接口函数来处理传感器的融合,校正和预测。本节纯粹是为了兴趣。

开发者可以直接从ovrTrackingState::RawSensorData读取传感器原始数据。它包含下列数据:

ovrVector3f   Accelerometer;    // 加速度读取 单位: m / s^2
ovrVector3f   Gyro;             //转速 单位:rad/s
ovrVector3f   Magnetometer;   //磁场,单位:高斯
float         Temperature;      //传感器的温度 单位:摄氏度℃
float         TimeInSeconds;    // IMU读取上报的发生时间,以秒为单位

在很长一段时间内,在Q(当前的头部姿势估计)和Rift的实际方向之间会产生矛盾。这个问题被称为偏移误差,这个问题会在下节中进行更多的描述。通过使用加速度计的数据来估算重力矢量,自动减小了倾斜和滚动的误差。

磁力计数据降低了偏航误差。对于许多游戏,如标准的第一人称射击游戏(FPS),偏航方向经常通过游戏控制器进行修改而且这是没有问题的。不过,在许多其他游戏或应用中,偏航误差需要被纠正。例如,如果你想在玩家面前维持驾驶舱。随着时间的推移,它不应该在无意中漂移到一边。偏航误差校正是默认启用的。


原文如下


SDK Samples and Gamepad Usage

Some of the Oculus SDK samples use gamepad controllers to enable movement around the virtual world.

This section describes the devices that are currently supported and setup instructions.

Xbox 360 Wired Controller for Windows

To set up the controller:

  • Plug the device into a USB port. Windows should recognize the controller and install any necessary drivers automatically.

Logitech F710 Wireless Gamepad

To set up the gamepad for Windows:

  1. Put the controller into ‘XInput’ mode by moving the switch on the front of the controller to the ‘X’ position.
  2. Press a button on the controller so that the green LED next to the ‘Mode’ button begins to flash.
  3. Plug the USB receiver into the PC while the LED is flashing.
  4. Windows should recognize the controller and install any necessary drivers automatically.

Low-Level Sensor Details

In normal use, applications use the API functions which handle sensor fusion, correction, and prediction for them.

Note: This section is left for reference; parts of it may be out of date after the introduction of the external position tracker with DK2.

In normal use, applications will use the API functions which handle sensor fusion, correction, and prediction for them. This section is provided purely for interest.

Developers can read the raw sensor data directly from ovrTrackingState::RawSensorData. This contains the following data:

ovrVector3f   Accelerometer;    // Acceleration reading in m/s^2.
ovrVector3f   Gyro;             // Rotation rate in rad/s.
ovrVector3f   Magnetometer;   // Magnetic field in Gauss.
float         Temperature;      // Temperature of the sensor in degrees Celsius.
float         TimeInSeconds;    //  Time when the reported IMU reading took place, in seconds. 

Over long periods of time, a discrepancy will develop between Q (the current head pose estimate) and the true orientation of the Rift. This problem is called drift error, which described more in the following section. Errors in pitch and roll are automatically reduced by using accelerometer data to estimate the gravity vector.

Errors in yaw are reduced by magnetometer data. For many games, such as a standard first person shooter (FPS), the yaw direction is frequently modified by the game controller and there is no problem. However, in many other games or applications, the yaw error will need to be corrected. For example, if you want to maintain a cockpit directly in front of the player. It should not unintentionally drift to the side over time. Yaw error correction is enabled by default.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值