ToolModel
- class compas.robots.ToolModel(visual, frame_in_tool0_frame, collision=None, name='attached_tool', link_name=None)[source]
Bases:
RobotModel
Represents a tool to be attached to the robot’s flange.
- Attributes
visual (
compas.datastructures.Mesh
) – The visual mesh of the tool.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 ToolModel. Defaults to ‘attached_tool’.
link_name (str) – The name of the Link to which the tool is attached. Defaults to
None
.
Examples
>>> import compas >>> from compas.datastructures import Mesh >>> from compas.geometry import Frame >>> mesh = Mesh.from_stl(compas.get('cone.stl')) >>> frame = Frame([0.14, 0, 0], [0, 1, 0], [0, 0, 1]) >>> tool = ToolModel(mesh, frame)
Methods
Construct a ToolModel from its data representation.
Creates a
ToolModel
from acompas.robots.RobotModel
instance.Converts frames at the robot's flange (tool0 frame) to frames at the robot's tool tip (tcf frame).
Converts a list of frames at the robot's tool tip (tcf frame) to frames at the robot's flange (tool0 frame).
Inherited Methods
Adds a joint to the robot model.
Adds a link to the robot model.
Recursive function to calculate the transformations of each joint.
Make an independent copy of the data object.
Check if geometry has been loaded.
Returns a list of all children joints of the link.
Returns the parent joint of the link or None if not found.
Calculate the robot's forward kinematic.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Construct a robot model from a URDF file model description.
Construct a robot model from a URDF description as string.
Returns the name of the base link.
Returns the configurable joint names.
Returns the configurable joints.
Returns the end effector link.
Returns the name of the end effector link.
Get a joint in a robot model matching by its name.
Returns the joint types of the configurable joints.
Get a list of joint types given a list of joint names.
Get a link in a robot model matching by its name.
Iterator over the chain of all elements between a pair of start and end elements.
Iterator over the chain of joints between a pair of start and end links.
Iterator over the joints that starts with the root link's children joints.
Iterator over the chain of links between a pair of start and end links.
Iterator over the links that starts with the root link.
Load external geometry resources, such as meshes.
Get a random configuration.
Removes a joint to the robot model.
Removes a link to the robot model.
Scales the robot by factor (absolute).
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Construct a URDF file model description from a robot model.
Construct a URDF string model description from a robot model.
Returns the transformed axes based on the joint_state.
Returns the transformed frames based on the joint_state.
"Construct a UR5 robot model.
Validate the object's data against its data schema.
Validate the object's data against its json schema.
Get the zero joint configuration.