Skip to content

tesseract_robotics.srdf

The semantic robot description: groups, group states and TCPs (KinematicsInformation), the allowed collision matrix, collision margins, calibration and the kinematics and contact-manager plugin configs. SRDFModel.initFile / initString parse an SRDF against the SceneGraph of its URDF; saveToFile writes it back.

Python
from tesseract_robotics import get_tesseract_resource_path
from tesseract_robotics.common import GeneralResourceLocator
from tesseract_robotics.srdf import SRDFModel
from tesseract_robotics.urdf import parseURDFFile

locator = GeneralResourceLocator(paths=[get_tesseract_resource_path()])  # the tesseract-robotics-nanobind-support wheel
urdf = locator.locateResource("package://tesseract/support/urdf/lbr_iiwa_14_r820.urdf").getFilePath()
srdf = locator.locateResource("package://tesseract/support/urdf/lbr_iiwa_14_r820.srdf").getFilePath()

scene_graph = parseURDFFile(urdf, locator)
model = SRDFModel()
model.initFile(scene_graph, srdf, locator)

model.kinematics_information.group_names       # {'manipulator', 'manipulator_joint_group'}
model.contact_managers_plugin_info              # ContactManagersPluginInfo
model.calibration_info.empty()                  # True: this SRDF has no calibration_config

Named TCPs (group_tcps)

A named TCP is a transform with a name, stored per kinematic group. It is not a link: the physical tip links a group can solve for are KinematicGroup.getAllPossibleTipLinkIds(), and a link is always passed as ManipulatorInfo.tcp_frame. A named TCP goes in ManipulatorInfo.tcp_offset, and the TCP pose is

Text Only
T_world_tool = T_world_{tcp_frame}(q) * findTCPOffset(manip_info)

The SRDF records no parent frame for a TCP: its transform is relative to whatever tcp_frame the ManipulatorInfo names, so pass the link the offset was measured from (usually the flange, tool0). Nothing checks this.

XML
<group_tcps group="manipulator">
  <tcp name="laser" xyz="0.01 -0.02 0.25" rpy="0.1 -0.2 0.3"/>
  <tcp name="welder" xyz="0 0.05 0.18" wxyz="0.5 0.5 0.5 0.5"/>
</group_tcps>

xyz, and one of rpy or wxyz, are required. rpy composes as Rz(y) Ry(p) Rx(r); wxyz is scalar-first (upstream's SRDF attribute, unlike the planning API's scalar-last quaternions) and is normalised. A TCP name is scoped to its group: the same name in two groups is two independent transforms.

Python
tcps = model.kinematics_information.group_tcps   # dict[str, dict[str, Isometry3d]], a copy
tcps["manipulator"]["laser"].matrix              # 4x4, exactly the parsed transform
model.kinematics_information.hasGroupTCP("manipulator", "laser")
model.kinematics_information.addGroupTCP("manipulator", "probe", offset)

group_tcps returns a copy: assign the whole mapping back, or use addGroupTCP / removeGroupTCP, to change it. saveToFile writes each TCP as xyz + wxyz at 6 significant digits, so a saved and reloaded TCP differs from the original by up to ~1e-6.

How a planner resolves the name, and the rest of the composition rule, are under TCP offsets.

Plugin and calibration configs

<kinematics_plugin_config>, <contact_managers_plugin_config> and <calibration_config> each name a YAML file, parsed into kinematics_information.kinematics_plugin_info, contact_managers_plugin_info and calibration_info (a common.CalibrationInfo). saveToFile(path) writes each non-empty one as kinematics_plugin_config.yaml, contact_managers_plugin_config.yaml and calibration_config.yaml beside the SRDF and references it by that file name, so a saved model reloads equal to itself.

Reference

tesseract_srdf Python bindings

KinematicsInformation

group_names property writable

Python
group_names: set[str]

The names of every group (chain, joint and link groups).

chain_groups property writable

Python
chain_groups: dict[str, list[tuple[LinkId, LinkId]]]

Chain groups: group name -> list of (base link, tip link).

joint_groups property writable

Python
joint_groups: dict[str, list[JointId]]

Joint groups: group name -> joint names.

Python
link_groups: dict[str, list[LinkId]]

Link groups: group name -> link names.

kinematics_plugin_info property writable

Python
kinematics_plugin_info: KinematicsPluginInfo

The forward / inverse kinematics solver plugins per group.

group_states property writable

Python
group_states: dict[str, dict[str, dict[str, float]]]

Named joint states per group: group name -> state name -> joint values.

