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:
- model
compas_robots.RobotModel
The robot model that describes robot kinematics, typically comes from an URDF structure.
- scene_object
compas_robots.scene.BaseRobotModelObject
Instance of the scene object used to visualize the robot model. Defaults to
None
.- semantics
RobotSemantics
The semantic model of the robot. Defaults to
None
.- client
ClientInterface
The backend client to use for communication, e.g.
RosClient
- model
- Attributes:
- attributes
dict
Named attributes related to the robot instance.
attached_tools
dict
of [str
,Tool
], read-onlyDictionary of tools and the planning groups that the tools are currently attached to, if any.
attached_tool
Tool
, read-onlyReturns the tool attached to the default main planning group, if any.
- client
ClientInterface
The backend client to use for communication.
group_names
list
ofstr
, read-onlyAll planning groups of the robot, only available if semantics is set.
group_states
dict
ofdict
, read-onlyAll group states of the robot, only available if semantics is set.
scene_object
compas_robots.scene.BaseRobotModelObject
Scene object used to visualize robot model.
main_group_name
str
, read-onlyRobot’s main planning group, only available if semantics is set.
- model
compas_robots.RobotModel
The robot model that describes robot kinematics, typically comes from an URDF structure.
name
str
, read-onlyName of the robot, as defined by its model.
root_name
str
, read-onlyRobot’s root name.
- semantics
RobotSemantics
The semantic model of the robot. Can be
None
if not loaded.scale_factor
float
A scale factor affecting planning targets, results and visualization.
- attributes
Methods
Attach a tool to the robot independently of the model definition.
Create the most basic instance of a robot, based only on name.
Detach the attached tool.
Alias of
draw_visual()
.Draw the robot's collision geometry using the defined
Robot.scene_object
.Draw the robot's visual geometry using the defined
Robot.scene_object
.Check if the client is set.
Check if the model's geometry has been loaded.
Check if semantics is set.
Calculate the robot's forward kinematic.
Convert frames at the robot's flange (tool0 frame) to frames at the robot's tool tip (tcf frame) using the attached tool.
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 the origin frame of the robot.
Returns a list of all attached collisions meshes of each of the attached tools, if any.
Get the frame of the robot's base link, which is the robot's origin frame.
Get the robot's base link.
Get the name of the robot's base link.
Get the configurable joint names.
Get the configurable joint types.
Get the robot's configurable joints.
Get a
compas_robots.Configuration
from a group's group state.Get the frame of the robot's end effector.
Get the robot's end effector link.
Get the name of the robot's end effector link.
Get the group's configuration.
Get the names of the groups link_name belongs to.
RGet the joint in the robot model matching the given name.
Get a list of joint types given a list of joint names.
Get the names of the links in the kinematic chain.
Get the names of the links with collision geometry.
Get the position of named joint in given configuration.
Print information about the robot.
Calculate the robot's inverse kinematic for a given frame.
Iterate over the inverse kinematic solutions of a robot.
Get the robot's full configuration by merging a group's configuration with a full configuration.
Calculate a cartesian motion path (linear in tool space).
Calculate a motion path.
Get a random configuration.
Scale the robot geometry by a factor (absolute).
Move the origin frame of the robot to the robot_coordinate_frame.
Represent a frame from the world coordinate system (WCF) in the robot's coordinate system (RCF).
Represent a frame from the robot's coordinate system (RCF) in the world coordinate system (WCF).
Get the transformation from the robot's coordinate system (RCF) to the world coordinate system (WCF).
Get the transformation from the world coordinate system (WCF) to the robot's coordinate system (RCF).
Get the robot's transformed axes.
Get the robot's transformed frames.
Update the robot's geometry.
Get the zero joint configuration.
Inherited Methods
Converts the instance to a string.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Validate the data against the object's data schema.