C# Class Tango.TangoApplication

Main entry point for the Tango Service. This component handles nearly all communication with the underlying TangoService. You must have one of these in your scene for Tango to work. Customization of the Tango connection can be done in the Unity editor or by programatically setting the member flags. This sends out events to Components that derive from the ITangoPose, ITangoDepth, etc. interfaces and register themselves via Register. This also sends out events to callbacks passed in through RegisterOnTangoConnect, RegisterOnTangoDisconnect, and RegisterPermissionsCallback. Note: To connect to the Tango Service, you should call InitApplication after properly registering everything.
Inheritance: UnityEngine.MonoBehaviour
Afficher le fichier Open project: stetro/project-tango-poc Class Usage Examples

Méthodes publiques

Свойство Type Description
m_3drGenerateColor bool
m_3drGenerateNormal bool
m_3drGenerateTexCoord bool
m_3drResolutionMeters float
m_3drSpaceClearing bool
m_3drUseAreaDescriptionPose bool
m_allowOutOfDateTangoAPI bool
m_autoConnectToService bool
m_enable3DReconstruction bool
m_enableADFLoading bool
m_enableAreaLearning bool
m_enableDepth bool
m_enableMotionTracking bool
m_enableVideoOverlay bool
m_motionTrackingAutoReset bool
m_videoOverlayUseByteBufferMethod bool

Private Properties

Свойство Type Description
Awake void
OnDestroy void
SendCloudEvent void
Update void
_CheckTangoVersion void
_FlipBitAndCheckPermissions void
_InitializeMotionTracking void
_PermissionWasDenied void
_RegisterOnAreaDescriptionEvent void
_RegisterOnExperimentalTangoVideoOverlay void
_RegisterOnTangoCloudEvent void
_RegisterOnTangoConnect void
_RegisterOnTangoDepthEvent void
_RegisterOnTangoDisconnect void
_RegisterOnTangoEvent void
_RegisterOnTangoEventMultithreaded void
_RegisterOnTangoPoseEvent void
_RegisterOnTangoVideoOverlay void
_RegisterPermissionsCallback void
_RequestNextPermission void
_ResetPermissionsFlags void
_ResumeTangoServices void
_SendPermissionEvent void
_SetDepthCallbacks void
_SetEventCallbacks void
_SetMotionTrackingCallbacks void
_SetVideoOverlayCallbacks void
_SuspendTangoServices void
_TangoConnect void
_TangoDisconnect void
_UnregisterOnAreaDescriptionEvent void
_UnregisterOnExperimentalTangoVideoOverlay void
_UnregisterOnTangoCloudEvent void
_UnregisterOnTangoConnect void
_UnregisterOnTangoDepthEvent void
_UnregisterOnTangoDisconnect void
_UnregisterOnTangoEvent void
_UnregisterOnTangoEventMultithreaded void
_UnregisterOnTangoPoseEvent void
_UnregisterOnTangoVideoOverlay void
_UnregisterPermissionsCallback void
_androidOnActivityResult void
_androidOnPause void
_androidOnResume void
_androidOnScreenOrientationChanged void

Méthodes publiques

Méthode Description
GetTangoServiceVersion ( ) : string

Get the Tango service version name.

GetVideoOverlayTextureYUV ( ) : YUVTexture

Get the video overlay texture.

HasRequestedPermissions ( ) : bool

Check if all requested permissions have been granted.

Register ( object tangoObject ) : void

Register to get Tango callbacks. The object should derive from one of ITangoDepth, ITangoEvent, ITangoPos, ITangoVideoOverlay, or ITangoExperimentalTangoVideoOverlay. You will get callback during Update until you unregister.

RequestPermissions ( ) : void

Manual initialization step 1: Call this to request Tango permissions. To know the result of the permissions request, implement the interface ITangoLifecycle and register yourself before calling this. Once all permissions have been granted, you can call TangoApplication.Startup, optionally passing in the AreaDescription to load. You can get the list of AreaDescriptions once the appropriate permission is granted.

Set3DReconstructionEnabled ( bool enabled ) : void

Enable or disable the 3D reconstruction.

SetDepthCameraRate ( TangoEnums rate ) : void

Set the framerate of the depth camera. Disabling or reducing the framerate of the depth camera when it is running can save a significant amount of battery.

SetDepthCameraRate ( int rate ) : void

Set the framerate of the depth camera. Disabling or reducing the framerate of the depth camera when it is running can save a significant amount of battery.

