Tool
- class compas_fab.robots.Tool(visual, frame_in_tool0_frame, collision=None, name='attached_tool', link_name=None)[source]
Bases:
object
Represents a tool to be attached to the robot’s flange.
- Attributes
visual (
compas.datastructures.Mesh
) – The visual mesh of the tool.frame_in_tool0_frame (
compas.geometry.Frame
) – The frame of the tool in tool0 frame.collision (
compas.datastructures.Mesh
) – The collision mesh representation of the tool.name (
str
) – The name of the Tool. Defaults to ‘attached_tool’.link_name (
str
) – The name of the Link to which the tool is attached. Defaults toNone
.
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.
from_t0cf_to_tcf
(frames_t0cf)Converts frames at the robot’s flange (tool0 frame) to frames at the robot’s tool tip (tcf frame).
from_tcf_to_t0cf
(frames_tcf)Converts a list of frames at the robot’s tool tip (tcf frame) to frames at the robot’s flange (tool0 frame).
from_tool_model
(tool_model)to_json
(filepath)Serialise the data dictionary representing the tool to JSON and store in a file.
update_touch_links
([touch_links])Attributes
attached_collision_meshes
data
Returns the data dictionary that represents the tool.
frame
link_name
name