class DeviceMapAccessController
(Niantic.Lightship.AR.Mapping.DeviceMapAccessController)
Overview
Class to access primitive device map data and configs
class DeviceMapAccessController {
public:
// properties
DeviceMapAccessController Instance;
OutputEdgeType OutputEdgeType;
// methods
void ClearDeviceMap();
void StartUploadingMaps();
void StopUploadingMaps();
void StartDownloadingMaps();
void StopDownloadingMaps();
bool MarkMapNodeForUpload(TrackableId mapId);
bool HasMapNodeBeenUploaded(TrackableId mapId);
void AddMapNode(byte[] dataBytes);
void AddSubGraph(byte[] dataBytes);
bool GetMapNodeIds(out TrackableId[] mapIds);
bool GetSubGraphIds(
out TrackableId[] subgraphIds,
OutputEdgeType outputEdgeType = OutputEdgeType.All
);
bool GetMapNodes(TrackableId[] mapIds, out MapNode[] maps);
bool GetSubGraphs(TrackableId[] subgraphIds, out MapSubGraph[] blobs);
bool GetLatestUpdates(
out MapNode[] mapNodes,
out MapSubGraph[] subGraphs,
OutputEdgeType outputEdgeType = OutputEdgeType.All
);
bool CreateAnchorFromMapNode(
MapNode map,
Matrix4x4 pose,
out byte[] anchorPayload
);
bool MergeSubGraphs(
MapSubGraph[] subgraphs,
bool onlyKeepLatestEdges,
out MapSubGraph mergedSubgraph
);
void ExtractMapMetaData(
byte[] mapBlob,
out Vector3[] points,
out float[] errors,
out Vector3 center,
out string mapType
);
};
Detailed Documentation
Class to access primitive device map data and configs
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Properties
OutputEdgeType
OutputEdgeType OutputEdgeType
Specifies what type of edges will be output by GetSubGraphs() When set, this config takes in effect immediately
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Methods
ClearDeviceMap
void ClearDeviceMap()
Clear map/graph node locally registered in the localizer
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
StartUploadingMaps
void StartUploadingMaps()
Starts uploading new maps generated from this call-on
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
StopUploadingMaps
void StopUploadingMaps()
Stops uploading maps
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
StartDownloadingMaps
void StartDownloadingMaps()
Starts downloading maps around to localize
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
StopDownloadingMaps
void StopDownloadingMaps()
Stops downloading maps
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
MarkMapNodeForUpload
bool MarkMapNodeForUpload(TrackableId mapId)
Marks map node for upload. Downloads are triggered by StartUploadingMaps. Returns false if op fails early.
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
HasMapNodeBeenUploaded
bool HasMapNodeBeenUploaded(TrackableId mapId)
Checks if map node was uploaded
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
AddMapNode
void AddMapNode(byte[] dataBytes)
Add a map node to the localizer
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
dataBytes
- map node blob data as a byte array
AddSubGraph
void AddSubGraph(byte[] dataBytes)
Add graph(s) to the localizer
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
dataBytes
- graph blob data as a byte array
GetMapNodeIds
bool GetMapNodeIds(out TrackableId[] mapIds)
Get a list of current map nodes in the native map storage
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
mapIds
- an array of map ids
Returns:
True if any ids generated. False if no map has been generated so far
GetSubGraphIds
bool GetSubGraphIds(
out TrackableId[] subgraphIds,
OutputEdgeType outputEdgeType = OutputEdgeType.All
)
Get a list of current map nodes in the native map storage
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
subgraphIds
- an array of map ids
outputEdgeType
- specify what type of edges will be output
Returns:
True if any ids generated. False if no map has been generated so far
GetMapNodes
bool GetMapNodes(TrackableId[] mapIds, out MapNode[] maps)
Get the map data generated
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
maps
- an array of map data
Returns:
True if any maps generated. False if no map has been generated so far
GetSubGraphs
bool GetSubGraphs(TrackableId[] subgraphIds, out MapSubGraph[] blobs)
Get graph data of map nodes
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
blobs
- an array of graphs
Returns:
True if any graph generated. False if no graph has been generated so far
CreateAnchorFromMapNode
bool CreateAnchorFromMapNode(
MapNode map,
Matrix4x4 pose,
out byte[] anchorPayload
)
Generates Anchor (as payload) from MapNode
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
map
- A map node, device map
pose
- A local pose of the anchor to create
anchorPayload
- anchor payload as byte array
Returns:
True if byte array representing the anchor that can be wrapped by namespace Niantic.Lightship.AR.PersistentAnchors
MergeSubGraphs
bool MergeSubGraphs(
MapSubGraph[] subgraphs,
bool onlyKeepLatestEdges,
out MapSubGraph mergedSubgraph
)
Merges Map Subgraphs
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
subgraphs
- Array of subgraphs to merge
onlyKeepLatestEdges
- If true, it only keeps latest edge between two given nodes
mergedSubgraph
- Output merged subgraph
Returns:
True if merge succeeded
ExtractMapMetaData
void ExtractMapMetaData(
byte[] mapBlob,
out Vector3[] points,
out float[] errors,
out Vector3 center,
out string mapType
)
Extract map metadata from the map blob data
Parameters:
mapBlob
- map blob data as byte array
points
- feature points relative to the map center
errors
- error of each points
center
- map center in the mapping coordinate system
mapType
- indicate type of the map data