curobo.util.usd_helper module

curobo.util.usd_helper.set_prim_translate(prim, translation)
curobo.util.usd_helper.set_prim_transform(prim, pose, scale=[1, 1, 1], use_float=False)
Parameters:
  • pose (List[float]) –

  • scale (List[float]) –

  • use_float (bool) –

curobo.util.usd_helper.get_prim_world_pose(cache, prim, inverse=False)
Parameters:
  • cache (XformCache) –

  • prim (Prim) –

  • inverse (bool) –

curobo.util.usd_helper.get_transform(pose)
curobo.util.usd_helper.get_position_quat(pose, use_float=True)
Parameters:

use_float (bool) –

curobo.util.usd_helper.set_geom_mesh_attrs(mesh_geom, obs, timestep=None)
Parameters:
  • mesh_geom (Mesh) –

  • obs (Mesh) –

curobo.util.usd_helper.set_geom_cube_attrs(cube_geom, dims, pose, timestep=None)
Parameters:
  • cube_geom (Cube) –

  • dims (List[float]) –

  • pose (List[float]) –

curobo.util.usd_helper.set_geom_cylinder_attrs(cube_geom, radius, height, pose, timestep=None)
Parameters:
  • cube_geom (Cylinder) –

  • pose (List[float]) –

curobo.util.usd_helper.set_geom_sphere_attrs(sphere_geom, radius, pose, timestep=None)
Parameters:
  • sphere_geom (Sphere) –

  • radius (float) –

  • pose (List[float]) –

curobo.util.usd_helper.set_cylinder_attrs(prim, radius, height, pose, color=[])
Parameters:
  • prim (Cylinder) –

  • radius (float) –

  • height (float) –

curobo.util.usd_helper.get_cylinder_attrs(prim, cache=None, transform=None)
Return type:

Cylinder

curobo.util.usd_helper.get_capsule_attrs(prim, cache=None, transform=None)
Return type:

Cylinder

curobo.util.usd_helper.get_cube_attrs(prim, cache=None, transform=None)
Return type:

Cuboid

curobo.util.usd_helper.get_sphere_attrs(prim, cache=None, transform=None)
Return type:

Sphere

curobo.util.usd_helper.get_mesh_attrs(prim, cache=None, transform=None)
Return type:

Mesh

curobo.util.usd_helper.create_stage(name='curobo_stage.usd', base_frame='/world')
Parameters:
  • name (str) –

  • base_frame (str) –

class curobo.util.usd_helper.UsdHelper(use_float=True)

Bases: object

create_stage(name='curobo_stage.usd', base_frame='/world', timesteps=None, dt=0.02, interpolation_steps=1)
Parameters:
  • name (str) –

  • base_frame (str) –

  • timesteps (int | None) –

  • interpolation_steps (float) –

add_subroot(root='/world', sub_root='/obstacles', pose=None)
Parameters:

pose (Pose | None) –

load_stage_from_file(file_path)
Parameters:

file_path (str) –

load_stage(stage)
Parameters:

stage (Stage) –

get_pose(prim_path, timecode=0.0, inverse=False)
Parameters:
  • prim_path (str) –

  • timecode (float) –

  • inverse (bool) –

Return type:

matrix

get_obstacles_from_stage(only_paths=None, ignore_paths=None, only_substring=None, ignore_substring=None, reference_prim_path=None, timecode=0)
Parameters:
  • only_paths (List[str] | None) –

  • ignore_paths (List[str] | None) –

  • only_substring (List[str] | None) –

  • ignore_substring (List[str] | None) –

  • reference_prim_path (str | None) –

  • timecode (float) –

Return type:

WorldConfig

add_world_to_stage(obstacles, base_frame='/world', obstacles_frame='obstacles', base_t_obstacle_pose=None, timestep=None)
Parameters:
  • obstacles (WorldConfig) –

  • base_frame (str) –

  • obstacles_frame (str) –

  • base_t_obstacle_pose (Pose | None) –

  • timestep (float | None) –

get_prim_from_obstacle(obstacle, base_frame='/world/obstacles', timestep=None)
Parameters:
  • obstacle (Obstacle) –

  • base_frame (str) –

add_cuboid_to_stage(obstacle, base_frame='/world/obstacles', timestep=None, enable_physics=False)
Parameters:
  • obstacle (Cuboid) –

  • base_frame (str) –

  • enable_physics (bool) –

add_cylinder_to_stage(obstacle, base_frame='/world/obstacles', timestep=None, enable_physics=False)
Parameters:
  • obstacle (Cylinder) –

  • base_frame (str) –

  • enable_physics (bool) –

add_sphere_to_stage(obstacle, base_frame='/world/obstacles', timestep=None, enable_physics=False)
Parameters:
  • obstacle (Sphere) –

  • base_frame (str) –

  • enable_physics (bool) –

add_mesh_to_stage(obstacle, base_frame='/world/obstacles', timestep=None, enable_physics=False)
Parameters:
  • obstacle (Mesh) –

  • base_frame (str) –

  • enable_physics (bool) –

get_obstacle_from_prim(prim_path)
Parameters:

prim_path (str) –

Return type:

Obstacle

write_stage_to_file(file_path, flatten=False)
Parameters:
  • file_path (str) –

  • flatten (bool) –

create_animation(robot_world_cfg, pose, base_frame='/world', robot_frame='/robot', dt=0.02)

Create animation, given meshes and pose

