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.
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
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.
<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.
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
¶
The names of every group (chain, joint and link groups).
chain_groups
property
writable
¶
Chain groups: group name -> list of (base link, tip link).
joint_groups
property
writable
¶
Joint groups: group name -> joint names.
link_groups
property
writable
¶
Link groups: group name -> link names.
kinematics_plugin_info
property
writable
¶
The forward / inverse kinematics solver plugins per group.
group_states
property
writable
¶
Named joint states per group: group name -> state name -> joint values.
group_tcps
property
writable
¶
Named TCP offsets per group: group name -> TCP link name -> Isometry3d.
insert
¶
Merge other into this; on a name both define, other's entry wins.
hasGroup
¶
True if group_name is a chain, joint or link group.
addChainGroup
¶
addChainGroup(group_name: str, chain_group: Sequence[tuple[LinkId | str, LinkId | str]]) -> None
Add (or replace) the chain group group_name.
removeChainGroup
¶
Remove the chain group group_name, if present.
addJointGroup
¶
Add (or replace) the joint group group_name.
removeJointGroup
¶
Remove the joint group group_name, if present.
addLinkGroup
¶
Add (or replace) the link group group_name.
removeLinkGroup
¶
Remove the link group group_name, if present.
addGroupJointState
¶
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
¶
Remove the named joint state, if present.
hasGroupJointState
¶
True if group_name has the named joint state state_name.
addGroupTCP
¶
Add (or replace) the named TCP offset tcp_name of group_name.
removeGroupTCP
¶
Remove the named TCP offset, if present.
hasGroupTCP
¶
True if group_name has the named TCP offset tcp_name.
SRDFModel
¶
version
property
writable
¶
The SRDF format version, (major, minor, patch).
kinematics_information
property
writable
¶
Groups, group states, TCPs and kinematics plugin configuration.
acm
property
writable
¶
The allowed collision matrix (disable_collisions entries).
collision_margin_data
property
writable
¶
Collision margins (default and per link pair).
contact_managers_plugin_info
property
writable
¶
The contact manager plugin configuration.
calibration_info
property
writable
¶
Joint origin calibrations (calibration_config).
initFile
¶
Parse the SRDF file filename against scene_graph, resolving URLs with locator; raises on invalid SRDF.
initString
¶
Parse SRDF text against scene_graph, resolving URLs with locator; raises on invalid SRDF.
saveToFile
¶
Write the model as SRDF XML to file_path; False if the file cannot be written.
processSRDFAllowedCollisions
¶
Process SRDF allowed collisions and add to scene graph ACM