Workspace Sampling

The moro.workspace module provides sampled end-effector workspace analysis. Workspace visualization is exposed through moro.visualization.plot_workspace() and documented in the Visualization API reference.

Sampled end-effector workspace analysis.

class moro.workspace.Workspace(points: ndarray, configurations: ndarray, joint_limits: tuple, seed: int | None = None, method: str | None = None, grid_shape: tuple[int, ...] | None = None)[source]

Bases: object

Sampled joint configurations and corresponding end-effector points.

property bounds
configurations: ndarray
property dof
grid_shape: tuple[int, ...] | None = None
joint_limits: tuple
method: str | None = None
points: ndarray
property samples
seed: int | None = None
class moro.workspace.WorkspaceSection(plane: str, level: float, thickness: float, indices: ndarray, points: ndarray, configurations: ndarray, source_samples: int)[source]

Bases: object

Rows of a sampled workspace lying within a Cartesian plane slab.

Points retain their original 3D coordinates. Indices refer to zero-based rows in the source Workspace. An empty section is valid.

configurations: ndarray
property dof
indices: ndarray
level: float
plane: str
points: ndarray
property samples
source_samples: int
thickness: float
moro.workspace.sample_workspace(robot, *, samples=None, joint_limits=None, parameters=None, seed=None, method='random', grid_shape=None)[source]

Evaluate position FK over selected finite-domain joint-space samples.

Random sampling remains the default, with 1,000 samples when omitted. A tensor-product grid instead requires grid_shape, with one axis count per DOF. Grid sample count is the product of those counts.

moro.workspace.section_workspace(workspace, *, plane='xy', level, thickness)[source]

Select original samples in a slab around a Cartesian coordinate plane.

XY filters the Z coordinate; XZ filters Y; YZ filters X. The full slab thickness is used: abs(normal - level) <= thickness / 2. No interpolation or new forward kinematics are performed.