Tool

class compas_fab.robots.Tool(visual, frame_in_tool0_frame, collision=None, name='attached_tool')[source]

Bases: object

Represents a tool to be attached to the robot’s flange.

visual

The visual mesh of the tool.

Type

compas.datastructures.Mesh

frame

The frame of the tool in tool0 frame.

Type

compas.geometry.Frame

collision

The collision mesh representation of the tool.

Type

compas.datastructures.Mesh

name

The name of the Tool. Defaults to ‘attached_tool’.

Type

str

Examples

>>> mesh = Mesh.from_stl(compas_fab.get('planning_scene/cone.stl'))
>>> frame = Frame([0.14, 0, 0], [0, 1, 0], [0, 0, 1])
>>> tool = Tool(mesh, frame)

Methods

__init__(visual, frame_in_tool0_frame[, …])

Initialize self.

from_data(data)

Construct a Tool from its data representation.

from_json(filepath)

Construct a Tool from the data contained in a JSON file.

to_json(filepath)

Serialise the data dictionary representing the tool to JSON and store in a file.

Attributes

collision

The collision mesh representation of the tool.

collision_mesh

Returns the collision mesh of the tool.

data

Returns the data dictionary that represents the tool.

__init__(visual, frame_in_tool0_frame, collision=None, name='attached_tool')[source]

Initialize self. See help(type(self)) for accurate signature.