Parameters:
  • prim_names – _description_

  • pose (Pose) – [ timesteps, n_meshes, pose]

  • dt (float) – _description_. Defaults to 0.02.

  • robot_world_cfg (WorldConfig) –

create_obstacle_animation(obstacles, base_frame='/world', obstacles_frame='robot_base')
Parameters:
  • obstacles (List[List[Obstacle]]) –

  • base_frame (str) –

  • obstacles_frame (str) –

create_linkpose_robot_animation(robot_usd_path, link_names, joint_names, pose, robot_base_frame='/world/robot', local_asset_path='assets/', write_robot_usd_path='assets/', robot_asset_prim_path='/panda')

Create animation, given meshes and pose

Parameters:
  • prim_names – _description_

  • pose (Pose) – [ timesteps, n_meshes, pose]

  • dt – _description_. Defaults to 0.02.

  • robot_usd_path (str) –

  • link_names (List[str]) –

  • joint_names (List[str]) –

add_material(material_name, object_path, color, obj_prim, material=Material(metallic=0.0, roughness=0.4))
Parameters:
  • material_name (str) –

  • object_path (str) –

  • color (List[float]) –

  • obj_prim (Prim) –

  • material (Material) –

save()
static write_trajectory_animation(robot_model_file, world_model, q_start, q_traj, dt=0.02, save_path='out.usd', tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32), interpolation_steps=1.0, robot_base_frame='robot', base_frame='/world', kin_model=None, visualize_robot_spheres=True, robot_color=None, flatten_usd=False)
Parameters:
  • robot_model_file (str) –

  • world_model (WorldConfig) –

  • q_start (JointState) –

  • q_traj (JointState) –

  • dt (float) –

  • save_path (str) –

  • tensor_args (TensorDeviceType) –

  • interpolation_steps (float) –

  • kin_model (CudaRobotModel | None) –

  • visualize_robot_spheres (bool) –

  • robot_color (List[float] | None) –

  • flatten_usd (bool) –

static load_robot(robot_model_file, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))
Parameters:
Return type:

CudaRobotModel

static write_trajectory_animation_with_robot_usd(robot_model_file, world_model, q_start, q_traj, dt=0.02, save_path='out.usd', tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32), interpolation_steps=1.0, write_robot_usd_path='assets/', robot_base_frame='robot', robot_usd_local_reference='assets/', base_frame='/world', kin_model=None, visualize_robot_spheres=True, robot_asset_prim_path=None, robot_color=None, flatten_usd=False)
Parameters:
  • robot_model_file (str) –

  • world_model (WorldConfig | None) –

  • q_start (JointState) –

  • q_traj (JointState) –

  • dt (float) –

  • save_path (str) –

  • tensor_args (TensorDeviceType) –

  • interpolation_steps (float) –

  • write_robot_usd_path (str) –

  • robot_base_frame (str) –

  • robot_usd_local_reference (str) –

  • kin_model (CudaRobotModel | None) –

  • visualize_robot_spheres (bool) –

  • robot_color (List[float] | None) –

  • flatten_usd (bool) –

static create_grid_usd(usds_path, save_path, base_frame, max_envs, max_timecode, x_space, y_space, x_per_row, local_asset_path, dt=0.02, interpolation_steps=1, prefix_string=None, flatten_usd=False)
Parameters:
  • usds_path (str | List[str]) –

  • save_path (str) –

  • base_frame (str) –

  • max_envs (int) –

  • max_timecode (float) –

  • x_space (float) –

  • y_space (float) –

  • x_per_row (int) –

  • local_asset_path (str) –

  • dt (float) –

  • interpolation_steps (int) –

  • prefix_string (str | None) –

  • flatten_usd (bool) –

load_robot_usd(robot_usd_path, link_names, joint_names, robot_base_frame='/world/robot', write_asset_path='assets/', local_asset_path='assets/', robot_asset_prim_path='/panda')
Parameters:
  • robot_usd_path (str) –

  • link_names (List[str]) –

  • joint_names (List[str]) –

get_robot_prims(link_names, joint_names, robot_base_path='/world/robot')
Parameters:
  • link_names (List[str]) –

  • joint_names (List[str]) –

  • robot_base_path (str) –

update_robot_joint_state(joint_prims, js, timestep)
Parameters:
  • joint_prims (List[Prim]) –

  • js (JointState) –

  • timestep (int) –

static write_motion_gen_log(result, robot_file, world_config, start_state, goal_pose, save_prefix='log', write_ik=False, write_trajopt=False, write_graph=False, goal_object=None, overlay_ik=False, overlay_trajopt=False, visualize_robot_spheres=True, link_spheres=None, grid_space=1.0, write_robot_usd_path='assets/', robot_asset_prim_path='/panda', fps=24, link_poses=None, flatten_usd=False)
Parameters:
  • result (MotionGenResult) –

  • robot_file (str | RobotConfig) –

  • world_config (None | WorldConfig) –

  • start_state (JointState) –

  • goal_pose (Pose) –

  • save_prefix (str) –

  • write_ik (bool) –

  • write_trajopt (bool) –

  • write_graph (bool) –

  • goal_object (Obstacle | None) –

  • overlay_ik (bool) –

  • overlay_trajopt (bool) –

  • visualize_robot_spheres (bool) –

  • link_spheres (Tensor | None) –

  • grid_space (float) –

  • fps (int) –

  • link_poses (Dict[str, Pose] | None) –

  • flatten_usd (bool) –