Sesor control tutorial

Sensor value acquisition method (other than Headset Detect)

This section describes how to control sensor with the Unity app.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioInput into the hierarchy window

  3. Create a script

  4. Add using

    Open the script created in 3 and describe as using MoverioBasicFunctionUnityPlugin;

    using MoverioBasicFunctionUnityPlugin;
  5. Call a function

    Describe the API you want to use like MoverioInput.GetAccAccuracy

    Refer to the following script for the description method of each function

    label script
    Accelerometer AccelerometerController.cs
    Magnetic field MagneticFieldController.cs
    Gyroscope GyroscopeController.cs
    Ambient light LightController.cs
    Gravity GravityController.cs
    Linear accelerometer LinearAccelerometerController.cs
    Rotation vector RotationVectorController.cs
    Game Rotation vector GameRotationVectorController.cs
    Uncalibrated Accelerometer AccelerometerUncalibratedController.cs
    Uncalibrated Magnetic field MagneticFieldUncalibratedController.cs
    Uncalibrated Gyroscope GyroscopeUncalibratedController.cs
  6. Attach script to GameObject

Please refer to API Reference for API specifications.

Headset Detect value acquisition method (other than Headset Detect)

This section describes how to control Headset Detect acquisition with the Unity app.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioInput into the hierarchy window

  3. Create a script

  4. Add using

    Open the script created in 3 and describe as using MoverioBasicFunctionUnityPlugin;

    using MoverioBasicFunctionUnityPlugin.Type;
  5. Create a function to be notified of Headset Detect

    public void OnHeadsetTapDetect(SensorDataAccuracy accuracy)
    {
    }
    
    public void OnHeadsetMotionDetect(SensorDataAccuracy accuracy)
    {
    }
    
    public void OnHeadsetStationayDetect(SensorDataAccuracy accuracy)
    {
    }
  6. Attach script to GameObject

  7. Click Moverio Input in the Hierarchy window

  8. Click the Moverio Input (Script) On Headset Tap Detect and On Headset Motion Detect and On Headset Stationay Detect “+” in the MoverioInput Inspector to add an event.

  9. Drag and drop the GameObject to which the script is attached in 6. in the hierarchy window to each event.

  10. Select the function to receive On Rcord Started and On Record Stopped event notifications.

Please refer to API Reference for API specifications.