@Restricted @Beta public interface IAARSession
NOTE! To enable AR features, please contact IndoorAtlas sales.
The AR API provides you with convenient means of converting between two important coordinate systems:
The local tracking of the device in the AR coordinate system is assumed to be handled by an external AR solution like ARCore, whose certain outputs are given to this class. The IndoorAtlas platform fuses this information with the IndoorAtlas position estimates and provides the relevant coordinate transforms in a stable and visually consistent manner, which allows you to easily place geographically referenced content in the AR world.
The methods of an instance of this class can be called from any thread.
Modifier and Type | Method and Description |
---|---|
void |
addArPlane(float[] center,
float extentX,
float extentZ)
Input AR plane tracking information.
|
IALocation |
arToGeo(float[] modelMatrix)
Convert from AR to geographic coordinates
|
IALocation |
arToGeo(float x,
float y,
float z)
Convert from AR to geographic coordinates
|
boolean |
converged() |
IAARObject |
createArPOI(double lat,
double lng,
int floorNumber) |
IAARObject |
createArPOI(double lat,
double lng,
int floorNumber,
double heading,
double zOffset)
Create an AR Point-of-Interest in the given geographical coordinates.
|
IAARObject |
createArPOI(IALocation iaLocation) |
void |
destroy()
Clean-up.
|
boolean |
geoToAr(double lat,
double lng,
int floorNumber,
double heading,
double zOffset,
float[] modelMatrix)
Convert from geographical to AR coordinates
|
boolean |
geoToAr(double lat,
double lng,
int floorNumber,
float[] modelMatrix)
Convert from geographical to AR coordinates, with default rotation and no vertical offset
|
boolean |
geoToAr(IALocation iaLocation,
float[] modelMatrix)
Convert from geographical to AR coordinates (with no vertical offset)
|
IAARObject |
getWayfindingCompassArrow() |
IAARObject |
getWayfindingTarget() |
java.util.List<IAARObject> |
getWayfindingTurnArrows() |
void |
setCameraToWorldMatrix(float[] currentCameraMatrix)
Set the current camera matrix.
|
void |
setPoseMatrix(float[] arPoseMatrix)
Input current pose from the external AR tracking.
|
void |
startWayfinding(IALatLngFloorCompatible to)
Start AR wayfinding and enable the high-level AR wayfinding helper API, which manages the
coordinates of certain wayfinding elements in the AR coordinate system in a visually
consistent manner.
|
void |
stopWayfinding()
Stop AR wayfinding
|
void setPoseMatrix(float[] arPoseMatrix)
arPoseMatrix
- Current "sensor pose" from AR tracking. A column-major
representation of a 4x4 homogeneous IMU-to-world matrix, where the
IMU coordinate system axes are as defined by the Android sensor
coordinates.void setCameraToWorldMatrix(float[] currentCameraMatrix)
currentCameraMatrix
- A column-major representation of a 4x4 homogeneous
camera-to-world matrix, where the the negative Z axis is points "into the screen"
in camera coordinates. Unlike the IMU-to-world matrix given to the
IAAR.setPoseMatrix method, this matrix may change with UI orientation.void addArPlane(float[] center, float extentX, float extentZ)
center
- Horizontal plane center coordinates in the AR coordinate system.
Array of 3 elements, { X, Y, Z }. (Y is the vertical coordinate)extentX
- Horizontal bounding box size along the X axis (AR coordinates)extentZ
- Horizontal bounding box size along the Z axis (AR coordinates)boolean geoToAr(double lat, double lng, int floorNumber, double heading, double zOffset, float[] modelMatrix)
lat
- latitude in degreeslng
- longitude in degreesfloorNumber
- IndoorAtlas integer floor numberheading
- heading in degrees 0=North, 90=East, 180=South, 270=WestzOffset
- Vertical offset from the floor plane in metersmodelMatrix
- Output: a 4x4 homogeneous model-to-world matrix. Column-major format.
Must contain exactly 16 elements.boolean geoToAr(double lat, double lng, int floorNumber, float[] modelMatrix)
lat
- latitude in degereeslng
- longitude in degreesfloorNumber
- IndoorAtlas floor numbermodelMatrix
- Ouput: 4x4 homogeneous model-to-world matrix in column-majorboolean geoToAr(IALocation iaLocation, float[] modelMatrix)
iaLocation
- geographical coordinates (bearing is used for rotation)modelMatrix
- Ouput: 4x4 homogeneous model-to-world matrix in column-majorIALocation arToGeo(float[] modelMatrix)
modelMatrix
- input 4x4 homogeneous model-to-world matrix in column-majorIALocation arToGeo(float x, float y, float z)
x
- AR coordinate system X-coordinate (horizontal)y
- AR coordinate system Y-coordinate (vertical)z
- AR coordinate system Z-coordinate (horizontal)boolean converged()
IAARObject createArPOI(double lat, double lng, int floorNumber, double heading, double zOffset)
lat
- latitude in degreeslng
- longitude in degreesfloorNumber
- IndoorAtlas integer floor numberheading
- heading in degrees 0=North, 90=East, 180=South, 270=WestzOffset
- Vertical offset from the floor plane in metersIAARObject createArPOI(double lat, double lng, int floorNumber)
IAARObject createArPOI(IALocation iaLocation)
void startWayfinding(IALatLngFloorCompatible to)
to
- Wayfinding target / destinationvoid stopWayfinding()
IAARObject getWayfindingTarget()
IAARObject getWayfindingCompassArrow()
java.util.List<IAARObject> getWayfindingTurnArrows()
void destroy()