mani_skill.envs.utils.randomization.samplers#
Various sampling functions/classes for fast, vectorized sampling of e.g. object poses
Classes#
Uniform placement sampler that lets you sequentially sample data such that the data is within given bounds and |
Module Contents#
- class mani_skill.envs.utils.randomization.samplers.UniformPlacementSampler(bounds, batch_size, device=None)[source]#
Uniform placement sampler that lets you sequentially sample data such that the data is within given bounds and not too close to previously sampled data. This sampler is also batched so you can use this easily for GPU simulated tasks
- Parameters:
bounds (Tuple[list[float], list[float]]) – ((low1, low2, …), (high1, high2, …))
batch_size (int) – The number of points to sample with each call to sample(…)
device (mani_skill.utils.geometry.rotation_conversions.Device) –
- sample(radius, max_trials, append=True, verbose=False)[source]#
Sample a position.
- Parameters:
radius (float) – collision radius.
max_trials (int) – maximal trials to sample.
append (bool, optional) – whether to append the new sample to fixtures. Defaults to True.
verbose (bool, optional) – whether to print verbosely. Defaults to False.
- Returns:
a sampled position.
- Return type:
torch.Tensor