RobotSemantics

class compas_fab.robots.RobotSemantics[source]

Bases: Data

Represents semantic information of a robot.

The semantic model is based on the Semantic Robot Description Format (SRDF). Typically, the RobotSemantics objects are created from an SRDF file (using from_srdf_file()) or loaded by the backend client (using compas_fab.backends.PyBulletClient.load_semantics() or compas_fab.backends.RosClient.load_robot()).

Parameters:
robot_modelRobotModel

The robot model.

groupsdict of (str, dict of (linkslist of str, jointslist of str)), optional

A nested dictionary defining planning groups. The dictionary structure is as follows:

  • Level 1 keys are planning group names : str.

  • Level 2 contains only two keys:

    • links is a list of str containing link names

    • joints is a list of str containing joint names.

main_group_namestr, optional

The name of the main group.

passive_jointslist of str, optional

A list of passive joint names.

end_effectorslist of str, optional

A list of end effector link names.

disabled_collisionstuple of (str, str), optional

A set of disabled collision pairs. The order is not important, i.e. the pair (‘link1’, ‘link2’) is the same as (‘link2’, ‘link1’). Only one pair is needed.

group_statesdict, optional

A nested dictionary defining named states for a particular group, in terms of joint values. This is useful to define states such as “home” or “folded arms” for the robot. The dictionary structure is as follows:

  • Level 1 keys are planning group names : str.

  • Level 2 keys are group state names : str.

  • Level 3 keys are joint names and values are joint values : str.

Attributes:
group_nameslist of str, read-only

Get the names of all planning groups.

unordered_disabled_collisionsset of frozenset, read-only

Get the disabled collision pairs as a set of frozensets.

Methods

from_srdf_file

Create an instance of semantics based on an SRDF file path or file-like object.

from_srdf_string

Create an instance of semantics based on an SRDF string.

from_xml

Create an instance of semantics based on an XML object.

get_all_configurable_joints

Get all configurable compas_robots.model.Joint of the robot.

get_base_link_name

Get the name of the first link (base link) in a planning group.

get_configurable_joint_names

Get all the names of configurable joints of a planning group.

get_configurable_joints

Get all configurable compas_robots.model.Joint of a planning group.

get_end_effector_link_name

Get the name of the last link (end effector link) in a planning group.

Inherited Methods

ToString

Converts the instance to a string.

copy

Make an independent copy of the data object.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

validate_data

Validate the data against the object's data schema.