curobo.cuda_robot_model.types module

class JointType(value)

Bases: Enum

An enumeration.

FIXED = -1
X_PRISM = 0
Y_PRISM = 1
Z_PRISM = 2
X_ROT = 3
Y_ROT = 4
Z_ROT = 5
X_PRISM_NEG = 6
Y_PRISM_NEG = 7
Z_PRISM_NEG = 8
X_ROT_NEG = 9
Y_ROT_NEG = 10
Z_ROT_NEG = 11
class JointLimits(
joint_names: 'List[str]',
position: 'torch.Tensor',
velocity: 'torch.Tensor',
acceleration: 'torch.Tensor',
jerk: 'torch.Tensor',
effort: 'Optional[torch.Tensor]' = 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),
)

Bases: object

joint_names: List[str]
position: Tensor
velocity: Tensor
acceleration: Tensor
jerk: Tensor
effort: Tensor | 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)
static from_data_dict(
data: Dict,
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),
)
clone() JointLimits
copy_(
new_jl: JointLimits,
)
class CSpaceConfig(
joint_names: 'List[str]',
retract_config: 'Optional[T_DOF]' = None,
cspace_distance_weight: 'Optional[T_DOF]' = None,
null_space_weight: 'Optional[T_DOF]' = 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),
max_acceleration: 'Union[float, List[float]]' = 10.0,
max_jerk: 'Union[float, List[float]]' = 500.0,
velocity_scale: 'Union[float, List[float]]' = 1.0,
acceleration_scale: 'Union[float, List[float]]' = 1.0,
jerk_scale: 'Union[float, List[float]]' = 1.0,
position_limit_clip: 'Union[float, List[float]]' = 0.0,
)

Bases: object

joint_names: List[str]
retract_config: Tensor | None = None
cspace_distance_weight: Tensor | None = None
null_space_weight: Tensor | 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)
max_acceleration: float | List[float] = 10.0
max_jerk: float | List[float] = 500.0
velocity_scale: float | List[float] = 1.0
acceleration_scale: float | List[float] = 1.0
jerk_scale: float | List[float] = 1.0
position_limit_clip: float | List[float] = 0.0
inplace_reindex(
joint_names: List[str],
)
copy_(
new_config: CSpaceConfig,
)
clone() CSpaceConfig
scale_joint_limits(
joint_limits: JointLimits,
)
static load_from_joint_limits(
joint_position_upper: Tensor,
joint_position_lower: Tensor,
joint_names: List[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),
)
class KinematicsTensorConfig(
fixed_transforms: Tensor,
link_map: Tensor,
joint_map: Tensor,
joint_map_type: Tensor,
joint_offset_map: Tensor,
store_link_map: Tensor,
link_chain_map: Tensor,
link_names: List[str],
joint_limits: JointLimits,
non_fixed_joint_names: List[str],
n_dof: int,
mesh_link_names: List[str] | None = None,
joint_names: List[str] | None = None,
lock_jointstate: JointState | None = None,
mimic_joints: dict | None = None,
link_spheres: Tensor | None = None,
link_sphere_idx_map: Tensor | None = None,
link_name_to_idx_map: Dict[str, int] | None = None,
total_spheres: int = 0,
debug: Any | None = None,
ee_idx: int = 0,
cspace: CSpaceConfig | None = None,
base_link: str = 'base_link',
ee_link: str = 'ee_link',
reference_link_spheres: Tensor | None = None,
)

Bases: object

Stores robot’s kinematics parameters as Tensors to use in Kinematics computations.

Use curobo.cuda_robot_model.cuda_robot_generator.CudaRobotGenerator to generate this configuration from a urdf or usd.

fixed_transforms: Tensor

Static Homogenous Transform from parent link to child link for all links [n_links,4,4].

index of fixed_transform given link index [n_links].

joint_map: Tensor

joint index given link index [n_links].

joint_map_type: Tensor

type of joint given link index [n_links].

joint_offset_map: Tensor

index of link to write out pose [n_store_links].

Mapping between each link to every other link, this is used to check if a link is part of a serial chain formed by another link [n_links, n_links].

Name of links whose pose will be stored [n_store_links].

joint_limits: JointLimits

Joint limits

non_fixed_joint_names: List[str]

Name of joints which are not fixed.

n_dof: int

Number of joints that are active. Each joint is only actuated along 1 dimension.

Name of links which have a mesh. Currently only used for debugging and rendering.

joint_names: List[str] | None = None

Name of all actuated joints.

lock_jointstate: JointState | None = None
mimic_joints: dict | None = None
total_spheres: int = 0

total number of spheres that represent the robot’s geometry.

debug: Any | None = None

Additional debug parameters.

ee_idx: int = 0

index of end-effector in stored link poses.

cspace: CSpaceConfig | None = None

Cspace configuration

Name of base link. This is the root link from which all kinematic parameters were computed.

Name of end-effector link for which the Cartesian pose will be computed.

A copy of link spheres that is used as reference, in case the link_spheres get modified at runtime.

copy_(
new_config: KinematicsTensorConfig,
) KinematicsTensorConfig
load_cspace_cfg_from_kinematics()

Update sphere parameters

NOTE: This currently does not update self collision distances.

Parameters:
  • link_name – _description_

  • sphere_position_radius – _description_

  • start_sph_idx – _description_. Defaults to 0.

attach_object(
sphere_radius: float | None = None,
sphere_tensor: Tensor | None = None,
link_name: str = 'attached_object',
) bool

_summary_

Parameters:
  • sphere_radius – _description_. Defaults to None.

  • sphere_tensor – _description_. Defaults to None.

  • link_name – _description_. Defaults to “attached_object”.

Raises:
Returns:

_description_

detach_object(
link_name: str = 'attached_object',
) bool

Detach object from robot end-effector

Parameters:

link_name – _description_. Defaults to “attached_object”.

Raises:

ValueError – _description_

Returns:

_description_

get_number_of_spheres(
link_name: str,
) int

Get number of spheres for a link

Parameters:

link_name – name of link

class SelfCollisionKinematicsConfig(
offset: Tensor | None = None,
distance_threshold: Tensor | None = None,
thread_location: Tensor | None = None,
thread_max: int | None = None,
collision_matrix: Tensor | None = None,
experimental_kernel: bool = True,
checks_per_thread: int = 32,
)

Bases: object

Dataclass that stores self collision attributes to pass to cuda kernel.

offset: Tensor | None = None
distance_threshold: Tensor | None = None
thread_location: Tensor | None = None
thread_max: int | None = None
collision_matrix: Tensor | None = None
experimental_kernel: bool = True
checks_per_thread: int = 32