group_tcps property writable

Python
group_tcps: dict[str, dict[str, Isometry3d]]

Named TCP offsets per group: group name -> TCP link name -> Isometry3d.

__init__

Python
__init__() -> None

insert

Python
insert(other: KinematicsInformation) -> None

Merge other into this; on a name both define, other's entry wins.

clear

Python
clear() -> None

Remove every group, state, TCP and plugin entry.

hasGroup

Python
hasGroup(group_name: str) -> bool

True if group_name is a chain, joint or link group.

addChainGroup

Python
addChainGroup(group_name: str, chain_group: Sequence[tuple[LinkId | str, LinkId | str]]) -> None

Add (or replace) the chain group group_name.

removeChainGroup

Python
removeChainGroup(group_name: str) -> None

Remove the chain group group_name, if present.

hasChainGroup

Python
hasChainGroup(group_name: str) -> bool

True if group_name is a chain group.

addJointGroup

Python
addJointGroup(group_name: str, joint_group: Sequence[JointId | str]) -> None

Add (or replace) the joint group group_name.

removeJointGroup

Python
removeJointGroup(group_name: str) -> None

Remove the joint group group_name, if present.

hasJointGroup

Python
hasJointGroup(group_name: str) -> bool

True if group_name is a joint group.

addLinkGroup

Python
addLinkGroup(group_name: str, link_group: Sequence[LinkId | str]) -> None

Add (or replace) the link group group_name.

removeLinkGroup

Python
removeLinkGroup(group_name: str) -> None

Remove the link group group_name, if present.

hasLinkGroup

Python
hasLinkGroup(group_name: str) -> bool

True if group_name is a link group.

addGroupJointState

Python
addGroupJointState(group_name: str, state_name: str, joint_state: Mapping[JointId, float] | Mapping[str, float]) -> None

Add (or replace) the named joint state state_name of group_name.

removeGroupJointState

Python
removeGroupJointState(group_name: str, state_name: str) -> None

Remove the named joint state, if present.

hasGroupJointState

Python
hasGroupJointState(group_name: str, state_name: str) -> bool

True if group_name has the named joint state state_name.

addGroupTCP

Python
addGroupTCP(group_name: str, tcp_name: LinkId | str, tcp: Isometry3d) -> None

Add (or replace) the named TCP offset tcp_name of group_name.

removeGroupTCP

Python
removeGroupTCP(group_name: str, tcp_name: LinkId | str) -> None

Remove the named TCP offset, if present.

hasGroupTCP

Python
hasGroupTCP(group_name: str, tcp_name: LinkId | str) -> bool

True if group_name has the named TCP offset tcp_name.

__eq__

Python
__eq__(other: object) -> bool

__ne__

Python
__ne__(other: object) -> bool

SRDFModel

name property writable

Python
name: str

The robot name.

version property writable

Python
version: list[int]

The SRDF format version, (major, minor, patch).

kinematics_information property writable

Python
kinematics_information: KinematicsInformation

Groups, group states, TCPs and kinematics plugin configuration.

acm property writable

Python
acm: AllowedCollisionMatrix

The allowed collision matrix (disable_collisions entries).

collision_margin_data property writable

Python
collision_margin_data: CollisionMarginData

Collision margins (default and per link pair).

contact_managers_plugin_info property writable

Python
contact_managers_plugin_info: ContactManagersPluginInfo

The contact manager plugin configuration.

calibration_info property writable

Python
calibration_info: CalibrationInfo

Joint origin calibrations (calibration_config).

__init__

Python
__init__() -> None

initFile

Python
initFile(scene_graph: SceneGraph, filename: str, locator: ResourceLocator) -> None

Parse the SRDF file filename against scene_graph, resolving URLs with locator; raises on invalid SRDF.

initString

Python
initString(scene_graph: SceneGraph, xmlstring: str, locator: ResourceLocator) -> None

Parse SRDF text against scene_graph, resolving URLs with locator; raises on invalid SRDF.

saveToFile

Python
saveToFile(file_path: str) -> bool

Write the model as SRDF XML to file_path; False if the file cannot be written.

clear

Python
clear() -> None

Reset the model to empty.

__eq__

Python
__eq__(other: object) -> bool

__ne__

Python
__ne__(other: object) -> bool

__repr__

Python
__repr__() -> str

processSRDFAllowedCollisions

Python
processSRDFAllowedCollisions(scene_graph: SceneGraph, srdf_model: SRDFModel) -> None

Process SRDF allowed collisions and add to scene graph ACM