Shutdown ( ) : void

Disconnect from the Tango service. This is called automatically when the TangoApplication goes away. You only need to call this to disconnect from the Tango service before the TangoApplication goes away.

Startup ( AreaDescription areaDescription ) : void

Manual initalization step 2: Call this to connect to the Tango service. After connecting to the Tango service, you will get updates for Motion Tracking, Depth Sensing, and Area Learning. If you have a specific Area Description you want to localize too, pass that Area Description in here.

Tango3DRClear ( ) : void

Clear the 3D reconstruction data. The reconstruction will start fresh.

Tango3DRExtractMeshSegment ( Tango3DReconstruction gridIndex, Vector3 vertices, Vector3 normals, Color32 colors, int triangles, int &numVertices, int &numTriangles ) : Tango3DReconstruction.Status

Extract a single grid cell's mesh.

Tango3DRExtractWholeMesh ( Vector3 vertices, Vector3 normals, Color32 colors, int triangles, int &numVertices, int &numTriangles ) : Tango3DReconstruction.Status

Extract a single mesh for the entire 3D reconstruction state.

Unregister ( System tangoObject ) : void

Unregister from Tango callbacks. See TangoApplication.Register for more details.

Private Methods

Méthode Description
Awake ( ) : void

Awake this instance.

OnDestroy ( ) : void

Unity callback when this object is destroyed.

SendCloudEvent ( string message ) : void

Propagates an event from the java plugin connected to the Cloud Service through UnitySendMessage().

Update ( ) : void

Disperse any events related to Tango functionality.

_CheckTangoVersion ( ) : void

Validate the TangoService version is supported.

_FlipBitAndCheckPermissions ( PermissionsTypes permission ) : void

Flip a permission bit and check to see if all permissions were accepted.

_InitializeMotionTracking ( string uuid ) : void

Initialize motion tracking.

_PermissionWasDenied ( ) : void

A Tango permission was denied.

_RegisterOnAreaDescriptionEvent ( OnAreaDescriptionImportEventHandler import, OnAreaDescriptionExportEventHandler export ) : void

Register to get Tango event callbacks. See TangoApplication.Register for details.

_RegisterOnExperimentalTangoVideoOverlay ( OnExperimentalTangoImageAvailableEventHandler handler ) : void

Experimental API only, subject to change. Register to get Tango video overlay callbacks.

_RegisterOnTangoCloudEvent ( OnTangoCloudEventAvailableEventHandler handler ) : void

Register to get Tango cloud event callbacks. See TangoApplication.Register for details.

_RegisterOnTangoConnect ( OnTangoConnectEventHandler handler ) : void

Register to get an event callback when connected to the Tango service. The passed event will get called once connected to the Tango service. Registering after already connected will cause the event to not fire until disconnected and then connecting again.

_RegisterOnTangoDepthEvent ( OnTangoDepthAvailableEventHandler handler ) : void

Register to get Tango depth callbacks. See TangoApplication.Register for more details.

_RegisterOnTangoDisconnect ( OnTangoDisconnectEventHandler handler ) : void

Register to get an event callback when disconnected from the Tango service. The passed event will get called when disconnected from the Tango service.

_RegisterOnTangoEvent ( OnTangoEventAvailableEventHandler handler ) : void

Register to get Tango event callbacks. See TangoApplication.Register for details.

_RegisterOnTangoEventMultithreaded ( OnTangoEventAvailableEventHandler handler ) : void

Register to get Tango event callbacks. See TangoApplication.Register for details.

_RegisterOnTangoPoseEvent ( OnTangoPoseAvailableEventHandler handler ) : void

Register to get Tango pose callbacks. See TangoApplication.Register for more details.

_RegisterOnTangoVideoOverlay ( OnTangoImageAvailableEventHandler handler ) : void

Register to get Tango video overlay callbacks. See TangoApplication.Register for details.

_RegisterPermissionsCallback ( PermissionsEvent permissionsEventHandler ) : void

Register to get an event callback when all permissions are granted. The passed event will get called once all Tango permissions have been granted. Registering after all permissions have already been granted will cause the event to never fire.

_RequestNextPermission ( ) : void

Request next permission.

_ResetPermissionsFlags ( ) : void

Reset permissions flags.

_ResumeTangoServices ( ) : void

Helper method that will resume the tango services on App Resume. Locks the config again and connects the service.

_SendPermissionEvent ( bool permissions ) : void

Sends the permission event.

