curobo.geom.sdf.world_mesh module

class curobo.geom.sdf.world_mesh.WarpMeshData(name: str, m_id: int, vertices: warp.types.array, faces: warp.types.array, mesh: warp.types.Mesh)

Bases: object

Parameters:
  • name (str) –

  • m_id (int) –

  • vertices (array) –

  • faces (array) –

  • mesh (Mesh) –

name: str
m_id: int
vertices: array
faces: array
mesh: Mesh
class curobo.geom.sdf.world_mesh.WorldMeshCollision(config)

Bases: WorldPrimitiveCollision

World Mesh Collision using Nvidia’s warp library

This currently requires passing int64 array from torch to warp which is only available when compiled from source.

Parameters:

config (WorldCollisionConfig) –

_init_cache()
load_collision_model(world_model, env_idx=0, load_obb_obs=True, fix_cache_reference=False)
Parameters:
  • world_model (WorldConfig) –

  • env_idx (int) –

  • load_obb_obs (bool) –

  • fix_cache_reference (bool) –

load_batch_collision_model(world_config_list)

Load a batch of collision environments from a list of world configs.

Parameters:

world_config_list (List[WorldConfig]) – list of world configs to load from.

_load_mesh_to_warp(mesh)
Parameters:

mesh (Mesh) –

_load_mesh_into_cache(mesh)
Parameters:

mesh (Mesh) –

Return type:

WarpMeshData

_load_batch_mesh_to_warp(mesh_list)
Parameters:

mesh_list (List[Mesh]) –

add_mesh(new_mesh, env_idx=0)
Parameters:
  • new_mesh (Mesh) –

  • env_idx (int) –

get_mesh_idx(name, env_idx=0)
Parameters:
  • name (str) –

  • env_idx (int) –

Return type:

int

create_collision_cache(mesh_cache=None, obb_cache=None, n_envs=None)
_create_mesh_cache(mesh_cache)
update_mesh_pose(w_obj_pose=None, obj_w_pose=None, name=None, env_obj_idx=None, env_idx=0)
Parameters:
  • w_obj_pose (Pose | None) –

  • obj_w_pose (Pose | None) –

  • name (str | None) –

  • env_obj_idx (Tensor | None) –

  • env_idx (int) –

update_all_mesh_pose(w_obj_pose=None, obj_w_pose=None, name=None, env_obj_idx=None, env_idx=0)

Update poses for a list of meshes in the same environment

Parameters:
  • w_obj_pose (Optional[Pose], optional) – _description_. Defaults to None.

  • obj_w_pose (Optional[Pose], optional) – _description_. Defaults to None.

  • name (Optional[List[str]], optional) – _description_. Defaults to None.

  • env_obj_idx (Optional[torch.Tensor], optional) – _description_. Defaults to None.

  • env_idx (int, optional) – _description_. Defaults to 0.

update_mesh_pose_env(w_obj_pose=None, obj_w_pose=None, name=None, env_obj_idx=None, env_idx=[0])

Update pose of a single object in a list of environments

Parameters:
  • w_obj_pose (Optional[Pose], optional) – _description_. Defaults to None.

  • obj_w_pose (Optional[Pose], optional) – _description_. Defaults to None.

  • name (Optional[List[str]], optional) – _description_. Defaults to None.

  • env_obj_idx (Optional[torch.Tensor], optional) – _description_. Defaults to None.

  • env_idx (List[int], optional) – _description_. Defaults to [0].

update_mesh_from_warp(warp_mesh_idx, w_obj_pose=None, obj_w_pose=None, obj_idx=0, env_idx=0, name=None)
Parameters:
  • warp_mesh_idx (int) –

  • w_obj_pose (Pose | None) –

  • obj_w_pose (Pose | None) –

  • obj_idx (int) –

  • env_idx (int) –

  • name (str | None) –

update_obstacle_pose(name, w_obj_pose, env_idx=0)
Parameters:
  • name (str) –

  • w_obj_pose (Pose) –

  • env_idx (int) –

enable_obstacle(name, enable=True, env_idx=0)
Parameters:
  • name (str) –

  • enable (bool) –

  • env_idx (int) –

enable_mesh(enable=True, name=None, env_mesh_idx=None, env_idx=0)

Update obstacle dimensions

Parameters:
  • obj_dims (torch.Tensor) – [dim.x,dim.y, dim.z], give as [b,3]

  • obj_idx (torch.Tensor or int) –

  • enable (bool) –

  • name (str | None) –

  • env_mesh_idx (Tensor | None) –

  • env_idx (int) –

_get_sdf(query_spheres, collision_query_buffer, weight, activation_distance, env_query_idx=None, return_loss=False)
Parameters:
  • collision_query_buffer (CollisionQueryBuffer) –

  • weight (Tensor) –

  • activation_distance (Tensor) –

_get_swept_sdf(query_spheres, collision_query_buffer, weight, activation_distance, speed_dt, sweep_steps, enable_speed_metric=False, env_query_idx=None, return_loss=False)
Parameters:
  • collision_query_buffer (CollisionQueryBuffer) –

  • weight (Tensor) –

  • activation_distance (Tensor) –

  • speed_dt (Tensor) –

  • sweep_steps (int) –

  • return_loss (bool) –

get_sphere_distance(query_sphere, collision_query_buffer, weight, activation_distance, env_query_idx=None, return_loss=False)

Computes the signed distance via analytic function Args: tensor_sphere: b, n, 4

Parameters:
  • query_sphere (Tensor) –

  • collision_query_buffer (CollisionQueryBuffer) –

  • weight (Tensor) –

  • activation_distance (Tensor) –

  • env_query_idx (Tensor | None) –

  • return_loss (bool) –

get_sphere_collision(query_sphere, collision_query_buffer, weight, activation_distance, env_query_idx=None, return_loss=False)

Computes the signed distance via analytic function Args: tensor_sphere: b, n, 4 we assume we don’t need gradient for this function. If you need gradient, use get_sphere_distance

Parameters:
  • collision_query_buffer (CollisionQueryBuffer) –

  • weight (Tensor) –

  • activation_distance (Tensor) –

get_swept_sphere_distance(query_sphere, collision_query_buffer, weight, activation_distance, speed_dt, sweep_steps, enable_speed_metric=False, env_query_idx=None, return_loss=False)

Computes the signed distance via analytic function Args: tensor_sphere: b, n, 4

Parameters:
  • collision_query_buffer (CollisionQueryBuffer) –

  • weight (Tensor) –

  • activation_distance (Tensor) –

  • speed_dt (Tensor) –

  • sweep_steps (int) –

  • env_query_idx (Tensor | None) –

  • return_loss (bool) –

get_swept_sphere_collision(query_sphere, collision_query_buffer, weight, sweep_steps, activation_distance, speed_dt, enable_speed_metric=False, env_query_idx=None, return_loss=False)

Computes the signed distance via analytic function Args: tensor_sphere: b, n, 4

Parameters:
  • collision_query_buffer (CollisionQueryBuffer) –

  • weight (Tensor) –

  • activation_distance (Tensor) –

  • speed_dt (Tensor) –

  • env_query_idx (Tensor | None) –

  • return_loss (bool) –

clear_cache()