curobo.wrap.model.curobo_robot_world module¶
This module has differentiable layers built from CuRobo’s core features for use in Pytorch.
- class CuroboRobotWorldConfig(
- kinematics: curobo.cuda_robot_model.cuda_robot_model.CudaRobotModel,
- sampler: curobo.util.sample_lib.HaltonGenerator,
- bound_scale: torch.Tensor,
- bound_cost: curobo.rollout.cost.bound_cost.BoundCost,
- pose_cost: curobo.rollout.cost.pose_cost.PoseCost,
- self_collision_cost: curobo.rollout.cost.self_collision_cost.SelfCollisionCost | None = None,
- collision_cost: curobo.rollout.cost.primitive_collision_cost.PrimitiveCollisionCost | None = None,
- collision_constraint: curobo.rollout.cost.primitive_collision_cost.PrimitiveCollisionCost | None = None,
- world_model: curobo.geom.sdf.world.WorldCollision | None = None,
- rejection_ratio: int = 10,
- tensor_args: curobo.types.base.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),
- contact_distance: float = 0.0,
Bases:
RobotWorldConfig
- collision_constraint: PrimitiveCollisionCost | None = None¶
- collision_cost: PrimitiveCollisionCost | None = None¶
- static load_from_config(
- robot_config: RobotConfig | str = 'franka.yml',
- world_model: None | str | Dict | WorldConfig | List[WorldConfig] | List[str] = 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),
- n_envs: int = 1,
- n_meshes: int = 50,
- n_cuboids: int = 50,
- collision_activation_distance: float = 0.2,
- self_collision_activation_distance: float = 0.0,
- max_collision_distance: float = 1.0,
- collision_checker_type: CollisionCheckerType = CollisionCheckerType.MESH,
- world_collision_checker: WorldCollision | None = None,
- pose_weight: List[float] = [1, 1, 1, 1],
- self_collision_cost: SelfCollisionCost | 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)¶
- world_model: WorldCollision | None = None¶
- kinematics: CudaRobotModel¶
- sampler: HaltonGenerator¶
- bound_scale: torch.Tensor¶
- class CuroboRobotWorld(
- config: CuroboRobotWorldConfig,
Bases:
RobotWorld
- clear_world_cache()¶
- collision_constraint: PrimitiveCollisionCost | None = None¶
- collision_cost: PrimitiveCollisionCost | None = None¶
- get_active_js(
- full_js: JointState,
- get_collision_constraint( ) Tensor ¶
Get collision distance
- Parameters:
x_sph (torch.Tensor) – batch, horizon, n_spheres, 4
- Returns:
_description_
- Return type:
- get_collision_distance( ) Tensor ¶
Get collision distance
- Parameters:
x_sph (torch.Tensor) – batch, horizon, n_spheres, 4
- Returns:
_description_
- Return type:
- get_collision_vector( )¶
NOTE: This function is not differentiable
- get_kinematics(
- q: Tensor,
- get_point_robot_distance( )¶
Compute distance from the robot at q joint configuration to points (e.g., pointcloud)
- Parameters:
points – [b,n,3]
q – [1, dof]
- Returns:
[b,1] Positive is in collision with robot
- Return type:
distance
NOTE: This currently does not support batched robot but can be done easily.
- get_world_self_collision_distance_from_joint_trajectory( ) Tuple[Tensor, Tensor] ¶
q : batch, horizon, dof
- static load_from_config(
- robot_config: RobotConfig | str = 'franka.yml',
- world_model: None | str | Dict | WorldConfig | List[WorldConfig] | List[str] = 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),
- n_envs: int = 1,
- n_meshes: int = 50,
- n_cuboids: int = 50,
- collision_activation_distance: float = 0.2,
- self_collision_activation_distance: float = 0.0,
- max_collision_distance: float = 1.0,
- collision_checker_type: CollisionCheckerType = CollisionCheckerType.MESH,
- world_collision_checker: WorldCollision | None = None,
- pose_weight: List[float] = [1, 1, 1, 1],
- sample( )¶
This does not support batched environments, use sample_trajectory instead.
- sample_trajectory( )¶
- self_collision_cost: SelfCollisionCost | 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)¶
- update_world(
- world_config: WorldConfig,
- validate( )¶
This does not support batched environments, use validate_trajectory instead
- validate_trajectory( )¶
q: batch , horizon, dof env_query_idx: batch, 1
- world_model: WorldCollision | None = None¶
- kinematics: CudaRobotModel¶
- sampler: HaltonGenerator¶
- bound_scale: torch.Tensor¶