_SetDepthCallbacks ( ) : void

Set callbacks for all DepthListener objects.

_SetEventCallbacks ( ) : void

Set callbacks for all TangoEventListener objects.

_SetMotionTrackingCallbacks ( TangoCoordinateFramePair framePairs ) : void

Set callbacks on all PoseListener objects.

_SetVideoOverlayCallbacks ( ) : void

Set callbacks for all VideoOverlayListener objects.

_SuspendTangoServices ( ) : void

Helper method that will suspend the tango services on App Suspend. Unlocks the tango config and disconnects the service.

_TangoConnect ( ) : void

Connect to the Tango Service.

_TangoDisconnect ( ) : void

Disconnect from the Tango Service.

_UnregisterOnAreaDescriptionEvent ( OnAreaDescriptionImportEventHandler import, OnAreaDescriptionExportEventHandler export ) : void

Unregister from the Tango event callbacks. See TangoApplication.Register for more details.

_UnregisterOnExperimentalTangoVideoOverlay ( OnExperimentalTangoImageAvailableEventHandler handler ) : void

Experimental API only, subject to change. Unregister from the Tango video overlay callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoCloudEvent ( OnTangoCloudEventAvailableEventHandler handler ) : void

Unregister from the Tango cloud event callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoConnect ( OnTangoConnectEventHandler handler ) : void

Unregister from the callback when connected to the Tango service. See TangoApplication.RegisterOnTangoConnect for more details.

_UnregisterOnTangoDepthEvent ( OnTangoDepthAvailableEventHandler handler ) : void

Unregister from the Tango depth callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoDisconnect ( OnTangoDisconnectEventHandler handler ) : void

Unregister from the callback when disconnected from the Tango service. See TangoApplication.RegisterOnTangoDisconnect for more details.

_UnregisterOnTangoEvent ( OnTangoEventAvailableEventHandler handler ) : void

Unregister from the Tango event callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoEventMultithreaded ( OnTangoEventAvailableEventHandler handler ) : void

Unregister from the Tango event callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoPoseEvent ( OnTangoPoseAvailableEventHandler handler ) : void

Unregister from the Tango pose callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoVideoOverlay ( OnTangoImageAvailableEventHandler handler ) : void

Unregister from the Tango video overlay callbacks. See TangoApplication.Register for more details.

_UnregisterPermissionsCallback ( PermissionsEvent permissionsEventHandler ) : void

Unregister from the permission callbacks. See TangoApplication.RegisterPermissionsCallback for more details.

_androidOnActivityResult ( int requestCode, int resultCode, AndroidJavaObject data ) : void

EventHandler for Android's on activity result.

_androidOnPause ( ) : void

Android on pause.

_androidOnResume ( ) : void

Android on resume.

_androidOnScreenOrientationChanged ( AndroidScreenRotation newOrientation ) : void

Delegate for the Android screen orientation changed.

Method Details

GetTangoServiceVersion() public static méthode

Get the Tango service version name.
public static GetTangoServiceVersion ( ) : string
Résultat string

GetVideoOverlayTextureYUV() public méthode

Get the video overlay texture.
public GetVideoOverlayTextureYUV ( ) : YUVTexture
Résultat YUVTexture

HasRequestedPermissions() public méthode

Check if all requested permissions have been granted.
public HasRequestedPermissions ( ) : bool
Résultat bool

Register() public méthode

Register to get Tango callbacks. The object should derive from one of ITangoDepth, ITangoEvent, ITangoPos, ITangoVideoOverlay, or ITangoExperimentalTangoVideoOverlay. You will get callback during Update until you unregister.
public Register ( object tangoObject ) : void
tangoObject object Object to get Tango callbacks from.
Résultat void

RequestPermissions() public méthode

Manual initialization step 1: Call this to request Tango permissions. To know the result of the permissions request, implement the interface ITangoLifecycle and register yourself before calling this. Once all permissions have been granted, you can call TangoApplication.Startup, optionally passing in the AreaDescription to load. You can get the list of AreaDescriptions once the appropriate permission is granted.
public RequestPermissions ( ) : void
Résultat void

Set3DReconstructionEnabled() public méthode

Enable or disable the 3D reconstruction.
public Set3DReconstructionEnabled ( bool enabled ) : void
enabled bool If set to true enabled.
Résultat void

SetDepthCameraRate() public méthode

