Genesis-Embodied-AI/genesis-world · error · ValueError

probe_arc_spacing must be positive, got {arc_spacing}

Error message

probe_arc_spacing must be positive, got {arc_spacing}

What it means

Raised by the spherical-cap probe point generator in genesis/utils/geom.py when the arc_spacing argument is zero or negative. arc_spacing controls the angular spacing between probe rings on the cap, so it must be a positive float for the sampling loop to produce points. The check runs after the radius and n_rings validations, so all three must be valid together.

Source

Thrown at genesis/utils/geom.py:2359

        Number of latitude rings, including the pole as a degenerate ring.
    arc_spacing : float
        Target arc length between neighboring probes along each ring.
    return_normals : bool
        Whether to return the normal vectors of the points.

    Returns
    -------
    points : np.ndarray, shape (N, 3)
        Points on the sphere surface.
    normals : np.ndarray, shape (N, 3), optional
        Normal vectors of the points. Only returned if ``return_normals`` is True.
    """
    if radius <= 0.0:
        raise ValueError(f"radius must be positive, got {radius}")
    if n_rings < 1:
        raise ValueError(f"n_rings must be >= 1, got {n_rings}")
    if arc_spacing <= 0.0:
        raise ValueError(f"probe_arc_spacing must be positive, got {arc_spacing}")

    pole = np.asarray(cap_axis, dtype=gs.np_float)
    p_norm = float(np.linalg.norm(pole))
    if p_norm < gs.EPS:
        raise ValueError("cap_axis must be non-zero")
    pole = pole / p_norm
    t0, t1 = orthogonals(pole)

    pts: list[np.ndarray] = []
    denom = max(n_rings - 1, 1)
    for i in range(n_rings):
        theta = (i / denom) * (0.5 * np.pi)
        sin_t, cos_t = np.sin(theta), np.cos(theta)
        ring_r = radius * sin_t
        circ = 2.0 * np.pi * ring_r
        if ring_r <= radius * gs.EPS:
            n_pts = 1
        else:

View on GitHub (pinned to 56e4aa5d82)

Solutions

  1. Pass an explicit positive arc_spacing (e.g. 0.1 radians).
  2. Check the expression computing arc_spacing; ensure no integer division by a larger number yields 0.
  3. If deriving spacing from n_rings, guard with max(arc_spacing, small_positive).

Example fix

// before
pts = sample_cap_probe_points(radius=0.5, n_rings=5, arc_spacing=1 // 20)
// after
pts = sample_cap_probe_points(radius=0.5, n_rings=5, arc_spacing=1.0 / 20)
Defensive patterns

Strategy: validation

Validate before calling

assert arc_spacing > 0.0, f'arc_spacing must be positive, got {arc_spacing}'

Prevention

When it happens

Trigger: Calling the cap-sphere sampling helper (the function around genesis/utils/geom.py:2359) with arc_spacing=0, a negative arc_spacing, or a value that degenerates to 0 through unit conversion (e.g. degrees/radians mix-up).

Common situations: Computing arc_spacing from a formula such as arc_spacing = 1.0 / n_rings with n_rings very large (integer division yielding 0), or passing an angular step in the wrong units so it underflows to 0.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of Genesis-Embodied-AI/genesis-world@56e4aa5d82 (2026-08-28). Data as JSON: /api/errors/f4e4d634ab48fd54. Report an issue: GitHub.