curobo.geom.types module

class Material(
metallic: 'float' = 0.0,
roughness: 'float' = 0.4,
)

Bases: object

metallic: float = 0.0
roughness: float = 0.4
class Obstacle(
name: str,
pose: ~typing.List[float] | None = None,
scale: ~typing.List[float] | None = None,
color: ~typing.List[float] | None = None,
texture_id: str | None = None,
texture: str | None = None,
material: ~curobo.geom.types.Material = <factory>,
tensor_args: ~curobo.types.base.TensorDeviceType = <factory>,
)

Bases: object

Base class for all obstacles.

name: str

Unique name of obstacle.

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

scale: List[float] | None = None

implement scaling for all obstacle types.

Type:

NOTE

color: List[float] | None = None

Color of obstacle to use in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

texture: str | None = None

texture to apply to obstacle in visualization.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
) Trimesh

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

class Cuboid(
name: str,
pose: ~typing.List[float] | None = None,
scale: ~typing.List[float] | None = None,
color: ~typing.List[float] | None = None,
texture_id: str | None = None,
texture: str | None = None,
material: ~curobo.geom.types.Material = <factory>,
tensor_args: ~curobo.types.base.TensorDeviceType = <factory>,
dims: ~typing.List[float] = <factory>,
)

Bases: Obstacle

Represent obstacle as a cuboid.

dims: List[float]

Dimensions of cuboid in meters [x_length, y_length, z_length].

get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
)

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

color: List[float] | None = None

Color of obstacle to use in visualization.

get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
scale: List[float] | None = None

implement scaling for all obstacle types.

Type:

NOTE

texture: str | None = None

texture to apply to obstacle in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

name: str

Unique name of obstacle.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
class Capsule(
name: 'str',
pose: 'Optional[List[float]]' = None,
scale: 'Optional[List[float]]' = None,
color: 'Optional[List[float]]' = None,
texture_id: 'Optional[str]' = None,
texture: 'Optional[str]' = None,
material: 'Material' = <factory>,
tensor_args: 'TensorDeviceType' = <factory>,
radius: 'float' = 0.0,
base: 'List[float]' = <factory>,
tip: 'List[float]' = <factory>,
)

Bases: Obstacle

radius: float = 0.0
base: List[float]
tip: List[float]
get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
)

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

color: List[float] | None = None

Color of obstacle to use in visualization.

get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
scale: List[float] | None = None

implement scaling for all obstacle types.

Type:

NOTE

texture: str | None = None

texture to apply to obstacle in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

name: str

Unique name of obstacle.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
class Cylinder(
name: 'str',
pose: 'Optional[List[float]]' = None,
scale: 'Optional[List[float]]' = None,
color: 'Optional[List[float]]' = None,
texture_id: 'Optional[str]' = None,
texture: 'Optional[str]' = None,
material: 'Material' = <factory>,
tensor_args: 'TensorDeviceType' = <factory>,
radius: 'float' = 0.0,
height: 'float' = 0.0,
)

Bases: Obstacle

radius: float = 0.0
height: float = 0.0
get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
)

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

color: List[float] | None = None

Color of obstacle to use in visualization.

get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
scale: List[float] | None = None

implement scaling for all obstacle types.

Type:

NOTE

texture: str | None = None

texture to apply to obstacle in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

name: str

Unique name of obstacle.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
class Sphere(
name: 'str',
pose: 'Optional[List[float]]' = None,
scale: 'Optional[List[float]]' = None,
color: 'Optional[List[float]]' = None,
texture_id: 'Optional[str]' = None,
texture: 'Optional[str]' = None,
material: 'Material' = <factory>,
tensor_args: 'TensorDeviceType' = <factory>,
radius: 'float' = 0.0,
position: 'Optional[List[float]]' = None,
)

Bases: Obstacle

radius: float = 0.0
position: List[float] | None = None

position is deprecated, use pose instead

get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
)

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

color: List[float] | None = None

Color of obstacle to use in visualization.

get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
scale: List[float] | None = None

implement scaling for all obstacle types.

Type:

NOTE

texture: str | None = None

texture to apply to obstacle in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

name: str

Unique name of obstacle.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
class Mesh(
name: 'str',
pose: 'Optional[List[float]]' = None,
scale: 'Optional[List[float]]' = None,
color: 'Optional[List[float]]' = None,
texture_id: 'Optional[str]' = None,
texture: 'Optional[str]' = None,
material: 'Material' = <factory>,
tensor_args: 'TensorDeviceType' = <factory>,
file_path: 'Optional[str]' = None,
file_string: 'Optional[str]' = None,
urdf_path: 'Optional[str]' = None,
vertices: 'Optional[List[List[float]]]' = None,
faces: 'Optional[List[int]]' = None,
vertex_colors: 'Optional[List[List[float]]]' = None,
vertex_normals: 'Optional[List[List[float]]]' = None,
face_colors: 'Optional[List[List[float]]]' = None,
)

