Skip to content

Introduction to robot and link classes

Peter Corke edited this page Apr 12, 2021 · 1 revision

These notes will eventually migrate to the Sphinx documentation for each class, but here they are easier to work on.

WORK IN PROGRESS

Robot class

A Robot instance is essentially a container of links with metadata and some methods that apply (almost) all subclasses.

Abstract class

The Robot class is abstract. The current subclasses are

  • ERobot the most general robot that can be branched
  • DHRobot classical Denavit-Hartenberg model

The abstract methods are:

Method Purpose
fkine forward kinematics
jacob0 Jacobian in world frame
jacobe Jacobian in end-effector frame
hessian0 Hessian in world frame
rne inverse dynamics: recursive Newton Euler
isspherical robot has spherical wrist
ets ETS representation

Links

A Robot class acts like an iterator over the list of links comprising the robot.

It can also be used to slice the robot, eg. robot[1] is link 1 and robot[:3] is the first three links.

Links can also be found by name, eg. robot['link1'].

Base and tool

The forward kinematics is computed with respect to the base. By default this is the world frame (identity SE(3)), but can be set to an arbitrary value, eg. robot.base = X.

The .base property always returns an SE3 instance, but if the attribute ._base is None this means there is no base set, and .base will return SE3().

NOTE: For symbolic operations this is useful, since premultiplying the link transforms by an identity matrix will lead to unncessary 1.0 * is symbolic expressions.

Metadata and properties

Property Purpose
n number of joints
nlinks number of links
nbranches number of branches
hasdynamics has dynamic parameters
hasgeometry has geometry model
hascollision has collision model
structure robot structure as string
revolutes joints which are revolute (bool array)
prismatics joints which are prismatic (bool array)

Concrete methods

Kinematics

Method Purpose
IK_xx inverse kinematics

NOTE: inverse kinematics uses the fkine and jacob0 methods
of the subclass

Dynamics

Method Purpose
inertia rigid-body mass tensor
coriolis rigid-body Coriolis and centripetal term
gravload rigid-body gravity load
accel rigid-body forward dynamics
inertia_x operational-space mass tensor
coriolis_x operational-space Coriolis and centripetal term
gravload_x operational-space gravity load
accel_x operational-space forward dynamics
dynamics dynamic parameters as a table
dynamics_list dynamic parameters as a list

NOTE: many of these methods require

Graphics

Method Purpose
plot plot/animate the robot
teach interactively "teach" the robot

NOTE: plot and teach invoke the backend which calls back to
robot methods

Backend support:

Link class

This is an abstract base class for all links. It contains metadata about the link and a number of methods.

Metadata and properties

Property Purpose
name number of joints
isrevolute true if link's parent is via a revolute joint
isprismatic true if link's parent is via a prismatic joint
hasdynamics has dynamic parameters
hasgeometry has geometry model
hascollision has collision model
m link mass (float)
r link CoM relative to link frame ndarray(3)
I link inertia tensor about CoM ndarray(3,3)

Abstract method A

Denavit-Hartenberg defined robots

Is based on concrete subclasses

DHRobot

DHLink

Property Purpose
theta DH rotation about z-axis (float)
d DH translation along z-axis (float)
a DH translation along x-axis (float)
alpha DH rotation about x-axis (float)
mdh uses modified DH convention (bool)

A number of subclasses are useful in the creation of robot models using DH conventions

Method Purpose
RevoluteDH revolute joint using standard DH convention
PrismaticDH prismatic joint using standard DH convention
RevoluteMDH revolute joint using modified DH convention
PrismaticMDH prismatic joint using modified DH convention
Clone this wiki locally