pypose.euler¶
- pypose.euler(inputs, eps=0.0002)[source]¶
Convert batched LieTensor into Euler angles (roll, pitch, yaw).
- Parameters
inputs (
LieTensor
) – the input LieTensor.eps (
float
, optional) – the threshold to avoid the sigularity caused by gimbal lock. Default: 2e-4.
- Returns
the batched Euler angles in radians.
- Return type
Tensor
Supported input type:
so3
,SO3
,se3
,SE3
,sim3
,Sim3
,rxso3
, andRxSO3
.Warning
The Euler angle takes the rotation sequence of x (roll), y (pitch), and z (yaw) axis (counterclockwise). There is always more than one solution that can result in the same orientation, while this function only returns one of them.
When the pitch angle is around \(\pm \frac{\pi}{2}\) (north/south pole), there will be sigularity problem due to the gimbal lock and some information can be found in this pape.
Example
>>> x = pp.randn_SO3() >>> x.euler() # equivalent to pp.euler(x) tensor([-0.6599, 0.2749, -0.3263])
>>> x = pp.randn_Sim3(2) >>> x.euler() # equivalent to pp.euler(x) tensor([[-0.2701, -0.8006, -0.4150], [ 2.1550, 0.1768, 0.9368]])
>>> x = pp.randn_rxso3() >>> x.euler() # equivalent to pp.euler(x) tensor([ 1.2676, -0.4783, -0.3596])
See
euler2SO3
for more information.