Tango Plugin API documentation

The following document lists all components, functions, structs and enumerations available as part of the Tango Plugin API for UE4.


Tango Motion Component

The Tango Motion Component is a scene component which will move around the UE4 world according to the specified co-ordinate frame property. It also provides several functions which provide information about the device's current motion, such as GetTangoPoseAtTime.

You can either attach components to the Tango Motion Component to have them move around to match the specified CoordinateFramePair, or use the FVector output of GetTangoPoseAtTime as input data for your game logic.


IsLocalized

IsLocalized

IsLocalized

Description:

Returns true if the Tango is localized relative to the ADF file passed in as an argument in the Tango Config object when connecting to the Tango service.

Inputs:

Outputs:


Reset Motion Tracking

ResetMotionTracking

ResetMotionTracking

Description:

Resets the motion tracking of the tango device. This function is equivalent to the TangoService_ResetMotionTracking function.

Inputs:


Get Tango Pose Status

GetTangoPoseStatus

GetTangoPoseStatus

Description:

Returns the status of the pose information returned by the tango device.

Inputs:

Target [Tango Motion Component Reference]: The Unreal Engine / Tango Motion Component object.

Outputs:


Get Tango Pose At Time

GetTangoPoseAtTime

GetTangoPoseAtTime

Description:

Returns a Tango pose object for the given time relative to a specific frame of reference.

Inputs:

Outputs:


Setup Pose Events

SetupPoseEvents

SetupPoseEvents

Description:

This configures Tango Motion Components to trigger Pose events for each of the provided coordinate frame pairs in the input array. If this function is called twice, it will overwrite the previous set of coordinate frame pairs- so ensure that every frame pair you wish to receive an event for is included in this argument.

Inputs:


Event On Tango Pose Available

EventOnTangoPoseAvailable

EventOnTangoPoseAvailable

Description:

This event will fire every frame when a new Tango Pose has occurred, for those coordinate frame pairs which have been registered using the

Outputs:


Tango Image Component

The Tango Image Component contains the functions and events required to implement RGB Passthrough cameras in UE4 with the Tango.

Note that the Tango natively returns textures in the YUV format, and so conversion to RGB by way of a custom material is required. Several helper functions have been included to assist with this task.

For more information read:

https://developers.google.com/tango/apis/c/reference/struct/tango-image-buffer


Get Latest Image Timestamp

GetLatestImageTimestamp

GetLatestImageTimestamp

Description:

Returns a float which represents the time (in seconds since the Tango service was started) when the latest Image pose was retrieved.

Inputs:

Outputs:

Return Value [Float]: The time (in seconds since the Tango service was started) when the latest Image pose was retrieved.


Event OnTangoImageAvailable

OnTangoImageAvailable

OnTangoImageAvailable

Description:

This event will fire every frame when a new Tango Pose has occurred.

Outputs:

Return Value [Float]: The time (in seconds since the Tango service was started) when the latest Image pose was retrieved.


Tango AR Camera

The ARCameraComponent, when placed in a scene draws the real world in front of a Tango-enabled device to the screen. The component moves around the Unreal Engine world as the device is moved around the real world. The end result is that any objects within the Unreal Engine world will appear superimposed on top of the real world at the scale specified in the configuration struct.

Note that you will need to remove any skyboxes or features which encompass the entire screen from your levels, or you will not be able to see the passthrough camera effect (as these features will block the line of sight between the camera and the passthrough image).

For users of the beta versions of the plugin, the ARCameraComponent replaces the now deprecated 'Prepare Camera for Augmented Reality' function.


Tango AR Screen

The ARScreenComponent displays the image from the Tango devices's front-facing camera on a 2D plane in the UE4 world. The plane is static and will stay fixed in the UE4 world as the device is moved.


Tango Point Cloud Component

The Point Cloud component provides access to the Tango Point Cloud functionality. This access includes blueprint-accessible information about the latest point cloud as well as access to objects which can access the raw point cloud data in C++. Additionally, this component provides blueprint helper functions which assist in many common AR/Depth tasks, such as finding the central point in an area on the screen, getting a matching point from a given set of screen coordinates, finding a plane from given depth points or getting all depth points in a given area.


Pass Point Cloud Reference Container

PassPointCloudReferenceContainer

PassPointCloudReferenceContainer

Description:

Passes a container object for the point cloud data around. Useful to provide other C++ scripts access to the point cloud without any additional copies. The reason this is useful is that all variable types except for UObjects which are expose to Blueprint by value- to avoid additional deep copies of the entire point cloud, this instead passes an object which contains a pointer which can be accessed in C++ code.

