curobo.geom.sdf.world_blox module

class curobo.geom.sdf.world_blox.WorldBloxCollision(config)

Bases: WorldMeshCollision

World Collision Representaiton using Nvidia’s nvblox library.

This class depends on pytorch wrapper for nvblox. Additionally, this representation does not support batched environments as we only store one world via nvblox.

There are two ways to use nvblox, one is by loading maps from disk and the other is by creating maps online. In both these instances, we might load more than one map and need to check collisions against all maps.

To facilitate online map creation and updation, we build apis in this class that provide.

Parameters:

config (WorldCollisionConfig) –

load_collision_model(world_model, fix_cache_reference=False)
Parameters:
  • world_model (WorldConfig) –

  • fix_cache_reference (bool) –

clear_cache()
clear_blox_layer(layer_name)
Parameters:

layer_name (str) –

_get_blox_sdf(query_spheres, collision_query_buffer, weight, activation_distance)
Parameters:

collision_query_buffer (CollisionQueryBuffer) –

_get_blox_swept_sdf(query_spheres, collision_query_buffer, weight, activation_distance, speed_dt, sweep_steps, enable_speed_metric, return_loss=False)
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) –

  • return_loss (bool) –

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) –

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

  • enable (bool) –

  • env_idx (int) –

enable_blox(enable=True, name=None)
Parameters:
  • enable (bool) –

  • name (str | None) –

update_blox_pose(w_obj_pose=None, obj_w_pose=None, name=None)
Parameters:
  • w_obj_pose (Pose | None) –

  • obj_w_pose (Pose | None) –

  • name (str | None) –

clear_bounding_box(cuboid, layer_name=None)
Parameters:
  • cuboid (Cuboid) –

  • layer_name (str | None) –

get_bounding_spheres(bounding_box, obstacle_name=None, n_spheres=1, surface_sphere_radius=0.002, fit_type=SphereFitType.VOXEL_VOLUME_SAMPLE_SURFACE, voxelize_method='ray', pre_transform_pose=None, clear_region=False)
Parameters:
  • bounding_box (Cuboid) –

  • obstacle_name (str | None) –

  • n_spheres (int) –

  • surface_sphere_radius (float) –

  • fit_type (SphereFitType) –

  • voxelize_method (str) –

  • pre_transform_pose (Pose | None) –

  • clear_region (bool) –

Return type:

List[Sphere]

add_camera_frame(camera_observation, layer_name)
Parameters:
process_camera_frames(layer_name=None, process_aux=False)
Parameters:
  • layer_name (str | None) –

  • process_aux (bool) –

update_blox_hashes()
update_blox_esdf(layer_name=None)
Parameters:

layer_name (str | None) –

update_blox_mesh(layer_name=None)
Parameters:

layer_name (str | None) –

get_mesh_from_blox_layer(layer_name, mode='nvblox')
Parameters:
  • layer_name (str) –

  • mode (str) –

Return type:

Mesh

save_layer(layer_name, file_name)
Parameters:
  • layer_name (str) –

  • file_name (str) –

Return type:

bool

decay_layer(layer_name)
Parameters:

layer_name (str) –