Spherical Linear Interpolation (SLERP)
球面线性插值SLERPCommonA way to smoothly blend between two rotations along the shortest arc, at a constant angular speed.
Spherical linear interpolation (Slerp) generates the intermediate rotations between two given rotations; Ken Shoemake introduced it to computer graphics in a 1985 SIGGRAPH paper. Treating a unit quaternion as a point on the unit sphere in four dimensions, Slerp moves along the great-circle arc connecting the two points: slerp(q₀,q₁;t) = [sin((1−t)Ω)/sinΩ]·q₀ + [sin(tΩ)/sinΩ]·q₁, where t runs from 0 to 1 as progress along the interpolation and Ω is the angle between the two quaternions. The result is a rotation about a fixed axis at constant angular speed. Interpolating quaternions or Euler angles linearly instead produces uneven rotation speed, or even takes the long way around; and because q and −q represent the same rotation, an implementation has to check whether the two quaternions' dot product is negative and flip one of them first, to guarantee it takes the short arc. In robotics, it's commonly used to interpolate end-effector orientation trajectories, to upsample a low-frequency policy's output into high-frequency control commands, and to resample motion-capture data.
ExampleIf a policy outputs a target end-effector orientation at 10 Hz but the low-level controller runs at 500 Hz, SciPy's Slerp class can interpolate 50 intermediate orientations between each pair of consecutive targets, so the end effector rotates there at a constant rate.
- Also called
- Slerp, Quaternion Slerp
- Related
- Quaternion · Quaternion Double Cover · Trajectory Interpolation · Special Orthogonal Group SO(3) · Geodesic Distance on SO(3) · Euler Angles
- Sources
- Wikipedia: Slerp
SciPy: scipy.spatial.transform.Slerp