Inputs:

Outputs:


Get Current Point Count

GetCurrentPointCount

GetCurrentPointCount

Description:

Retrieves the number of points contained within the latest frame from the point cloud.

Inputs:

Outputs:


Get Single Point

GetSinglePoint

GetSinglePoint

Description:

Inputs:

Outputs:


Get Plane at Screen Coordinates

GetPlaneAtScreenCoordinates

GetPlaneAtScreenCoordinates

Description:

Retrieve the plane average of the points within range of the input screen point.

Inputs:

Outputs:


Get Max Point Count

GetMaxPointCount

GetMaxPointCount

Description:

Get the max number of points a single frame from the point cloud can contain.

Inputs:

Outputs:


Get All Depth Points in Area

GetAllDepthPointsInArea

GetAllDepthPointsInArea

Description:

Get all points from the latest frame of the point cloud within the specified range of the input screen point.

Inputs:

Outputs:


Find Closest Depth Point

FindClosestDepthPoint

FindClosestDepthPoint

Description:

Retrieves the closest point to a specified position on the screen from within the point cloud buffer.

Inputs:

Outputs:


Event On Tango XYZij Available

EventOnTangoXYZijAvailable

EventOnTangoXYZijAvailable

Description:

This event will fire on every tick when there a new Depth update has occurred. It provides information about the number of points available in the latest depth frame, but not access to the raw buffer or helper functionality- these can be accessed by functions on the Point Cloud component instead.

Outputs:


Tango Points Component

This is a helper component which renders the depth points to screen in real time, relative to the position of the Points Component in UE4 space. It's useful for a debugging or illustrative capacity and will allow you to directly observe the output of the depth camera in your scene with minimal effort.


Tango Area Learning Component

Project Tango allows devices to use visual cues to navigate and understand the world around them. Using area learning, a Project Tango device can remember the visual features of the area it is moving through and recognize when it sees those features again. These features can be saved in an Area Description File (ADF) to use again later. With an ADF loaded, Project Tango devices gain two new features: improved motion tracking and localization.

Localization allows for users to synchronize movement within the Unreal world as reported by the Tango Motion component, with their position within a pre-recorded real-world area. This could allow for features such as fixing an A.R. tree within the center of a real-world room, or allowing for several users to share the same mixed reality space.

The Area Learning Component provides access to blueprint nodes that expose this functionality.

For more information on Area Learning, see:

https://developers.google.com/tango/overview/area-learning

https://developers.google.com/tango/apis/c/reference/group/area-description


Save Meta Data

SaveMetaData

SaveMetaData

Description:

This function is allows users to set the metadata contained within a specified ADF. This metadata includes the position where the ADF was created (in Earth Centered, Earth Fixed co-ordinates), and the Filename of the ADF. Please note that it is not possible to set the timestamp of the ADF- this is created automatically when the ADF is first recorded, and attempts to re-set this information will fail.

Inputs:

Outputs:


Get Meta Data

GetMetaData

GetMetaData

Description:

This function is used to expose the metadata contained within a specified ADF. This metadata includes the position and time that the ADF was created, and the Filename of the ADF.

Inputs:

Outputs:


Import ADF

ImportADF

ImportADF

Description:

Imports the given Area Description File stored at the location denoted by the "Filepath" variable to the Tango core. Note that this ADF becomes available to use with the current device but will still need to be loaded from the Tango core by restarting the Tango Service with the ADF within the Tango Core provided as an argument when starting up.

Inputs:

Outputs:


Export ADF

ExportADF

ExportADF

Description:

This function takes an existing, saved ADF within the device's Tango Core ADF repository, and saves the ADF to the file system in the location denoted by the 'Filepath' parameter, e.g. "/sdcard/".

Inputs:

Outputs:


Save Current Area

SaveCurrentArea

SaveCurrentArea

Description:

Save the current area description file to the device. For this to work, you must have at least one Area Learning and Motion component in the scene, and have switched 'Area Learning' mode on in your configuration file.

Inputs:

Outputs:


Is Learning Mode Enabled

IsLearningModeEnabled

IsLearningModeEnabled

Description:

Returns true if Learning Mode is currently enabled.

Inputs:

Outputs:


Delete Area Description

DeleteAreaDescription

DeleteAreaDescription

Description:

Delete the area description matching the UUID.

Inputs:

Outputs:


