curobo.cuda_robot_model.kinematics_parser module

Base module for parsing kinematics from different representations.

cuRobo provides kinematics parsing from an URDF and a partial implementation for parsing from a USD. To parse from other representations, an user can extend the KinematicsParser class and implement only the abstract methods. Optionally, user can also provide functions for reading meshes, useful for debugging and visualization.

class LinkParams(
link_name: str,
joint_name: str,
joint_type: ~curobo.cuda_robot_model.types.JointType,
fixed_transform: ~numpy.ndarray,
parent_link_name: str | None = None,
joint_limits: ~typing.List[float] | None = None,
joint_axis: ~numpy.ndarray | None = None,
joint_id: int | None = None,
joint_velocity_limits: ~typing.List[float] = <factory>,
joint_offset: ~typing.List[float] = <factory>,
mimic_joint_name: str | None = None,
)

Bases: object

Parameters of a link in the kinematic tree.

joint_name: str
joint_type: JointType
fixed_transform: ndarray
joint_limits: List[float] | None = None
joint_axis: ndarray | None = None
joint_id: int | None = None
joint_velocity_limits: List[float]
joint_offset: List[float]
mimic_joint_name: str | None = None
static from_dict(
dict_data: Dict[str, Any],
) LinkParams

Create a LinkParams object from a dictionary.

Parameters:

dict_data – Dictionary containing link parameters.

Returns:

Link parameters object.

Return type:

LinkParams

class KinematicsParser(
extra_links: Dict[str, LinkParams] | None = None,
)

Bases: object

Base class for parsing kinematics.

Implement abstractmethods to parse kinematics from any representation. Optionally, implement methods for reading meshes for visualization and debugging.

Initialize the KinematicsParser.

Parameters:

extra_links – Additional links to be added to the kinematic tree.

_parent_map

Parent link for all link in the kinematic tree.

Build a map of parent links to each link in the kinematic tree.

Use this function to fill _parent_map. Check curobo.cuda_robot_model.urdf_kinematics_parser.UrdfKinematicsParser.build_link_parent for an example implementation.

Get parameters of a link in the kinematic tree.

Parameters:
  • link_name – Name of the link.

  • base – Is this the base link of the robot?

Returns:

Parameters of the link.

Return type:

LinkParams

Add absolute path to link meshes.

Parameters:

mesh_dir – Absolute path to the directory containing link meshes.

Get mesh of a link.

Parameters:

link_name – Name of the link.

Returns:

Mesh of the link.

Return type:

Mesh

get_chain(
base_link: str,
ee_link: str,
) List[str]

Get list of links attaching ee_link to base_link.

Parameters:
  • base_link (str) – Name of base link.

  • ee_link (str) – Name of end-effector link.

Returns:

List of link names starting from base_link to ee_link.

Return type:

List[str]

get_controlled_joint_names() List[str]

Get names of all controlled joints in the robot.

Returns:

Names of all controlled joints in the robot.

Get link parameters for extra links.

Parameters:

link_name – Name of the link.

Returns:

Link parameters if found, else None.

Return type:

LinkParams