pytransform3d.trajectories
.random_trajectories#
- pytransform3d.trajectories.random_trajectories(rng=Generator(PCG64) at 0x78F0D2D7F3E0, n_trajectories=10, n_steps=101, start=array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), goal=array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), scale=array([100., 100., 100., 100., 100., 100.]))[source]#
Generate random trajectories.
Create a smooth random trajectory with low accelerations.
The generated trajectories consist of a linear movement from start to goal and a superimposed random movement with low accelerations. Hence, the first pose and last pose do not exactly equal the start and goal pose respectively.
- Parameters:
- rngnp.random.Generator, optional (default: random seed 0)
Random number generator
- n_trajectoriesint, optional (default: 10)
Number of trajectories that should be generated.
- n_stepsint, optional (default: 101)
Number of steps in each trajectory.
- startarray-like, shape (4, 4), optional (default: I)
Start pose as transformation matrix.
- goalarray-like, shape (4, 4), optional (default: I)
Goal pose as transformation matrix.
- scalearray-like, shape (6,), optional (default: [100] * 6)
Scaling factor for random deviations from linear movement from start to goal.
- Returns:
- trajectoriesarray, shape (n_trajectories, n_steps, 4, 4)
Random trajectories between start and goal.