pypose.Act¶
- class pypose.Act(X, p)[source]¶
Apply the batched transform to points in Euclidean or homogeneous coordinates.
\[y_i = X_i * p_i, \]where \(X\) is the batched transform and \(p_i \in \mathbb{R^{*\times3}}\) or \(p_i \in \mathbb{R^{*\times4}}\) denotes the points to be transformed.
- Parameters
X (LieTensor) – the input LieTensor (Lie Group).
p (Tensor) – the points to be transformed.
- Returns
the transformed points in Euclidean or homogeneous coordinates.
- Return type
Tensor
Examples
\(\mathrm{Act}\): (
SO3
,Tensor
) \(\mapsto\)Tensor
>>> p = torch.randn(3) # batch size 1, Euclidean coordinates >>> X = pp.identity_SO3(2) # batch size 2 >>> X.Act(p) # equivalent to: pp.Act(X, p) tensor([[ 1.7576, 1.1503, -0.9920], [ 1.7576, 1.1503, -0.9920]])
\(\mathrm{Act}\): (
SE3
,Tensor
) \(\mapsto\)Tensor
>>> p = torch.tensor([[0, 0, 0, 1.], [0, 0, 0, 1.]]) # batch size 2, homogeneous coordinates >>> X = pp.randn_SE3() # batch size 1 >>> X.Act(p) # apply same transform tensor([[-0.5676, -0.0452, -0.0929, 1.0000], [-0.5676, -0.0452, -0.0929, 1.0000]])
\(\mathrm{Act}\): (
Sim3
,Tensor
) \(\mapsto\)Tensor
>>> p = torch.tensor([[0, 0, 0, 1.], [0, 0, 0, 1.]]) # batch size 2 >>> X = pp.randn_Sim3(2) # batch size 2 >>> X.Act(p) # apply transform respectively. tensor([[ 0.1551, 2.2930, 0.4531, 1.0000], [-0.6140, -1.1263, 2.7607, 1.0000]])
\(\mathrm{Act}\): (
RxSO3
,Tensor
) \(\mapsto\)Tensor
>>> p = torch.tensor([[0, 0, 0.], [0, 0, 0.]]) # batch size 2, Euclidean coordinates >>> X = pp.randn_RxSO3(2) # batch size 2 >>> X.Act(p) # apply transform respectively. tensor([[0., 0., 0.], [0., 0., 0.]])