Bases: Obstacle

file_path: str | None = None
file_string: str | None = None
urdf_path: str | None = None
vertices: List[List[float]] | None = None
faces: List[int] | None = None
vertex_colors: List[List[float]] | None = None
vertex_normals: List[List[float]] | None = None
face_colors: List[List[float]] | None = None
get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
)

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

update_material()
get_mesh_data(process: bool = True)
static from_pointcloud(
pointcloud: ndarray,
pitch: float = 0.02,
name='world_pc',
pose: List[float] = [0, 0, 0, 1, 0, 0, 0],
filter_close_points: float = 0.0,
)
color: List[float] | None = None

Color of obstacle to use in visualization.

get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
scale: List[float] | None = None

implement scaling for all obstacle types.

Type:

NOTE

texture: str | None = None

texture to apply to obstacle in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

name: str

Unique name of obstacle.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
class BloxMap(
name: 'str',
pose: 'Optional[List[float]]' = None,
scale: 'List[float]' = <factory>,
color: 'Optional[List[float]]' = None,
texture_id: 'Optional[str]' = None,
texture: 'Optional[str]' = None,
material: 'Material' = <factory>,
tensor_args: 'TensorDeviceType' = <factory>,
map_path: 'Optional[str]' = None,
voxel_size: 'float' = 0.02,
integrator_type: 'str' = 'tsdf',
mesh_file_path: 'Optional[str]' = None,
mapper_instance: 'Any' = None,
mesh: 'Optional[Mesh]' = None,
)

Bases: Obstacle

map_path: str | None = None
scale: List[float] = None

implement scaling for all obstacle types.

Type:

NOTE

voxel_size: float = 0.02
integrator_type: str = 'tsdf'

[“tsdf”, “occupancy”]

Type:

integrator type to use in nvblox. Options

mesh_file_path: str | None = None
mapper_instance: Any = None
mesh: Mesh | None = None
get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
)

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

color: List[float] | None = None

Color of obstacle to use in visualization.

get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
texture: str | None = None

texture to apply to obstacle in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

name: str

Unique name of obstacle.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
class PointCloud(name: 'str', pose: 'Optional[List[float]]' = None, scale: 'Optional[List[float]]' = None, color: 'Optional[List[float]]' = None, texture_id: 'Optional[str]' = None, texture: 'Optional[str]' = None, material: 'Material' = <factory>, tensor_args: 'TensorDeviceType' = <factory>, points: 'Union[torch.Tensor, np.ndarray, List[List[float]]]' = None, points_features: 'Union[torch.Tensor, np.ndarray, List[List[float]], None]' = None)

Bases: Obstacle

points: Tensor | ndarray | List[List[float]] = None
points_features: Tensor | ndarray | List[List[float]] | None = None
get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
)

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

get_mesh_data(
process: bool = True,
)
static from_camera_observation(
camera_obs: CameraObservation,
name: str = 'pc_obstacle',
pose: List[float] | None = None,
)
get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

color: List[float] | None = None

Color of obstacle to use in visualization.

get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
scale: List[float] | None = None

implement scaling for all obstacle types.

Type:

NOTE

texture: str | None = None

texture to apply to obstacle in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

name: str

Unique name of obstacle.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
class VoxelGrid(
name: 'str',
pose: 'Optional[List[float]]' = None,
scale: 'Optional[List[float]]' = None,
color: 'Optional[List[float]]' = None,
texture_id: 'Optional[str]' = None,
texture: 'Optional[str]' = None,
material: 'Material' = <factory>,
tensor_args: 'TensorDeviceType' = <factory>,
dims: 'List[float]' = <factory>,
voxel_size: 'float' = 0.02,
feature_tensor: 'Optional[torch.Tensor]' = None,
xyzr_tensor: 'Optional[torch.Tensor]' = None,
feature_dtype: 'torch.dtype' = torch.float32,
)

Bases: Obstacle

dims: List[float]
voxel_size: float = 0.02
feature_tensor: Tensor | None = None
xyzr_tensor: Tensor | None = None
feature_dtype: dtype = torch.float32
get_grid_shape()
create_xyzr_tensor(
transform_to_origin: bool = False,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
)
get_occupied_voxels(
feature_threshold: float | None = None,
)
clone()
color: List[float] | None = None

Color of obstacle to use in visualization.

get_bounding_spheres(
n_spheres: int = 1,
surface_sphere_radius: float = 0.002,
fit_type: SphereFitType = SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE,
voxelize_method: str = 'ray',
pre_transform_pose: Pose | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
) List[Sphere]

Compute n spheres that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_cuboid() Cuboid

Get oriented bounding box of obstacle (OBB).

Returns:

returns obstacle as a cuboid.

Return type:

Cuboid

