pypose.Sim3¶
- pypose.Sim3 = functools.partial(<class 'pypose.lietensor.lietensor.LieTensor'>, ltype=<pypose.lietensor.lietensor.Sim3Type object>)¶
Alias of Sim3 type
LieTensor
.- Parameters
data (
Tensor
, orlist
, or ‘int
…’) –A
Tensor
object, or constructing aTensor
object fromlist
, which defines tensor data (see below), or from ‘int
…’, which defines tensor shape.The shape of
Tensor
object must be(*, 8)
, where*
is empty, one, or more batched dimensions (thelshape
of this LieTensor), otherwise error will be raised.
Internally, Sim3 LieTensors are stored by concatenating the translation vector with an RxSO3:
\[\mathrm{data}[*, :] = [t_x, t_y, t_z, q_x, q_y, q_z, q_w, s], \]where \(\begin{pmatrix} t_x & t_y & t_z \end{pmatrix}^T \in \mathbb{R}^3\) is the translation vector and \(\begin{pmatrix} q_x & q_y & q_z & q_w \end{pmatrix}^T\) and \(s \in \mathbb{R}\) are the unit quaternion and the scaling factor as in
pp.RxSO3
, respectively.Examples
>>> pp.Sim3(torch.randn(2, 8)) Sim3Type LieTensor: tensor([[ 0.0175, 0.8657, -0.2274, 2.2380, -0.0297, -0.3799, -0.0664, 0.9995], [ 0.8744, 0.4114, 1.2041, -0.5687, -0.5630, 0.6025, -0.6137, 1.1185]]) >>> pp.Sim3([0, 0, 0, 0, 0, 0, 1, 1]) Sim3Type LieTensor: tensor([0., 0., 0., 0., 0., 0., 1., 1.])
If
data
is tensor-like, the last dimension should correspond to the 8 elements of the above embedding.Note
It is not advised to construct Sim3 Tensors by specifying storage sizes with ‘
int
…’, which does not initialize data.Consider using
pypose.randn_Sim3
orpypose.identity_Sim3
instead.See
pypose.Log
,pypose.Inv
,pypose.Act
,pypose.Retr
,pypose.Adj
,pypose.AdjT
,pypose.Jinvp
for implementations of relevant operations.