Robot

class compas_fab.robots.Robot[source]

Bases: Data

Represents a robot.

This class binds together several building blocks, such as the robot’s descriptive model, its semantic information and an instance of a backend client into a cohesive programmable interface. This representation builds upon the model described in the class compas_robots.RobotModel of the COMPAS framework.

Parameters:
modelcompas_robots.RobotModel

The robot model that describes robot kinematics, typically comes from an URDF structure.

scene_objectcompas_robots.scene.BaseRobotModelObject

Instance of the scene object used to visualize the robot model. Defaults to None.

semanticsRobotSemantics

The semantic model of the robot. Defaults to None.

clientClientInterface

The backend client to use for communication, e.g. RosClient

Attributes:
attributesdict

Named attributes related to the robot instance.

attached_toolsdict of [str, Tool], read-only

Dictionary of tools and the planning groups that the tools are currently attached to, if any.

attached_toolTool, read-only

Returns the tool attached to the default main planning group, if any.

clientClientInterface

The backend client to use for communication.

group_nameslist of str, read-only

All planning groups of the robot, only available if semantics is set.

group_statesdict of dict, read-only

All group states of the robot, only available if semantics is set.

scene_objectcompas_robots.scene.BaseRobotModelObject

Scene object used to visualize robot model.

main_group_namestr, read-only

Robot’s main planning group, only available if semantics is set.

modelcompas_robots.RobotModel

The robot model that describes robot kinematics, typically comes from an URDF structure.

namestr, read-only

Name of the robot, as defined by its model.

root_namestr, read-only

Robot’s root name.

semanticsRobotSemantics

The semantic model of the robot. Can be None if not loaded.

scale_factorfloat

A scale factor affecting planning targets, results and visualization.

Methods

attach_tool

Attach a tool to the robot independently of the model definition.

basic

Create the most basic instance of a robot, based only on name.

detach_tool

Detach the attached tool.

draw

Alias of draw_visual().

draw_collision

Draw the robot's collision geometry using the defined Robot.scene_object.

draw_visual

Draw the robot's visual geometry using the defined Robot.scene_object.

ensure_client

Check if the client is set.

ensure_geometry

Check if the model's geometry has been loaded.

ensure_semantics

Check if semantics is set.

forward_kinematics

Calculate the robot's forward kinematic.

from_t0cf_to_tcf

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

from_tcf_to_t0cf

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

get_RCF

Get the origin frame of the robot.

get_attached_tool_collision_meshes

Returns a list of all attached collisions meshes of each of the attached tools, if any.

get_base_frame

Get the frame of the robot's base link, which is the robot's origin frame.

get_base_link

Get the robot's base link.

get_base_link_name

Get the name of the robot's base link.

get_configurable_joint_names

Get the configurable joint names.

get_configurable_joint_types

Get the configurable joint types.

get_configurable_joints

Get the robot's configurable joints.

get_configuration_from_group_state

Get a compas_robots.Configuration from a group's group state.

get_end_effector_frame

Get the frame of the robot's end effector.

get_end_effector_link

Get the robot's end effector link.

get_end_effector_link_name

Get the name of the robot's end effector link.

get_group_configuration

Get the group's configuration.

get_group_names_from_link_name

Get the names of the groups link_name belongs to.

get_joint_by_name

RGet the joint in the robot model matching the given name.

get_joint_types_by_names

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

get_link_names

Get the names of the links in the kinematic chain.

get_link_names_with_collision_geometry

Get the names of the links with collision geometry.

get_position_by_joint_name

Get the position of named joint in given configuration.

info

Print information about the robot.

inverse_kinematics

Calculate the robot's inverse kinematic for a given frame.

iter_inverse_kinematics

Iterate over the inverse kinematic solutions of a robot.

merge_group_with_full_configuration

Get the robot's full configuration by merging a group's configuration with a full configuration.

plan_cartesian_motion

Calculate a cartesian motion path (linear in tool space).

plan_motion

Calculate a motion path.

random_configuration

Get a random configuration.

scale

Scale the robot geometry by a factor (absolute).

set_RCF

Move the origin frame of the robot to the robot_coordinate_frame.

to_local_coordinates

Represent a frame from the world coordinate system (WCF) in the robot's coordinate system (RCF).

to_world_coordinates

Represent a frame from the robot's coordinate system (RCF) in the world coordinate system (WCF).

transformation_RCF_WCF

Get the transformation from the robot's coordinate system (RCF) to the world coordinate system (WCF).

transformation_WCF_RCF

Get the transformation from the world coordinate system (WCF) to the robot's coordinate system (RCF).

transformed_axes

Get the robot's transformed axes.

transformed_frames

Get the robot's transformed frames.

update

Update the robot's geometry.

zero_configuration

Get the zero joint configuration.

Inherited Methods

ToString

Converts the instance to a string.

copy

Make an independent copy of the data object.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

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.

validate_data

Validate the data against the object's data schema.