get_mesh(
process: bool = True,
) Mesh

Get obstacle as a mesh.

Parameters:

process (bool, optional) – process mesh from file. Defaults to True.

Returns:

obstacle as a mesh.

Return type:

Mesh

get_sphere(
n: int = 1,
) Sphere

Compute a sphere that fits in the volume of the object.

Parameters:

n – number of spheres

Returns:

spheres

get_transform_matrix() ndarray

Get homogenous transformation matrix from pose.

Returns:

transformation matrix.

Return type:

np.ndarray

get_trimesh_mesh(
process: bool = True,
process_color: bool = True,
) Trimesh

Create a trimesh instance from the obstacle representation.

Parameters:

process (bool, optional) – process when loading from file. Defaults to True.

Raises:

NotImplementedError – requires implementation in derived class.

Returns:

instance of obstacle as a trimesh.

Return type:

trimesh.Trimesh

pose: List[float] | None = None

Pose of obstacle as a list with format [x y z qw qx qy qz]

save_as_mesh(
file_path: str,
transform_with_pose: bool = False,
)
scale: List[float] | None = None

implement scaling for all obstacle types.

Type:

NOTE

texture: str | None = None

texture to apply to obstacle in visualization.

texture_id: str | None = None

texture to apply to obstacle in visualization.

name: str

Unique name of obstacle.

material: Material

material properties to apply in visualization.

tensor_args: TensorDeviceType
class WorldConfig(
sphere: List[Sphere] | None = None,
cuboid: List[Cuboid] | None = None,
capsule: List[Capsule] | None = None,
cylinder: List[Cylinder] | None = None,
mesh: List[Mesh] | None = None,
blox: List[BloxMap] | None = None,
voxel: List[VoxelGrid] | None = None,
objects: List[Obstacle] | None = None,
)

Bases: Sequence

Representation of World for use in CuRobo.

sphere: List[Sphere] | None = None

List of Sphere obstacles.

cuboid: List[Cuboid] | None = None

List of Cuboid obstacles.

capsule: List[Capsule] | None = None

List of Capsule obstacles.

cylinder: List[Cylinder] | None = None

List of Cylinder obstacles.

mesh: List[Mesh] | None = None

List of Mesh obstacles.

blox: List[BloxMap] | None = None

BloxMap obstacle.

voxel: List[VoxelGrid] | None = None
objects: List[Obstacle] | None = None

List of all obstacles in world.

clone()
static from_dict(
data_dict: Dict[str, Any],
) WorldConfig
static create_obb_world(
current_world: WorldConfig,
)
static create_mesh_world(
current_world: WorldConfig,
process: bool = False,
)
static create_collision_support_world(
current_world: WorldConfig,
process: bool = True,
)
static get_scene_graph(
current_world: WorldConfig,
process_color: bool = True,
)
static create_merged_mesh_world(
current_world: WorldConfig,
process: bool = True,
process_color: bool = True,
)
get_obb_world()
get_mesh_world(
merge_meshes: bool = False,
process: bool = False,
)
get_collision_check_world(
mesh_process: bool = False,
)
save_world_as_mesh(
file_path: str,
save_as_scene_graph=False,
process_color: bool = True,
)
get_cache_dict() Dict[str, int]

Computes the number of obstacles in each type

Returns:

_description_

add_obstacle(
obstacle: Obstacle,
)
randomize_color(
r=[0, 1],
g=[0, 1],
b=[0, 1],
)

Randomize color of objects within the given range

Parameters:
  • r – _description_. Defaults to [0,1].

  • g – _description_. Defaults to [0,1].

  • b – _description_. Defaults to [0,1].

Returns:

_description_

add_color(
rgba=[0.0, 0.0, 0.0, 1.0],
)
add_material(
material=Material(metallic=0.0, roughness=0.4),
)
get_obstacle(
name: str,
) None | Obstacle
remove_obstacle(name: str)
remove_absolute_paths() WorldConfig
_abc_impl = <_abc._abc_data object>
_is_protocol = False
count(
value,
) integer -- return number of occurrences of value
index(
value[,
start[,
stop,]]
) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

tensor_sphere(
pt,
radius,
tensor=None,
tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
)
tensor_capsule(
base,
tip,
radius,
tensor=None,
tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
)
tensor_cube(
pose,
dims,
tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
)
Parameters:
  • pose (_type_) – x,y,z, qw,qx,qy,qz

  • dims (_type_) – _description_

  • tensor_args (_type_, optional) – _description_. Defaults to TensorDeviceType().

Returns:

_description_

Return type:

_type_

batch_tensor_cube(
pose,
dims,
tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
)
Parameters:
  • pose (_type_) – x,y,z, qw,qx,qy,qz

  • dims (_type_) – _description_

  • tensor_args (_type_, optional) – _description_. Defaults to TensorDeviceType().

Returns:

_description_

Return type:

_type_