Get All Area Description Data

GetAllAreaDescriptionData

GetAllAreaDescriptionData

Description:

Get the current list of all the ADF UUIDs available in this device's Tango Core. Note that if there are any ADFs which are on the device's storage but not currently in the device's Tango Core repository, then developers should first call the "Import Current Area" function, supplying the filepath of the ADF they wish to import.

Inputs:

Outputs:

Return Value [Array of FTangoAreaDescription Structures]: An array of all tango area description structures available.


Tango Event Component

The Tango Event Component allows for developers to register event handlers for the different events which can be fired by the Tango service. These events either provide information about the status of the Tango service or indicate that errors have occurred.


On Tango Connect event

EventOnTangoConnect

EventOnTangoConnect

Description:

This event fires when a connection has been successfully made to the Tango service.


On Tango Disconnect event

EventOnTangoDisconnect

EventOnTangoDisconnect

Description:

This event fires upon the Tango service being disconnected.


On Tango Service Exception event

EventOnTangoServiceException

EventOnTangoServiceException

Description:

This event fires when the Tango service encounters an exception. Check the TangoEvent data structure for more information about the service exception.

Outputs:


On Fisheye Over Exposed event

EventOnFisheyeOverExposed

EventOnFisheyeOverExposed

Description:

This event fires when the Fisheye camera is over-exposed, which will interfere with the Tango Motion Tracking capabilties. Address this event by moving the Tango device to a less brightly lit area.

Outputs:


On Fisheye Under Exposed event

EventOnFisheyeUnderExposed

EventOnFisheyeUnderExposed

Description:

This event fires when the Fisheye camera is under-exposed, which will interfere with the Tango Motion Tracking capabilties. Address this event by moving the Tango device to a more brightly lit area.

Outputs:


On Color Over Exposed event

EventOnColorOverExposed

EventOnColorOverExposed

Description:

This event fires when the Tango Color Camera is over exposed. Address this event by moving the Tango device to a less brightly lit area.

Outputs:


On Color Under Exposed event

EventOnColorUnderExposed

EventOnColorUnderExposed

Description:

This event fires when the Tango color camera is under exposed. This will fire in dimly lit environments- move the Tango to a more brightly lit area to address this exception.

Outputs:


On Too Few Features Tracked event

EventOnTooFewFeaturesTracked

EventOnTooFewFeaturesTracked

Description:

This event fires when the Tango service cannot find enough features using the fisheye camera to properly run the motion tracking service. Feature-sparse environments, such as blank white walls, will trigger this more often than brigthtly lit, complex environments such as walls with posters placed upon them.

Outputs:


On Area Description Save Progress event

EventOnAreaDescriptionSaveProgress

EventOnAreaDescriptionSaveProgress

Description:

This event fires while an ADF save is taking place, and the TangoEvent message will display the percentage completion of the save.

Outputs:


On Unknown event

EventOnUnknownEvent

EventOnUnknownEvent

Description:

This event fires when the Tango service encounters an error with an unknown error code or type.

Outputs:


On File Import event

EventOnFileImportEvent

EventOnFileImportEvent

Description:

This event fires when an ADF file import has been attempted, and provides an enumeration which describes whether the export attempt has succeeded or failed.

Outputs:


On File Export Event

EventOnFileExportEvent

EventOnFileExportEvent

Description:

This event fires when an ADF file export has been attempted, and provides an enumeration which describes whether the export attempt has succeeded or failed.

Outputs:


Tango Blueprint Function Library

The following nodes can be accessed within any blueprint when the Tango plugin has been enabled. They are used to retrieve information which does not relate to any particular component, or activate functions which deal with the lifecycle of the Tango service, such as connection and disconnection.


Set Tango Runtime Config

SetTangoRuntimeConfig

SetTangoRuntimeConfig

Description:

Sets the runtime-settable parameters of the Tango to the values of the FTangoRuntimeConfig struct passed into the Configuration argument.

Inputs:

Outputs:


Reconnect Tango Service

ReconnectTangoService

ReconnectTangoService

Description:

Disconnects the currently connected Tango service and reconnects the Tango service with the given configuration parameters.

Inputs:


Is Tango Service Running

IsTangoServiceRunning

IsTangoServiceRunning

Description:

Returns true if the Tango Service is currently connected and running, otherwise returns false.

Outputs:


Get Tango Config

GetTangoConfig

GetTangoConfig

Description:

Returns structures representing the current Tango Config and Tango Runtime Config.

Outputs:


