How can we help?

Categories
< All Topics

Using Augumenta SDK with Vuforia in Unity3D

To integrate Augumenta AIP with Unity3D project that uses Vuforia plugin you need to be able to pass camera preview frames from Vuforia to Augumenta AIP. There is a prefab in Augumenta AIP Unity3D Vuforia package that makes this integration possible.

Requirements

  • Unity3D project, new or existing
  • Vuforia SDK 6.2 or newer for Unity3D
  • Vuforia Core Samples (From Assets Store)
  • Augumenta AIP for Unity3D

NOTE: Augumenta AIP works with older Vuforia SDK versions, except in Assets/Augumenta/Scripts/VuforiaCameraHandler.cs all mentions of VuforiaARController needs to be changed to VuforiaBehaviour.

See https://library.vuforia.com/articles/Solution/Migrating-Unity-Projects-to-Vuforia-6-2

Add Augumenta AIP to Vuforia project

First you need to create a Vuforia Unity3D project. Follow instructions from Vuforia on how to create a Unity3D project with Vuforia.

See https://library.vuforia.com/articles/Solution/Installing-the-Unity-Extension and https://library.vuforia.com/articles/Solution/Compiling-a-Simple-Unity-Project.

  1. Import Augumenta AIP Unity3D SDK package
  2. Copy Augumenta license file in to Assets/Resources/License.xml
  3. Import Augumenta AIP Unity3D Vuforia package
  4. Remove the MainCamera and replace it with AIPVuforiaARCamera (Located in Assets/Augumenta/Prefabs/AIPVuforiaARCamera.prefab.
  5. Start using Augumenta AIP

To test Augumenta AIP, add a 3D Object -> Cube to the scene and attach the Assets/Augumenta/Scripts/FollowPoseHandler.cs to that object. As a default the FollowPoseHandler will make the game object follow open hand pose (P001). Change scale of the object to 0.05, this ensures that the cube fits on the screen when it’s following pose. The FollowPoseHandler script will transform the game objects position relative to the main camera.

Included Scripts

VuforiaCameraHandler

This script handles the integration between Augumenta and Vuforia by requesting camera frames from Vuforia and passing them to Augumenta AIP for detection.

Settings available in inspector:

  • Webcam Fov Vertical/Horizontal, defines the field-of-view of the camera.
  • Flipped frame, sometimes the frames provided from the Vuforia are flipped.
  • Force Pixel Format, forces the Vuforia pixel format to use. If UNKNOWN_FORMAT is set then the first supported pixel format is used. On some platforms it might be necessary to force the pixel format.

Note on Examples project

If you use the AIP SDK example project as your starting project, you will need to do the steps described above (Remove the MainCamera and replace it with AIPVuforiaARCamera) for each of the Scenes in the project, not only for the MainScene.