## On positions and orientationsIn CoppeliaSim there are many different ways to get, set, or work with positions & orientations. Following nomenclature is used throughout this user manual: Euler angles, a quaternion, or a rotation matrix. The orientation can be absolute (i.e. relative to the world frame), or relative to a specific frame.transformation or frame, it represents a position and orientation in 3D space. It can be specified as a pose, a transformation matrix, or as a position and orientation. A reference frame can be absolute (i.e. relative to the world frame), or relative to another reference frame.## Euler angles The Euler angles are three angles that describe a rotation, the orientation of a rigid body, or the orientation of a frame. There are twelve different conventions when talking about Euler angles. They can be grouped into [Euler angles convention in CoppeliaSim] where Rz, Ry and Rx represent elemental rotations about axes Z, Y and X respectively (in that order), of the For a rigid body, or scene object, you can obtain the same transformation if you rotate it in following order about its
[Yaw-Pitch-Roll rotations] where Rx, Ry and Rz represent elemental rotations about axes X, Y and Z respectively (in that order), of the Use following API functions to convert between ## QuaternionsQuaternions are four values that uniquely describe a rotation, the orientation of a rigid body, or the orientation of a frame. They are superior to Euler angles in several ways (e.g. no gimbal lock), but are more difficult to understand and construct. For that reason they are never used in user interfaces, but preferred when working with orientations in code. In CoppeliaSim, quaternions are expressed as a 4-element table: (Qx,Qy,Qz,Qw), where (Qx,Qy,Qz) is the rotation axis unit vector multiplied by sin(angle/2), and Qw is cos(angle/2), where angle is the rotation angle. Following API functions can be used to convert between quaternions, Euler angles and matrices: ## Rotation matricesA rotation matrix is a 3x3 matrix that describes a rotation, the orientation of a rigid body, or the orientation of a frame: [Rotation matrix in 3D space] In above matrix, unit vectors (Xx,Xy,Xz), (Yx,Yy,Yz) and (Zx,Zy,Zz) represent the reference frame's axis X, Y and Z respectively. In CoppeliaSim, rotation matrices are expressed as a 9-element table in row-major order: (Xx,Yx,Zx,Xy,Yy,Zy,Xz,Yz,Zz). See also following API functions related to rotation matrices: ## Transformation matricesA transformation matrix is a 4x4 matrix that describes a frame-frame transformation in 3D space. The first 3x3 elements of the matrix represent a rotation matrix: [Transformation matrix in 3D space] In CoppeliaSim, transformation matrices are expressed as a 12-element table in row-major order (the last row is omitted): (Xx,Yx,Zx,X,Xy,Yy,Zy,Y,Xz,Yz,Zz,Z). See also following API functions related to rotation matrices: ## PosesPoses are values that describe a frame transformation in 3D space. In CoppeliaSim, poses are expressed as a 7-element table: (X,Y,Z,Qx,Qy,Qz,Qw), i.e. a position followed by a quaternion. See also following API functions related to poses: |