irsim.util.random#

Attributes#

rng

Functions#

set_seed(→ None)

random_uniform([low, high, size, min_distance])

Sample random points uniformly with a pairwise min-distance constraint.

Module Contents#

irsim.util.random.rng#
irsim.util.random.set_seed(seed: int | None = None) None[源代码]#
irsim.util.random.random_uniform(low=None, high=None, size=(3, 1), min_distance=1.0)[源代码]#

Sample random points uniformly with a pairwise min-distance constraint.

参数:
  • low (list | np.ndarray) -- Lower bound as a 3D vector (x, y, theta). Default is [0.5, 0.5, 0.0].

  • high (list | np.ndarray) -- Upper bound as a 3D vector (x, y, theta). Default is [9.5, 9.5, 6.28].

  • size (tuple) -- (dim, n) where dim is 2 or 3 and n is the number of points to sample. When dim == 2, only x and y are sampled and theta is set to 0. Default is (3, 1).

  • min_distance (float) -- Minimum pairwise distance in the xy plane. Default is 1.0.

返回:

Random points of shape (3, n).

返回类型:

np.ndarray