embodichain.lab.sim.motion.workspace.configs#
Configuration objects for workspace analysis.
Covers sampling (SamplingConfig), caching (CacheConfig), metrics (MetricConfig and per-metric reachability / manipulability / density configs), visualization (VisualizationConfig), and dimension constraints (DimensionConstraint).
Classes:
Configuration for caching workspace analysis results. |
|
Configuration for density metric. |
|
Configuration for dimensional constraints in workspace analysis. |
|
Configuration for manipulability metric. |
|
Configuration for workspace analysis metrics. |
|
Types of workspace metrics. |
|
Configuration for reachability metric. |
|
Configuration for sampling strategies in workspace analysis. |
|
Sampling strategy for joint space. |
|
Visualization configuration |
|
- class embodichain.lab.sim.motion.workspace.configs.CacheConfig[source]#
Bases:
objectConfiguration for caching workspace analysis results.
Methods:
__init__([enabled, cache_dir, use_hash, ...])Attributes:
Directory to store cache files.
'npz' (numpy), 'pkl' (pickle), 'h5' (hdf5).
Whether to compress cache files to save disk space.
Whether to enable caching of analysis results.
Maximum total size of cache directory in megabytes.
Whether to use hash-based cache keys (based on robot config and parameters).
- __init__(enabled=True, cache_dir=None, use_hash=True, compression=True, max_cache_size_mb=1000, cache_format='npz')#
-
cache_dir:
Path|None= None# Directory to store cache files. If None, uses default system cache directory.
-
cache_format:
str= 'npz'# ‘npz’ (numpy), ‘pkl’ (pickle), ‘h5’ (hdf5).
- Type:
Format for cache files. Options
-
compression:
bool= True# Whether to compress cache files to save disk space.
-
enabled:
bool= True# Whether to enable caching of analysis results.
-
max_cache_size_mb:
int= 1000# Maximum total size of cache directory in megabytes. Old files will be removed if exceeded.
-
use_hash:
bool= True# Whether to use hash-based cache keys (based on robot config and parameters).
- class embodichain.lab.sim.motion.workspace.configs.DensityConfig[source]#
Bases:
objectConfiguration for density metric.
Methods:
__init__([radius, k_neighbors, ...])Attributes:
Whether to compute density distribution statistics.
Number of nearest neighbors for density estimation.
Radius for local density estimation in meters.
- __init__(radius=0.05, k_neighbors=30, compute_distribution=True)#
-
compute_distribution:
bool= True# Whether to compute density distribution statistics.
-
k_neighbors:
int= 30# Number of nearest neighbors for density estimation.
-
radius:
float= 0.05# Radius for local density estimation in meters.
- class embodichain.lab.sim.motion.workspace.configs.DimensionConstraint[source]#
Bases:
objectConfiguration for dimensional constraints in workspace analysis.
Methods:
__init__([min_bounds, max_bounds, ...])Attributes:
Whether to enforce collision-free constraints during analysis.
List of excluded zones as [(min_bounds, max_bounds), ...].
Ground plane height in meters.
Scale factor for joint limits (1.0 = use full range, 0.8 = use 80% of range).
Maximum bounds for workspace [x_max, y_max, z_max] in meters.
Minimum bounds for workspace [x_min, y_min, z_min] in meters.
Whether to check for self-collision when analyzing workspace.
- __init__(min_bounds=None, max_bounds=None, joint_limits_scale=1.0, exclude_zones=<factory>, ground_height=0.0, enforce_collision_free=False, self_collision_check=False)#
-
enforce_collision_free:
bool= False# Whether to enforce collision-free constraints during analysis.
-
exclude_zones:
List[Tuple[ndarray,ndarray]]# List of excluded zones as [(min_bounds, max_bounds), …]. Robot end-effector should avoid these regions.
-
ground_height:
float= 0.0# Ground plane height in meters. Points below this will be filtered out.
-
joint_limits_scale:
float= 1.0# Scale factor for joint limits (1.0 = use full range, 0.8 = use 80% of range).
-
max_bounds:
ndarray|None= None# Maximum bounds for workspace [x_max, y_max, z_max] in meters.
-
min_bounds:
ndarray|None= None# Minimum bounds for workspace [x_min, y_min, z_min] in meters.
-
self_collision_check:
bool= False# Whether to check for self-collision when analyzing workspace.
- class embodichain.lab.sim.motion.workspace.configs.ManipulabilityConfig[source]#
Bases:
objectConfiguration for manipulability metric.
Methods:
__init__([jacobian_threshold, ...])Attributes:
Whether to generate manipulability heatmap.
Whether to compute isotropy index (condition number).
Minimum manipulability value to consider valid.
- __init__(jacobian_threshold=0.01, compute_isotropy=True, compute_heatmap=False)#
-
compute_heatmap:
bool= False# Whether to generate manipulability heatmap.
-
compute_isotropy:
bool= True# Whether to compute isotropy index (condition number).
-
jacobian_threshold:
float= 0.01# Minimum manipulability value to consider valid.
- class embodichain.lab.sim.motion.workspace.configs.MetricConfig[source]#
Bases:
objectConfiguration for workspace analysis metrics.
Methods:
__init__([enabled_metrics, reachability, ...])Attributes:
Configuration for density metric.
List of metrics to compute.
Configuration for manipulability metric.
'json', 'yaml', 'pkl'.
Configuration for reachability metric.
Whether to save metric results to file.
- __init__(enabled_metrics=None, reachability=None, manipulability=None, density=None, save_results=True, output_format='json')#
-
density:
DensityConfig= None# Configuration for density metric.
-
enabled_metrics:
List[MetricType] = None# List of metrics to compute. If None, computes all metrics.
-
manipulability:
ManipulabilityConfig= None# Configuration for manipulability metric.
-
output_format:
str= 'json'# ‘json’, ‘yaml’, ‘pkl’.
- Type:
Output format for metrics. Options
-
reachability:
ReachabilityConfig= None# Configuration for reachability metric.
-
save_results:
bool= True# Whether to save metric results to file.
- class embodichain.lab.sim.motion.workspace.configs.MetricType[source]#
Bases:
EnumTypes of workspace metrics.
Attributes:
Compute all available metrics.
Measures point density and workspace distribution.
Measures dexterity/manipulability throughout workspace.
Measures reachable workspace volume and coverage.
- ALL = 'all'#
Compute all available metrics.
- DENSITY = 'density'#
Measures point density and workspace distribution.
- MANIPULABILITY = 'manipulability'#
Measures dexterity/manipulability throughout workspace.
- REACHABILITY = 'reachability'#
Measures reachable workspace volume and coverage.
- class embodichain.lab.sim.motion.workspace.configs.ReachabilityConfig[source]#
Bases:
objectConfiguration for reachability metric.
Methods:
__init__([voxel_size, min_points_per_voxel, ...])Attributes:
Whether to compute coverage percentage relative to bounding box.
Minimum number of points in a voxel to consider it reachable.
Size of voxels for volume calculation in meters.
- __init__(voxel_size=0.01, min_points_per_voxel=1, compute_coverage=True)#
-
compute_coverage:
bool= True# Whether to compute coverage percentage relative to bounding box.
-
min_points_per_voxel:
int= 1# Minimum number of points in a voxel to consider it reachable.
-
voxel_size:
float= 0.01# Size of voxels for volume calculation in meters.
- class embodichain.lab.sim.motion.workspace.configs.SamplingConfig[source]#
Bases:
objectConfiguration for sampling strategies in workspace analysis.
Methods:
__init__([strategy, num_samples, ...])Attributes:
Number of samples to process in each batch.
Mean for Gaussian sampling (used with GAUSSIAN strategy).
Standard deviation for Gaussian sampling (used with GAUSSIAN strategy).
Resolution for grid sampling (used with UNIFORM strategy).
Weight function for importance sampling (used with IMPORTANCE strategy).
Number of samples to generate.
Random seed for reproducibility.
'clip', 'reject', 'extend'.
Custom sphere center for SPHERE strategy (used when sphere_center_mode='custom').
'bounds_center', 'custom', 'auto'.
Custom sphere radius for SPHERE strategy (used when sphere_radius_mode='custom').
'inscribed', 'circumscribed', 'custom'.
Sampling strategy to use.
- __init__(strategy=None, num_samples=1000, grid_resolution=10, batch_size=1000, seed=42, importance_weight_func=None, gaussian_mean=None, gaussian_std=None, sphere_center_mode='bounds_center', sphere_radius_mode='inscribed', sphere_boundary_handling='reject', sphere_center=None, sphere_radius=None)#
-
batch_size:
int= 1000# Number of samples to process in each batch.
-
gaussian_mean:
float|None= None# Mean for Gaussian sampling (used with GAUSSIAN strategy). If None, uses center of bounds.
-
gaussian_std:
float|None= None# Standard deviation for Gaussian sampling (used with GAUSSIAN strategy). If None, uses 1/6 of range.
-
grid_resolution:
int= 10# Resolution for grid sampling (used with UNIFORM strategy).
-
importance_weight_func:
Optional[Callable] = None# Weight function for importance sampling (used with IMPORTANCE strategy).
-
num_samples:
int= 1000# Number of samples to generate.
-
seed:
int= 42# Random seed for reproducibility.
-
sphere_boundary_handling:
str= 'reject'# ‘clip’, ‘reject’, ‘extend’.
- Type:
How to handle boundary violations for SPHERE strategy. Options
-
sphere_center:
list|None= None# Custom sphere center for SPHERE strategy (used when sphere_center_mode=’custom’).
-
sphere_center_mode:
str= 'bounds_center'# ‘bounds_center’, ‘custom’, ‘auto’.
- Type:
How to determine sphere center for SPHERE strategy. Options
-
sphere_radius:
float|None= None# Custom sphere radius for SPHERE strategy (used when sphere_radius_mode=’custom’).
-
sphere_radius_mode:
str= 'inscribed'# ‘inscribed’, ‘circumscribed’, ‘custom’.
- Type:
How to determine sphere radius for SPHERE strategy. Options
-
strategy:
SamplingStrategy= None# Sampling strategy to use.
- class embodichain.lab.sim.motion.workspace.configs.SamplingStrategy[source]#
Bases:
EnumSampling strategy for joint space.
Attributes:
- GAUSSIAN = 'gaussian'#
- HALTON = 'halton'#
- IMPORTANCE = 'importance'#
- LATIN_HYPERCUBE = 'lhs'#
- RANDOM = 'random'#
- SOBOL = 'sobol'#
- SPHERE = 'sphere'#
- UNIFORM = 'uniform'#
- class embodichain.lab.sim.motion.workspace.configs.VisualizationConfig[source]#
Bases:
objectVisualization configuration
Methods:
__init__([enabled, vis_type, voxel_size, ...])Attributes:
Transparency level of points.
Length of coordinate axes for axis visualization.
Thickness/size of coordinate axes for axis visualization.
Color points by distance.
Enable or disable visualization.
Enable voxel downsampling.
Number of neighbors for statistical outlier removal.
Size of points in visualization.
Whether to show unreachable points in Cartesian space and Plane sampling modes.
Radius of spheres for sphere visualization.
Sphere mesh resolution for sphere visualization.
Standard deviation ratio for statistical outlier removal.
Type of visualization to use.
Point size in world units for the Viser browser backend.
Voxel size for downsampling.
- __init__(enabled=True, vis_type=VisualizationType.POINT_CLOUD, voxel_size=0.05, nb_neighbors=20, std_ratio=2.0, is_voxel_down=True, color_by_distance=True, point_size=4.0, viser_point_size=0.01, alpha=0.5, sphere_radius=0.005, sphere_resolution=10, axis_length=0.05, axis_size=0.003, show_unreachable_points=True)#
-
alpha:
float= 0.5# Transparency level of points.
-
axis_length:
float= 0.05# Length of coordinate axes for axis visualization.
-
axis_size:
float= 0.003# Thickness/size of coordinate axes for axis visualization.
-
color_by_distance:
bool= True# Color points by distance.
-
enabled:
bool= True# Enable or disable visualization.
-
is_voxel_down:
bool= True# Enable voxel downsampling.
-
nb_neighbors:
int= 20# Number of neighbors for statistical outlier removal.
-
point_size:
float= 4.0# Size of points in visualization.
-
show_unreachable_points:
bool= True# Whether to show unreachable points in Cartesian space and Plane sampling modes.
If True, shows both reachable (green, large) and unreachable (red, small) points. If False, only shows reachable points in Cartesian space and Plane sampling modes. Has no effect in Joint space mode (all points are always shown as reachable).
Note: This parameter now supports all IK-based analysis modes including: - AnalysisMode.CARTESIAN_SPACE - AnalysisMode.PLANE_SAMPLING
-
sphere_radius:
float= 0.005# Radius of spheres for sphere visualization.
-
sphere_resolution:
int= 10# Sphere mesh resolution for sphere visualization.
-
std_ratio:
float= 2.0# Standard deviation ratio for statistical outlier removal.
-
vis_type:
Union[VisualizationType,str] = 'point_cloud'# Type of visualization to use. Can be VisualizationType enum or string.
Available visualization types: - POINT_CLOUD: Fast point cloud rendering, good for large datasets - VOXEL: Volumetric voxel grid representation for occupancy mapping - SPHERE: Smooth sphere rendering for publication-quality figures - AXIS: Coordinate frame visualization for poses and transformations
Examples
vis_type = VisualizationType.SPHERE vis_type = “point_cloud” vis_type = “axis” # For coordinate frames
-
viser_point_size:
float= 0.01# Point size in world units for the Viser browser backend.
-
voxel_size:
float= 0.05# Voxel size for downsampling.