ToolModel

class compas_robots.ToolModel[source]

Bases: RobotModel

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

Attributes:
frameFrame

The frame of the tool in reference to the tool0 frame.

connected_tostr

The name of the Link to which the tool is attached (ie. connected) to. 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

from_robot_model

Creates a ToolModel from a RobotModel instance.

from_t0cf_to_tcf

Converts frames at the robot's flange (tool0 frame) to frames at the robot's tool tip (tcf frame).

from_tcf_to_t0cf

Converts a list of frames at the robot's tool tip (tcf frame) to frames at the robot's flange (tool0 frame).

Inherited Methods

ToString

Converts the instance to a string.

add_joint

Adds a joint to the robot model.

add_link

Adds a link to the robot model.

compute_transformations

Recursive function to calculate the transformations of each joint.

copy

Make an independent copy of the data object.

ensure_geometry

Check if geometry has been loaded.

find_children_joints

Returns a list of all children joints of the link.

find_parent_joint

Returns the parent joint of the link or None if not found.

forward_kinematics

Calculate the robot's forward kinematic.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

from_urdf_file

Construct a robot model from a URDF file model description.

from_urdf_string

Construct a robot model from a URDF description as string.

get_base_link_name

Returns the name of the base link.

get_configurable_joint_names

Returns the configurable joint names.

get_configurable_joints

Returns the configurable joints.

get_end_effector_link

Returns the end effector link.

get_end_effector_link_name

Returns the name of the end effector link.

get_joint_by_name

Get a joint in a robot model matching by its name.

get_joint_types

Returns the joint types of the configurable joints.

get_joint_types_by_names

Get a list of joint types given a list of joint names.

get_link_by_name

Get a link in a robot model matching by its name.

get_link_collision_meshes

Get the list of collision meshes of a link.

get_link_collision_meshes_joined

Get the collision meshes of a Link joined into a single mesh.

get_link_visual_meshes

Get a list of visual meshes from a Link.

get_link_visual_meshes_joined

Get the visual meshes of a Link joined into a single mesh.

get_urdf_element

iter_chain

Iterator over the chain of all elements between a pair of start and end elements.

iter_joint_chain

Iterator over the chain of joints between a pair of start and end links.

iter_joints

Iterator over the joints that starts with the root link's children joints.

iter_link_chain

Iterator over the chain of links between a pair of start and end links.

iter_links

Iterator over the links that starts with the root link.

load_geometry

Load external geometry resources, such as meshes.

random_configuration

Get a random configuration.

remove_joint

Removes a joint to the robot model.

remove_link

Removes a link to the robot model.

scale

Scales the robot by factor (absolute).

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.

to_urdf_file

Construct a URDF file model description from a robot model.

to_urdf_string

Construct a URDF string model description from a robot model.

transformed_axes

Returns the transformed axes based on the joint_state.

transformed_frames

Returns the transformed Joint frames (relative to the Robot Coordinate Frame) based on the joint_state (Configuration).

ur5

Construct a UR5 robot model.

validate_data

Validate the data against the object's data schema.

zero_configuration

Get the zero joint configuration.