AttachedCollisionMesh

class compas_fab.robots.AttachedCollisionMesh(collision_mesh, link_name, touch_links=None, weight=1.0)[source]

Bases: Data

Represents a collision mesh that is attached to a Robot’s Link.

Parameters
  • collision_mesh (compas_fab.robots.CollisionMesh) – The collision mesh to be attached to the robot model.

  • link_name (str) – The name of the Link the collision mesh will be attached to.

  • touch_links (list of str, optional) – The list of link names the collision mesh is allowed to touch. Defaults to the link it is attached to.

  • weight (float, optional) – The weight of the attached object in kg. Defaults to 1.0.

Attributes
  • collision_mesh (compas_fab.robots.CollisionMesh) – The collision mesh we want to attach.

  • link_name (str) – The name of the Link the collision mesh will be attached to.

  • touch_links (list of str) – The list of link names the collision mesh is allowed to touch. Defaults to the link it is attached to.

  • weight (float) – The weight of the attached object in kg.

Examples

>>> mesh = Mesh.from_stl(compas_fab.get('planning_scene/cone.stl'))
>>> cm = CollisionMesh(mesh, 'tip')
>>> ee_link_name = 'ee_link'
>>> touch_links = ['wrist_3_link', 'ee_link']
>>> acm = AttachedCollisionMesh(cm, ee_link_name, touch_links)

Methods

from_data

Construct an attached collision mesh from its data representation.

to_data

Get the data dictionary that represents the attached collision mesh.

Inherited Methods

ToString

Converts the instance to a string.

copy

Make an independent copy of the data object.

from_json

Construct an object from serialized data contained in a JSON file.

from_jsonstring

Construct an object from serialized data contained in a JSON string.

sha256

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

to_json

Serialize the data representation of an object to a JSON file.

to_jsonstring

Serialize the data representation of an object to a JSON string.

validate_data

Validate the object's data against its data schema.

validate_json

Validate the object's data against its json schema.