Get Loaded Area Description

GetLoadedAreaDescription

GetLoadedAreaDescription

Description:

Returns the currently loaded Area Definition file.

Outputs:


Get Last Area Description

GetLastAreaDescription

GetLastAreaDescription

Description:

Returns the last used Area Definition file.

Outputs:


Get Camera Intrinsics

GetCameraIntrinsics

GetCameraIntrinsics

Description:

Returns a structure containing information about the nature of the selected camera. This is useful for many Augmented Reality and camera alignment calculations.

Inputs:

Outputs:


Get All Area Description Data

GetAllAreaDescriptionData

GetAllAreaDescriptionData

Description:

Returns an array containing all of the Area Description files which are stored within this devices's Tango Core Repository. Please note that this does not include ADFs stored in other areas on the file system of the device.

Outputs:


Disconnect Tango Service

DisconnectTangoService

DisconnectTangoService

Description:

Disconnects the Tango service.

Note that it's not required to call this function on EndPlay- the Tango plugin will automatically perform a disconnection when the app is paused or closed, and will automatically resume if the app is brought back into the foreground.


Connect Tango Service

ConnectTangoService

ConnectTangoService

Description:

Connects the Tango service with the given configuration parameters. All Tango components require the Tango service to be connected in order to function correctly, and developers must manually connect using this function.

Inputs:


Tango Enumerations

The following enumerations are used in the Tango plugin. In many cases they mirror the enumerations found in the Tango C or Java APIs. For more information about these, see here.


Tango Pose Status

Description:

This enumeration represents the state of the current pose- a pose will contain data which is usable only when in the 'Valid' state.

Valid values:


Tango Camera Type

Description:

This enumeration represents each different type of camera which can be found on a Tango device.

Valid values:


Tango Event Key

Description:

This enumeration represents each type of event which can be fired from the Tango Event component.

Valid values:


Tango Event Type

Description:

This is a list of all the different classes of events which can be fired from the Tango Event component.

Valid values:


Tango Request Result

Description:

This enumeration signals whether a request to the Tango service (e.g. an ADF Import or Export request) has been accepted, denied or been cancelled by the user.

Valid values:


Tango Calibration Type

Description:

This Enum directly corresponds to the TangoCalibrationType enum of the Tango C API. Please see https://developers.google.com/tango/apis/c/reference/group/enums for more information.

Valid values:


Tango Coordinate Frame Type

Description:

This is a list of all the different supported Coordinate Frame types.

Valid values:


Tango Data Types

The following custom data structures are used in the Tango plugin.


FTangoConfig

Description:

This data structure is used to set the configuration of the Tango service. The data structure is set up and then passed as an argument to functions such as Start Tango Service and Restart Tango Service.

Fields:


FTangoRuntimeConfig

Description:

This data structure is used to set the configuration of the Tango service. The data structure is set up and then passed as an argument to functions such as Start Tango Service and Restart Tango Service.

Fields:


Tango Camera Intrinsics

Description:

This data structure contains the mappings for the camera intrinsics, which area camera parameters used in mapping sensor data to Unreal Engine world co-ordinates. See https://developers.google.com/tango/overview/intrinsics-extrinsics for more details on how camera Intrinsics and Extrinsics can be used to power AR experiences.

Fields:


FTangoXYZijData

Description:

This data structure holds information about a Tango Point cloud, including the timestamp and how many points are contained within the current Point cloud.

Note that Blueprint users are restricted in how they may use data- we suggest either using the "Get Single Point" function to access individual array points, or if iteration over all Depth points is required, using C++.

Fields:


Tango Coordinate Frame Pair

Description:

Tango pose data is calculated as a transformation between two frames of reference (so, for example, you can be asking for the pose of the device within a learned area). This struct is used to specify the desired base and target frames of reference when requesting pose data. You can also use it when you have a TangoPoseData structure returned from the API and want to examine which frames of reference were used to get that pose. For more information, including which coordinate frame pairs are valid, read here.

Fields:


Tango Event

Description:

This struct contains metadata relating to various types of Tango events, and is passed through when those events fire. Each event can pass additional information through the Message string, and the format and type of information presented will depend on which event has fired.

Fields:


Tango Pose Data

Description:

The TangoPoseData struct contains pose information returned from motion tracking.

Fields


Tango Area Description

Description:

This is the Filename/UUID pair representing an ADF which is currently within the Tango Core of the user's device. It can be used as an input for the Connect node, in which case the system will attempt to localize against it.

Fields