Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

ARKitManager

  • Last UpdatedDec 07, 2023
  • 6 minute read

The ARKitManager node is available in iOS to support various AR functionalities. On activating the ARKitManager node, it starts the ARSession and tracks the world. It uses the device’s motion and visual odometry to track the camera and the feature points in the real world in a virtual coordinate system. The virtual coordinate system has its origin at the location of camera when the session was started.

The ARKITManager node also provides functionalities to save the local environment spatial data to a file and then load it in a different session. In addition, ARKitManager reports some details, such as the ambient light information of the room, to help better understand the real world. Through these details, the application developer can alter the virtual object render properties so that they mix well with the real world objects.

Access to camera

ARKitManager node requires access to the camera in order to function. When the ARKitManager node is activated, it checks whether the XRViewer App has been granted the Camera permission. When the app is running the first time, and on activating the ARKitManager node, the user will be presented with a message dialog asking to grant the permission. If the permission is denied by the user, the ARKitManager node will not function and the Active field will be set to false. From the second time onwards, a different alert will be presented to the user that will prompt the user to go to the App's Permission settings and grant camera permission (if the camera permission has been revoked or not granted the first time). The scriptwriter should be aware of this aspect of permissions. The scriptwriter can also make use of the Permission node to check or request permission before activating the ARKitManager node.

Platform support

This node is supported on iOS platform only. Since this node is based on Apple’s ARKit APIs it has the same restrictions as Apple ARKit. ARKit is only available on devices running A9 and more-powerful processors: essentially iPhone 6S and newer, iPad Pros, and iPads released no earlier than 2017.

XR-WIN

XR-P-WIN

XR-P-IOS

XR-P-AND

XR-P-WASM

No support

No support

Full support

No support

No support

No support

No support

Full support

No support

No support

Code example

This is a code example for the ARKitManager node.

<ARKitManager name="arManager" active="false" />

World Map Anchors

The WorldMapAnchor field gives the details of anchors that are saved in the worldMap. It can be used to fetch the details of the anchors after loading a world map.

Details of the anchor will vary based on the type of anchor.

Type of Anchor

Code example

ARAnchor

{

Anchor Identifier: “”

{

type : “ARAnchor”

name:””

matrix:””

}

}

ImageAnchor

{

Anchor Identifier: “”

{

type : “ImageAnchor”

matrix:””

}

}

PlaneAnchor

{

Anchor Identifier: “”

{

type : “PlaneAnchor”

matrix:””

center:””

extents:””

}

}

ObjectAnchor

{

Anchor Identifier: “”

{

type : “ObjectAnchor”

matrix:””

}

}

Fields

These are the fields for the ARKitMarker node. Only the node-specific fields are indicated, not fields obtained by inheritance.

Field inheritance: NodeBase > ARKitManager

Fields

Type

Use

Default

Description

active

sbool

Optional

true

Activates and deactivates an ARSession. When true, the video camera output is shown and SLAM is started to map the position of the camera and understands the feature points in the scene.

ambientColorTemperature

sfloat

Read only

The estimated color temperature, in degrees Kelvin, of ambient light throughout the scene. A value of 6500 represents neutral (pure white) lighting; lower values indicate a "warmer" yellow or orange tint, and higher values indicate a "cooler" blue tint.

ambientLightIntensity

sfloat

Read only

The ambientLightIntensity value is based on the internal exposure compensation of the camera device, and scaled to be appropriate for use in rendering architectures that use realistic lighting metrics. A value of 1000 represents "neutral" lighting.

anchorsToSave

mstring

Optional

This field indicates the anchors that need to be saved in the world map. If you want to save a particular anchor, then the identifier of that anchor needs to be added to this field.

If this field is empty, then all the anchors detected in the ARSession will be saved in the world map.

camera

sstring

Mandatory

The name of the camera to be used by ARManager. The system adapts camera settings such as Fov, Near, or Far.

isTracking

sbool

Read only

false

The isTracking value is updated each frame to report whether scene tracking is running or not. If the isTracking value is false, it means that the ARKitManager was not able to track the currentFrame in the ARSession.

loadedAnchors

mstring

Read only

The worldMapAnchors field gives the details of the anchors that are saved in the worldMap. It can be used to fetch the details of the anchors after loading a world map. Details of the anchor will vary based on the type of anchor.

  • ARAnchor

  • ImageAnchor

  • ObjectAnchor

  • PlaneAnchor

loadWorldMap

sevent

Optional

Event to load the previously saved world map from the device storage. When this event is raised, it will look for the world map file with the name specified in the worldMapName field in the app directory.

limitedTrackingReason

sstring

Readonly

A possible diagnosis for limited position-tracking quality as of when the camera captured a frame.

  • ExcessiveMotion: The camera is moving too quickly.

  • Initializing: ARKit is still starting up.

  • InsufficientFeatures: Processing is not revealing sufficient high-contrast points in the field of view.

  • None: Either tracking is Normal or the reason for poor tracking cannot be determined.

  • Relocalizing: The AR session was interrupted and is reorienting.

object

sstring

Optional

The name of the 3D object (dummy) that will be rendered at the position and with the orientation of the tracked image.

saveWorldMap

sevent

Optional

Event to save the world map to the device storage. When this event is raised, the ARKit World map is saved with the name specified in the worldMapName field. If the anchorsToSave field is empty, then all detected anchors will also be saved to the world map. Otherwise, only the anchors specified in the anchorsToSave field will be saved in the world map. The file is typically stored in the App directory where the PAK file is also stored.

trackingQuality

sstring

Read only

The general quality of position tracking available when the camera captured a frame.

  • NotAvailable: Camera position tracking is not available.

  • Limited: Tracking is available, but results are limited.

  • Normal: Camera position tracking is providing optimal results.

worldMapName

sevent

Optional

The name of the world map to be saved. WorldMap is saved in ARKit specific file format when a saveWorldMap event is raised from the script. World map contains the space-mapping state and set of anchors from a world-tracking AR session.

worldMapStatus

senum

Read Only

This field indicates the status of world mapping by the ARKit. When the ARKit node is initialized, it takes some time to map the local environment. This field indicates whether it’s a good time to save the world map.

The potential statuses are:

  • Not Available

  • Limited

  • Extending

  • Mapped

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in