curobo.util.usd_helper module¶
- set_prim_translate(prim, translation)¶
- set_prim_transform( )¶
- get_transform(pose)¶
- class UsdHelper(use_float=True)¶
Bases:
object
- create_stage(
- name: str = 'curobo_stage.usd',
- base_frame: str = '/world',
- timesteps: int | None = None,
- dt=0.02,
- interpolation_steps: float = 1,
- load_stage(
- stage: Stage,
- get_obstacles_from_stage(
- only_paths: List[str] | None = None,
- ignore_paths: List[str] | None = None,
- only_substring: List[str] | None = None,
- ignore_substring: List[str] | None = None,
- reference_prim_path: str | None = None,
- timecode: float = 0,
- add_world_to_stage(
- obstacles: WorldConfig,
- base_frame: str = '/world',
- obstacles_frame: str = 'obstacles',
- base_t_obstacle_pose: Pose | None = None,
- timestep: float | None = None,
- add_cuboid_to_stage(
- obstacle: Cuboid,
- base_frame: str = '/world/obstacles',
- timestep=None,
- enable_physics: bool = False,
- add_cylinder_to_stage(
- obstacle: Cylinder,
- base_frame: str = '/world/obstacles',
- timestep=None,
- enable_physics: bool = False,
- add_sphere_to_stage(
- obstacle: Sphere,
- base_frame: str = '/world/obstacles',
- timestep=None,
- enable_physics: bool = False,
- add_mesh_to_stage( )¶
- create_animation(
- robot_world_cfg: WorldConfig,
- pose: Pose,
- base_frame='/world',
- robot_frame='/robot',
- dt: float = 0.02,
Create animation, given meshes and pose
- Parameters:
prim_names – _description_
pose – [ timesteps, n_meshes, pose]
dt – _description_. Defaults to 0.02.
- create_obstacle_animation( )¶
- create_linkpose_robot_animation(
- robot_usd_path: str,
- link_names: List[str],
- joint_names: List[str],
- pose: 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 – [ timesteps, n_meshes, pose]
dt – _description_. Defaults to 0.02.
- add_material(
- material_name: str,
- object_path: str,
- color: List[float],
- obj_prim: Prim,
- material: Material = Material(metallic=0.0, roughness=0.4),
- save()¶
- static write_trajectory_animation(
- robot_model_file: str,
- world_model: WorldConfig,
- q_start: JointState,
- q_traj: JointState,
- dt: float = 0.02,
- save_path: str = 'out.usd',
- 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),
- interpolation_steps: float = 1.0,
- robot_base_frame='robot',
- base_frame='/world',
- kin_model: CudaRobotModel | None = None,
- visualize_robot_spheres: bool = True,
- robot_color: List[float] | None = None,
- flatten_usd: bool = False,
- goal_pose: Pose | None = None,
- goal_color: List[float] | None = None,
- static load_robot(
- robot_model_file: str,
- 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),
- static write_trajectory_animation_with_robot_usd(
- robot_model_file: str,
- world_model: WorldConfig | None,
- q_start: JointState,
- q_traj: JointState,
- dt: float = 0.02,
- save_path: str = 'out.usd',
- 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),
- interpolation_steps: float = 1.0,
- write_robot_usd_path: str = 'assets/',
- robot_base_frame: str = 'robot',
- robot_usd_local_reference: str = 'assets/',
- base_frame='/world',
- kin_model: CudaRobotModel | None = None,
- visualize_robot_spheres: bool = True,
- robot_asset_prim_path=None,
- robot_color: List[float] | None = None,
- flatten_usd: bool = False,
- goal_pose: Pose | None = None,
- goal_color: List[float] | None = None,
- static create_grid_usd(
- 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 = 0.02,
- interpolation_steps: int = 1,
- prefix_string: str | None = None,
- flatten_usd: bool = False,
- load_robot_usd(
- robot_usd_path: str,
- link_names: List[str],
- joint_names: List[str],
- robot_base_frame='/world/robot',
- write_asset_path='assets/',
- local_asset_path='assets/',
- robot_asset_prim_path='/panda',
- get_robot_prims( )¶
- update_robot_joint_state(
- joint_prims: List[Prim],
- js: JointState,
- timestep: int,
- static write_motion_gen_log(
- result: MotionGenResult,
- robot_file: str | RobotConfig,
- world_config: None | WorldConfig,
- start_state: JointState,
- goal_pose: Pose,
- save_prefix: str = 'log',
- write_ik: bool = False,
- write_trajopt: bool = False,
- write_graph: bool = False,
- goal_object: Obstacle | None = None,
- overlay_ik: bool = False,
- overlay_trajopt: bool = False,
- visualize_robot_spheres: bool = True,
- link_spheres: Tensor | None = None,
- grid_space: float = 1.0,
- write_robot_usd_path='assets/',
- robot_asset_prim_path='/panda',
- fps: int = 24,
- link_poses: Dict[str, Pose] | None = None,
- flatten_usd: bool = False,