Set the framerate of the depth camera. Disabling or reducing the framerate of the depth camera when it is running can save a significant amount of battery.
public SetDepthCameraRate ( TangoEnums rate ) : void
rate TangoEnums A special rate to set the depth camera to.
Résultat void

SetDepthCameraRate() public méthode

Set the framerate of the depth camera. Disabling or reducing the framerate of the depth camera when it is running can save a significant amount of battery.
public SetDepthCameraRate ( int rate ) : void
rate int The rate in frames per second, for the depth camera to run at.
Résultat void

Shutdown() public méthode

Disconnect from the Tango service. This is called automatically when the TangoApplication goes away. You only need to call this to disconnect from the Tango service before the TangoApplication goes away.
public Shutdown ( ) : void
Résultat void

Startup() public méthode

Manual initalization step 2: Call this to connect to the Tango service. After connecting to the Tango service, you will get updates for Motion Tracking, Depth Sensing, and Area Learning. If you have a specific Area Description you want to localize too, pass that Area Description in here.
public Startup ( AreaDescription areaDescription ) : void
areaDescription AreaDescription If not null, the Area Description to localize to.
Résultat void

Tango3DRClear() public méthode

Clear the 3D reconstruction data. The reconstruction will start fresh.
public Tango3DRClear ( ) : void
Résultat void

Tango3DRExtractMeshSegment() public méthode

Extract a single grid cell's mesh.
public Tango3DRExtractMeshSegment ( Tango3DReconstruction gridIndex, Vector3 vertices, Vector3 normals, Color32 colors, int triangles, int &numVertices, int &numTriangles ) : Tango3DReconstruction.Status
gridIndex Tango3DReconstruction Grid index to extract.
vertices Vector3 Filled out with extracted vertices.
normals Vector3 Filled out with extracted normals.
colors UnityEngine.Color32 Filled out with extracted colors.
triangles int Filled out with extracted triangle indices.
numVertices int Filled out with the number of valid vertices.
numTriangles int Filled out with the number of valid triangles.
Résultat Tango3DReconstruction.Status

Tango3DRExtractWholeMesh() public méthode

Extract a single mesh for the entire 3D reconstruction state.
public Tango3DRExtractWholeMesh ( Vector3 vertices, Vector3 normals, Color32 colors, int triangles, int &numVertices, int &numTriangles ) : Tango3DReconstruction.Status
vertices Vector3 Filled out with extracted vertices.
normals Vector3 Filled out with extracted normals.
colors UnityEngine.Color32 Filled out with extracted colors.
triangles int Filled out with extracted triangle indices.
numVertices int Filled out with the number of valid vertices.
numTriangles int Filled out with the number of valid triangles.
Résultat Tango3DReconstruction.Status

Unregister() public méthode

Unregister from Tango callbacks. See TangoApplication.Register for more details.
public Unregister ( System tangoObject ) : void
tangoObject System Object to stop getting Tango callbacks from.
Résultat void

Property Details

m_3drGenerateColor public_oe property

public bool m_3drGenerateColor
Résultat bool

m_3drGenerateNormal public_oe property

public bool m_3drGenerateNormal
Résultat bool

m_3drGenerateTexCoord public_oe property

public bool m_3drGenerateTexCoord
Résultat bool

m_3drResolutionMeters public_oe property

public float m_3drResolutionMeters
Résultat float

m_3drSpaceClearing public_oe property

public bool m_3drSpaceClearing
Résultat bool

m_3drUseAreaDescriptionPose public_oe property

public bool m_3drUseAreaDescriptionPose
Résultat bool

m_allowOutOfDateTangoAPI public_oe property

public bool m_allowOutOfDateTangoAPI
Résultat bool

m_autoConnectToService public_oe property

public bool m_autoConnectToService
Résultat bool

m_enable3DReconstruction public_oe property

public bool m_enable3DReconstruction
Résultat bool

m_enableADFLoading public_oe property

public bool m_enableADFLoading
Résultat bool

m_enableAreaLearning public_oe property

public bool m_enableAreaLearning
Résultat bool

m_enableDepth public_oe property

public bool m_enableDepth
Résultat bool

m_enableMotionTracking public_oe property

public bool m_enableMotionTracking
Résultat bool

m_enableVideoOverlay public_oe property

public bool m_enableVideoOverlay
Résultat bool

m_motionTrackingAutoReset public_oe property

public bool m_motionTrackingAutoReset
Résultat bool

m_videoOverlayUseByteBufferMethod public_oe property

public bool m_videoOverlayUseByteBufferMethod
Résultat bool