pytransform3d.rotations
.random_matrix#
- pytransform3d.rotations.random_matrix(rng=Generator(PCG64) at 0x7E0FC3BB8660, mean=array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]), cov=array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]))[source]#
Generate random rotation matrix.
Generate \(\Delta \boldsymbol{R}_{B_{i+1}{B_i}} \boldsymbol{R}_{{B_i}A}\), with \(\Delta \boldsymbol{R}_{B_{i+1}{B_i}} = Exp(\hat{\omega} \theta)\) and \(\hat{\omega}\theta \sim \mathcal{N}(\boldsymbol{0}_3, \boldsymbol{\Sigma}_{3 \times 3})\). The mean \(\boldsymbol{R}_{{B_i}A}\) and the covariance \(\boldsymbol{\Sigma}_{3 \times 3}\) are parameters of the function.
Note that uncertainty is defined in the global frame B, not in the body frame A.
- Parameters:
- rngnp.random.Generator, optional (default: random seed 0)
Random number generator.
- meanarray-like, shape (3, 3), optional (default: I)
Mean rotation matrix.
- covarray-like, shape (3, 3), optional (default: I)
Covariance of noise in exponential coordinate space.
- Returns:
- Rarray, shape (3, 3)
Rotation matrix
Examples using pytransform3d.rotations.random_matrix
#
Plot Polar Decomposition