curobo.geom.types module
- 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.
- tensor_args: TensorDeviceType
- get_trimesh_mesh( ) 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:
- get_cuboid() Cuboid
Get oriented bounding box of obstacle (OBB).
- Returns:
returns obstacle as a cuboid.
- Return type:
- get_transform_matrix() ndarray
Get homogenous transformation matrix from pose.
- Returns:
transformation matrix.
- Return type:
np.ndarray
- get_sphere(
- n: int = 1,
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),
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.
- get_trimesh_mesh( )
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:
- 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),
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:
- get_sphere(
- n: int = 1,
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
- 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
- get_trimesh_mesh( )
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:
- 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),
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:
- get_sphere(
- n: int = 1,
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
- 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
- get_trimesh_mesh( )
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:
- 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),
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:
- get_sphere(
- n: int = 1,
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
- 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
- get_trimesh_mesh( )
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:
- get_cuboid() Cuboid
Get oriented bounding box of obstacle (OBB).
- Returns:
returns obstacle as a cuboid.
- Return type:
- 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),
Compute n spheres that fits in the volume of the object.
- Parameters:
n – number of spheres
- Returns:
spheres
- get_sphere(
- n: int = 1,
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
- 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
- get_trimesh_mesh( )
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:
- update_material()
- 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,
- 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),
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:
- get_sphere(
- n: int = 1,
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
- 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
- integrator_type: str = 'tsdf'
[“tsdf”, “occupancy”]
- Type:
integrator type to use in nvblox. Options
- get_trimesh_mesh( )
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:
- 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),
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:
- get_sphere(
- n: int = 1,
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
- 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
- get_trimesh_mesh( )
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:
- 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),
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:
- get_sphere(
- n: int = 1,
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
- 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
- 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),
- clone()
- 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),
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:
- get_sphere(
- n: int = 1,
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( ) 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:
- 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.
- clone()
- static from_dict( ) 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_cache_dict() Dict[str, int]
Computes the number of obstacles in each type
- Returns:
_description_
- 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),
- remove_absolute_paths() WorldConfig
- _abc_impl = <_abc._abc_data object>
- _is_protocol = False
- count(
- value,
- index(
- value[,
- start[,
- stop,]]
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_