Skip to content

Coordinate System Translation, Rotation, and Position Offset: Basic Principles and Application Examples ​

Basic Principles ​

Basic Definitions ​

Coordinate System: A reference frame defined by an origin and a set of mutually orthogonal, oriented basis axes (usually X, Y, Z), used to uniquely represent the position and orientation of a point in space under specific units.

  • 2D contains two axes (X, Y); 3D contains three axes (X, Y, Z);
  • It is necessary to agree on chirality (usually the right-hand system) and units (mm, m, etc.);
  • Vectors and orientations given relative to the same coordinate system are comparable and composable.

Common Types of Coordinate Transformations ​

Translation: poseAdd() ​

  • Meaning: Move the position of the same point within the same coordinate system, with its orientation unchanged.
  • Formula (with translation when a point expressed in frame B is transformed to frame A):
pA=RABpB+tAB

Here tAB=[tx,ty,tz]T is the translation vector expressed in coordinate system A.

  • R is responsible for "changing direction", and t is responsible for "adding position". For translation only, pA=pB+t.

Rotation: poseRotation() ​

  • Meaning: Rotate the orientation within the same coordinate system; the position changes in a circular path relative to the origin.

  • Formula: pA′=RpA, where R∈SO(3), satisfying RTR=I and detR=+1.

  • Common representations (3D):

    • Euler angles ZYX (yaw-pitch-roll): R=Rz(ψ)Ry(θ)Rx(ϕ)
    • Axis-angle (rotation by angle θ about the unit axis ω^): Rodrigues' formula R=I+sin⁡θ[ω^]×+(1−cos⁡θ)([ω^]×)2

Translation + Rotation Combined (Pose / Homogeneous Transformation): poseTrans() ​

Pack rotation and translation into a 4×4 matrix:

T=[Rt0T1],[pA1]=TAB[pB1]
  • Composition order: Right-multiply by the transformation that is closer to the point. For example, first offset/rotate within the TCP's own frame (ΔTtcp), then place it back into the base:
Tbasetcp,new=TbasetcpΔTtcp
  • Inverse transformation poseInverse(): Convert the "pose from B to A" into the "pose from A to B",
T−1=(RT−RTt01)

Application Examples ​

1. Point Offset ​

Example program package

  1. Point offset via the Direction-Until node

    方向-直到节点的点位偏移

  2. Feature in the 0.31 branch: point offset relative to a variable or waypoint

    点位偏移

2. Coordinate System Offset ​

  1. Implement offset via a custom coordinate system

    坐标系偏移

3. Coordinate System + Point Offset ​

坐标系+点位偏移