Stay organized with collections
Save and categorize content based on your preferences.
ArPose
Represents an immutable rigid transformation from one coordinate space to another.
Summary
Typedefs
|
ArPose
|
typedef
struct ArPose_
|
Typedefs
ArPose
struct ArPose_ ArPose
Functions
ArPose_create
void ArPose_create(
const ArSession *session,
const float *pose_raw,
ArPose **out_pose
)
Allocates and initializes a new pose object.
pose_raw
points to an array of 7 floats, describing the rotation (quaternion) and translation of the pose in the same order as the first 7 elements of the Android Sensor.TYPE_POSE_6DOF
values documented on
SensorEvent.values()
.
The order of the values is: qx, qy, qz, qw, tx, ty, tz.
If pose_raw
is NULL
, initializes with the identity pose.
ArPose_destroy
void ArPose_destroy(
ArPose *pose
)
Releases memory used by a pose object.
ArPose_getMatrix
void ArPose_getMatrix(
const ArSession *session,
const ArPose *pose,
float *out_matrix_col_major_4x4
)
Converts a pose into a 4x4 transformation matrix.
Details |
Parameters |
session
|
The ARCore session
|
pose
|
The pose to convert
|
out_matrix_col_major_4x4
|
Pointer to an array of 16 floats, to be filled with a column-major homogenous transformation matrix, as used by OpenGL.
|
|
ArPose_getPoseRaw
void ArPose_getPoseRaw(
const ArSession *session,
const ArPose *pose,
float *out_pose_raw_7
)
Extracts the quaternion rotation and translation from a pose object.
Details |
Parameters |
session
|
The ARCore session
|
pose
|
The pose to extract
|
out_pose_raw_7
|
Pointer to an array of 7 floats, to be filled with the quaternion rotation and translation as described in ArPose_create .
|
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[null,null,["Last updated 2025-07-14 UTC."],[[["\u003cp\u003e\u003ccode\u003eArPose\u003c/code\u003e represents an immutable rigid transformation from one coordinate space to another, acting as a value type.\u003c/p\u003e\n"],["\u003cp\u003eYou can create and destroy \u003ccode\u003eArPose\u003c/code\u003e objects using \u003ccode\u003eArPose_create\u003c/code\u003e and \u003ccode\u003eArPose_destroy\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eArPose\u003c/code\u003e provides functionalities to convert a pose into a 4x4 transformation matrix (\u003ccode\u003eArPose_getMatrix\u003c/code\u003e) and extract its raw rotation and translation components (\u003ccode\u003eArPose_getPoseRaw\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eInitialization of an \u003ccode\u003eArPose\u003c/code\u003e can be done with raw pose data (quaternion and translation) or as an identity pose.\u003c/p\u003e\n"]]],[],null,["# ArPose\n======\n\nRepresents an immutable rigid transformation from one coordinate space to another.\n\nSummary\n-------\n\n| ### Typedefs ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| [ArPose](#arpose) | typedef `struct ArPose_` A structured rigid transformation ([value type](/ar/reference/c/group/concepts#object-ownership)). |\n\n| ### Functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| [ArPose_create](#arpose_create)`(const `[ArSession](/ar/reference/c/group/ar-session#arsession)` *session, const float *pose_raw, `[ArPose](/ar/reference/c/group/ar-pose#arpose)` **out_pose)` | `void` Allocates and initializes a new pose object. |\n| [ArPose_destroy](#arpose_destroy)`(`[ArPose](/ar/reference/c/group/ar-pose#arpose)` *pose)` | `void` Releases memory used by a pose object. |\n| [ArPose_getMatrix](#arpose_getmatrix)`(const `[ArSession](/ar/reference/c/group/ar-session#arsession)` *session, const `[ArPose](/ar/reference/c/group/ar-pose#arpose)` *pose, float *out_matrix_col_major_4x4)` | `void` Converts a pose into a 4x4 transformation matrix. |\n| [ArPose_getPoseRaw](#arpose_getposeraw)`(const `[ArSession](/ar/reference/c/group/ar-session#arsession)` *session, const `[ArPose](/ar/reference/c/group/ar-pose#arpose)` *pose, float *out_pose_raw_7)` | `void` Extracts the quaternion rotation and translation from a pose object. |\n\nTypedefs\n--------\n\n### ArPose\n\n```scdoc\nstruct ArPose_ ArPose\n``` \nA structured rigid transformation ([value type](/ar/reference/c/group/concepts#object-ownership)).\n\n\n- Allocate with: [ArPose_create](/ar/reference/c/group/ar-pose#arpose_create)\n- Release with: [ArPose_destroy](/ar/reference/c/group/ar-pose#arpose_destroy)\n\n\u003cbr /\u003e\n\nFunctions\n---------\n\n### ArPose_create\n\n```gdscript\nvoid ArPose_create(\n const ArSession *session,\n const float *pose_raw,\n ArPose **out_pose\n)\n``` \nAllocates and initializes a new pose object.\n\n`pose_raw` points to an array of 7 floats, describing the rotation (quaternion) and translation of the pose in the same order as the first 7 elements of the Android `Sensor.TYPE_POSE_6DOF` values documented on [`SensorEvent.values()`](https://developer.android.com/reference/android/hardware/SensorEvent#values).\n\nThe order of the values is: qx, qy, qz, qw, tx, ty, tz.\n\nIf `pose_raw` is `NULL`, initializes with the identity pose. \n\n### ArPose_destroy\n\n```scdoc\nvoid ArPose_destroy(\n ArPose *pose\n)\n``` \nReleases memory used by a pose object. \n\n### ArPose_getMatrix\n\n```gdscript\nvoid ArPose_getMatrix(\n const ArSession *session,\n const ArPose *pose,\n float *out_matrix_col_major_4x4\n)\n``` \nConverts a pose into a 4x4 transformation matrix.\n\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------------------------|-------------------------------------------------------------------------------------------------------------------------| | `session` | The ARCore session | | `pose` | The pose to convert | | `out_matrix_col_major_4x4` | Pointer to an array of 16 floats, to be filled with a column-major homogenous transformation matrix, as used by OpenGL. | |\n\n### ArPose_getPoseRaw\n\n```gdscript\nvoid ArPose_getPoseRaw(\n const ArSession *session,\n const ArPose *pose,\n float *out_pose_raw_7\n)\n``` \nExtracts the quaternion rotation and translation from a pose object.\n\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `session` | The ARCore session | | `pose` | The pose to extract | | `out_pose_raw_7` | Pointer to an array of 7 floats, to be filled with the quaternion rotation and translation as described in [ArPose_create](/ar/reference/c/group/ar-pose#arpose_create). | |"]]