Denavit-Hartenberg models
This class is used to model robots defined in terms of standard or modified Denavit-Hartenberg notation.
Note
These classes provide similar functionality and notation to MATLAB Toolbox SerialLink and
Link classes.
DHRobot
The various Models all subclass this class.
- class DHRobot(links, meshdir=None, **kwargs)[source]
Bases:
RobotClass for robots defined using Denavit-Hartenberg notation
- Parameters:
name (str) – Name of the robot
manufacturer (str) – Manufacturer of the robot
base (SE3) – Location of the base
tool (SE3) – Location of the tool
gravity (ndarray(3)) – gravitational acceleration in the world frame, downwards gravitational force is equivalent to robot base acceleration upwards (positive)
A concrete superclass for arm type robots defined using Denavit-Hartenberg notation, that represents a serial-link arm-type robot. Each link and joint in the chain is described by a DHLink-class object using Denavit-Hartenberg parameters (standard or modified).
Note
Link subclass elements passed in must be all standard, or all modified, DH parameters.
- Reference:
Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7-9.
Robot, Modeling & Control, M.Spong, S. Hutchinson & M. Vidyasagar, Wiley 2006.
- __str__()[source]
Pretty prints the DH Model of the robot. Will output angles in degrees
- Returns:
Pretty print of the robot model
- Return type:
- property links: list[DHLink]
Robot links
- Returns:
A list of link objects
Notes
It is probably more concise to index the robot object rather than the list of links, ie. the following are equivalent: -
robot.links[i]-robot[i]
- property mdh: Any
Modified Denavit-Hartenberg status
- Returns:
whether robot is defined using modified Denavit-Hartenberg notation
- Return type:
Example:
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.mdh 0 >>> panda = rtb.models.DH.Panda() >>> panda.mdh 1
- property d: Any
Link offset values
- Returns:
List of link offset values \(d_j\).
- Return type:
ndarray(n,)
The following are equivalent:
robot.links[j].d robot.d[j]
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.d [0.6718299999999999, 0, 0.15005, 0.4318, 0, 0]
- property a: Any
Link length values
- Returns:
List of link length values \(a_j\).
- Return type:
ndarray(n,)
The following are equivalent:
robot.links[j].a robot.a[j]
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.a [0, 0.4318, 0.0203, 0, 0, 0]
- property theta: Any
Joint angle values
- Returns:
List of joint angle values \(\theta_j\).
- Return type:
ndarray(n,)
The following are equivalent:
robot.links[j].theta robot.theta[j]
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.theta [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
- property alpha: Any
Link twist values
- Returns:
List of link twist values \(\alpha_j\).
- Return type:
ndarray(n,)
The following are equivalent:
robot.links[j].alpha robot.alpha[j]
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.alpha [1.5707963267948966, 0.0, -1.5707963267948966, 1.5707963267948966, -1.5707963267948966, 0.0]
- property r: Any
Link centre of mass values
- Returns:
Array of link centre of mass values \(r_j\).
- Return type:
ndarray(3,n)
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.r array([[ 0. , -0.3638, -0.0203, 0. , 0. , 0. ], [ 0. , 0.006 , -0.0141, 0.019 , 0. , 0. ], [ 0. , 0.2275, 0.07 , 0. , 0. , 0.032 ]])
- property offset: Any
Joint offset values
- Returns:
List of joint offset values \(\bar{q}_j\).
- Return type:
ndarray(n,)
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.offset [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
- property reach: Any
Reach of the robot
- Returns:
Maximum reach of the robot
- Return type:
A conservative estimate of the reach of the robot. It is computed as \(\sum_j |a_j| + |d_j|\) where \(d_j\) is taken as the maximum joint coordinate (
qlim) if the joint is primsmatic.Note
This is the length sum referred to in Craig’s book
Probably an overestimate of the actual reach
Used by numerical inverse kinematics to scale translational error.
For a prismatic joint, uses
qlimif it is set
Warning
Computed on the first access. If kinematic parameters subsequently change this will not be reflected.
- property nbranches: Any
Number of branches
- Returns:
number of branches in the robot’s kinematic tree
- Return type:
Number of branches in this robot.
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Panda() >>> robot.nbranches 1
- islimit(q=None)[source]
Joint limit test
- Parameters:
q (
Any) – The joint configuration of the robot (Optional, if not supplied will use the stored q values)- Return v:
is a vector of boolean values, one per joint, False if
q[j]is within the joint limits, else True- Rtype v:
bool list
- Return type:
robot.islimit(q)is a list of boolean values indicating if the joint configurationqis in violation of the joint limits.robot.jointlimit()as above except uses the stored q value of the robot object.
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.islimit([0, 0, -4, 4, 0, 0]) [np.False_, np.False_, np.True_, np.True_, np.False_, np.False_]
- isspherical()[source]
Test for spherical wrist
- Returns:
True if spherical wrist
- Return type:
Tests if the robot has a spherical wrist, that is, the last 3 axes are revolute and their axes intersect at a point.
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.isspherical() True
- dhunique()[source]
Print the unique DH parameters
Print a table showing all the non-zero DH parameters, and their values. This is the minimum set of kinematic parameters required to describe the robot.
Example:
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.dhunique() ┌───────┬────────┐ │ param │ value │ ├───────┼────────┤ │ d0 │ 0.6718 │ │ ⍺0 │ 1.571 │ │ a1 │ 0.4318 │ │ d2 │ 0.15 │ │ a2 │ 0.0203 │ │ ⍺2 │ -1.571 │ │ d3 │ 0.4318 │ │ ⍺3 │ 1.571 │ │ ⍺4 │ -1.571 │ └───────┴────────┘
- Return type:
- twists(q=None)[source]
Joint axes as twists
- Parameters:
q (
Any) – The joint configuration of the robot, defaults to zero- Returns:
a vector of joint axis twists
- Return type:
- Returns:
Pose of the tool
- Return type:
SE3 instance
tw, T0 = twists(q)calculates a vector of Twist objects (n) that represent the axes of the joints for the robot with joint coordinatesq(n). Also returns T0 which is an SE3 object representing the pose of the tool.tw, T0 = twists()as above but the joint coordinates are taken to be zero.
Example:
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> tw, T0 = robot.twists() >>> tw Twist3([ [-0, -0, -0, 0, 0, 1], [0.67183, -0, -0, 0, -1, 6.1232e-17], [0.67183, -2.644e-17, -0.4318, 0, -1, 6.1232e-17], [-0.15005, -0.4521, 0, 0, 0, 1], [1.1036, -2.7683e-17, -0.4521, 0, -1, 6.1232e-17], [-0.15005, -0.4521, 0, 0, 0, 1] ]) >>> T0 SE3(array([[ 1. , 0. , 0. , 0.4521], [ 0. , 1. , 0. , -0.15 ], [ 0. , 0. , 1. , 1.1036], [ 0. , 0. , 0. , 1. ]]))
- segments()[source]
Segments of branched robot
For a single-chain robot with structure:
L1 - L2 - L3
the return is
[[None, L1, L2, L3]]For a robot with structure:
L1 - L2 +- L3 - L4 +- L5 - L6
the return is
[[None, L1, L2], [L2, L3, L4], [L2, L5, L6]]- Return type:
- Returns:
Segment list
Notes
the length of the list is the number of segments in the robot
- the first segment always starts with
Nonewhich represents the base transform (since there is no base link)
- the first segment always starts with
- the last link of one segment is also the first link of subsequent
segments
- ets(*args, **kwargs)[source]
Robot kinematics as an elemenary transform sequence
- Returns:
elementary transform sequence
- Return type:
Example:
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.ets() [ET.Rz(jindex=0, qlim=array([-2.7925, 2.7925])), ET.tz(param=0.6718299999999999), ET.Rx(param=1.5707963267948966), ET.Rz(jindex=1, qlim=array([-0.7854, 3.927 ])), ET.tx(param=0.4318), ET.Rz(jindex=2, qlim=array([-3.927 , 0.7854])), ET.tz(param=0.15005), ET.tx(param=0.0203), ET.Rx(param=-1.5707963267948966), ET.Rz(jindex=3, qlim=array([-1.9199, 2.9671])), ET.tz(param=0.4318), ET.Rx(param=1.5707963267948966), ET.Rz(jindex=4, qlim=array([-1.7453, 1.7453])), ET.Rx(param=-1.5707963267948966), ET.Rz(jindex=5, qlim=array([-4.6426, 4.6426]))]
- A(j, q=None)[source]
Link forward kinematics
- Parameters:
- Return T:
The transform between link frames
- Rtype T:
SE3
- Return type:
robot.A(j, q)transform between link frames {0} and {j}.qis a vector (n) of joint variables.robot.A([j1, j2], q)as above between link frames {j1} and {j2}.robot.A(j)as above except uses the stored q value of the robot object.
Note
Base and tool transforms are not applied.
- fkine(q, **kwargs)[source]
Forward kinematics
- Parameters:
q (
Any) – The joint configuration- Returns:
Forward kinematics as an SE(3) matrix
- Return type:
robot.fkine(q)computes the forward kinematics for the robot at joint configurationq.
If q is a 2D array, the rows are interpreted as the generalized joint coordinates for a sequence of points along a trajectory.
q[k,j]is the j’th joint coordinate for the k’th trajectory configuration, and the returnedSE3instance containsnvalues.Example:
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.fkine([0, 0, 0, 0, 0, 0]) SE3(array([[ 1. , 0. , 0. , 0.4521], [ 0. , 1. , 0. , -0.15 ], [ 0. , 0. , 1. , 1.1036], [ 0. , 0. , 0. , 1. ]]))
Note
The robot’s base or tool transform, if present, are incorporated into the result.
Joint offsets, if defined, are added to
qbefore the forward kinematics are computed.
- fkine_path(q, old=None)[source]
Compute the pose of every link frame
T = robot.fkine_path(q)is an SE3 instance withrobot.nlinks + 1values:T[0]is the base transformT[i+1]is the pose of link whosenumberisi
- References:
Kinematic Derivatives using the Elementary Transform Sequence, J. Haviland and P. Corke
- fkine_all(q=None, old=True)[source]
Forward kinematics for all link frames
- Parameters:
- Returns:
Forward kinematics as an SE(3) matrix
- Return type:
fkine_all(q)evaluates fkine for each joint within a robot and returns a sequence of link frame poses.fkine_all()as above except uses the stored q value of the robot object.
Example:
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> T = puma.fkine_all([0, 0, 0, 0, 0, 0]) >>> len(T) 7
Note
Old behaviour is to return a list of
nframes {1} to {n}, but ifold=Falseit returnsn+ 1 frames {0} to {n}, ie. it includes the base frame.The robot’s base or tool transform, if present, are incorporated into the result.
Joint offsets, if defined, are added to q before the forward kinematics are computed.
- analytic_ik()[source]
Analytic inverse kinematics solver for this robot
- Return type:
- Returns:
a solver, which solves for one pose with
solve()orikine(), and writes source code withgenerate()- Raises:
ImportError – if SymPy is not installed
NotImplementedError – if the arm needs the general 6R method but has a prismatic joint
ValueError – if no analytic solution is found for this arm
The equations are derived symbolically, which takes seconds, and the solver is kept, so the cost is paid once for each robot. An arm with a spherical wrist or three parallel axes has a closed form solution, any other 6R arm is solved by the method of Raghavan and Roth. The robot must have six joints and standard DH links.
Note
This needs SymPy, which is not installed with the Toolbox by default:
pip install roboticstoolbox-python[ik]. The extra also installspython-flint, which makes the derivation much faster.Added in version 1.5.0.
- ikine_analytic(T, q0=None, joint_limits=True, weights=None)[source]
Analytic inverse kinematics
- Parameters:
T (
SE3|ndarray) – end-effector pose, or a trajectory of posesq0 (
ndarray|Sequence[float] |None) – configuration to be near, default zerosjoint_limits (
bool) – reject solutions that violate the joint limitsweights (
ndarray|Sequence[float] |None) – weight of each joint in the distance fromq0
- Return type:
- Returns:
the solution, nearest to
q0, seeikine()
This is
self.analytic_ik().ikine(...). The first call for a robot derives the equations, seeanalytic_ik(), and the solver is kept for the calls that follow.Added in version 1.5.0.
- ikine_LM(Tep, q0=None, **ikargs)[source]
Numerical inverse kinematics by Levenberg-Marquadt optimization
- Parameters:
Tep (
ndarray|SE3) – The desired end-effector pose or pose trajectory, seeikine_LM()for how a trajectory is handledq0 (
ndarray|Sequence[float] |None) – The initial joint coordinates, a vector (n,), or a matrix (m, n) whose rows are the starting points of the first m searches (any further searches start from random valid coordinates)ikargs (
Any) – additional keyword arguments accepted by the underlying numerical IK solver –ilimit,slimit,tol,mask,joint_limits,seed,verbose,k,method,kq,km– seeikine_LM()for details of each
- Returns:
An IKSolution containing joint coordinates
q,successflag,iterations,searches,residualerror value, andreasonstring if applicable- Return type:
This is a thin wrapper around
ikine_LM()– see that method for the full description of the Levenberg-Marquadt solver and itsmethod/kq/kmvariants.See also
- ikine_6s(T, config, ikfunc)[source]
Analytic inverse kinematics for a robot with a spherical wrist
Deprecated since version 1.5.0: This came from the MATLAB Toolbox and is not general. It only handles the wrist, the user supplied
ikfuncmust solve the first three joints, and that is specific to one robot geometry. It also mishandles trajectories and unreachable poses. It is no longer used byikine_a, which is self-contained. A hand-written solution belongs in the class of the robot it is written for.
- config_validate(config, allowables)[source]
Validate a configuration string
- Parameters:
- Raises:
ValueError – bad character in configuration string
- Returns:
configuration string
- Return type:
For analytic inverse kinematics the Toolbox uses a string whose letters indicate particular solutions, eg. for the Puma 560
Character
Meaning
‘l’
lefty
‘r’
righty
‘u’
elbow up
‘d’
elbow down
‘n’
wrist not flipped
‘f’
wrist flipped
This method checks that the configuration string is valid and adds default values for missing characters. For example:
config = self.config_validate(config, (‘lr’, ‘ud’, ‘nf’))
indicates the valid characters, and the first character in each string is the default, ie. if neither ‘l’ or ‘r’ is given then ‘l’ will be added to the string.
- jacobe(q, half=None, **kwargs)[source]
Manipulator Jacobian in end-effector frame
- Parameters:
- Return J:
The manipulator Jacobian in the end-effector frame
- Return type:
robot.jacobe(q)is the manipulator Jacobian matrix which maps joint velocity to end-effector spatial velocity.
End-effector spatial velocity \(\nu = (v_x, v_y, v_z, \omega_x, \omega_y, \omega_z)^T\) is related to joint velocity by \({}^{E}\!\nu = \mathbf{J}_m(q) \dot{q}\).
Example:
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.jacobe([0, 0, 0, 0, 0, 0]) array([[ 0.15 , -0.4318, -0.4318, 0. , 0. , 0. ], [ 0.4521, 0. , 0. , 0. , 0. , 0. ], [ 0. , 0.4521, 0.0203, 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , -1. , -1. , 0. , -1. , 0. ], [ 1. , 0. , 0. , 1. , 0. , 1. ]])
Warning
This is the geometric Jacobian as described in texts by Corke, Spong etal., Siciliano etal. The end-effector velocity is described in terms of translational and angular velocity, not a velocity twist as per the text by Lynch & Park.
- jacob0(q=None, T=None, half=None, start=None, end=None)[source]
Manipulator Jacobian in world frame
- Parameters:
- Return J:
The manipulator Jacobian in the world frame
- Return type:
robot.jacob0(q)is the manipulator geometric Jacobian matrix which maps joint velocity to end-effector spatial velocity.
End-effector spatial velocity \(\nu = (v_x, v_y, v_z, \omega_x, \omega_y, \omega_z)^T\) is related to joint velocity by \({}^{0}\!\nu = \mathbf{J}_0(q) \dot{q}\).
Example:
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.jacob0([0, 0, 0, 0, 0, 0]) array([[ 0.15 , -0.4318, -0.4318, 0. , 0. , 0. ], [ 0.4521, 0. , 0. , 0. , 0. , 0. ], [ 0. , 0.4521, 0.0203, 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , -1. , -1. , 0. , -1. , 0. ], [ 1. , 0. , 0. , 1. , 0. , 1. ]])
Warning
This is the geometric Jacobian is as described in texts by Corke, Spong etal., Siciliano etal. The end-effector velocity is described in terms of translational and angular velocity, not a velocity twist as per the text by Lynch & Park.
Note
Tcan be passed in to save the cost of computing forward kinematics which is needed to transform velocity from end-effector frame to world frame.
- jacob0_analytical(q, representation=None, T=None)[source]
Manipulator Jacobian in world frame
- Parameters:
- Return J:
The manipulator analytical Jacobian in the world frame
- Return type:
Return the manipulator’s analytical Jacobian matrix which maps joint velocity to end-effector spatial velocity.
End-effector spatial velocity \(\nu_a = (v_x, v_y, v_z, \dot{\Gamma}_1, \dot{\Gamma}_2, \dot{\Gamma}_3)^T\) is related to joint velocity by \({}^{0}\!\nu_a = \mathbf{J}_{a,0}(q) \dot{q}\). Where \(\dvec{\Gamma} = (\dot{\Gamma}_1, \dot{\Gamma}_2, \dot{\Gamma}_3)\) is orientation rate expressed as one of:
representationRotational representation
'rpy/xyz'RPY angular rates in XYZ order
'rpy/zyx'RPY angular rates in XYZ order
'eul'Euler angular rates in ZYZ order
'exp'exponential coordinate rates
Example:
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.jacob0_analytical([0, 0, 0, 0, 0, 0], "rpy/xyz") array([[ 0.15 , -0.4318, -0.4318, 0. , 0. , 0. ], [ 0.4521, 0. , 0. , 0. , 0. , 0. ], [ 0. , 0.4521, 0.0203, 0. , 0. , 0. ], [ 1. , 0. , 0. , 1. , 0. , 1. ], [ 0. , -1. , -1. , 0. , -1. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ]])
Warning
The geometric Jacobian is as described in texts by Corke, Spong etal., Siciliano etal. The end-effector velocity is described in terms of translational and angular velocity, not a velocity twist as per the text by Lynch & Park.
Note
Tcan be passed in to save the cost of computing forward kinematics which is needed to transform velocity from end-effector frame to world frame.
- hessian0(q=None, J0=None, start=None, end=None)[source]
Manipulator Hessian in base frame
- Parameters:
- Returns:
Hessian matrix
- Return type:
This method calculates the Hessian in the base frame. One of
J0orqis required. IfJ0is already calculated for the joint coordinatesqit can be passed in to to save computation time.If we take the time derivative of the differential kinematic relationship
\[\begin{split}\nu &= \mat{J}(\vec{q}) \dvec{q} \\ \alpha &= \dmat{J} \dvec{q} + \mat{J} \ddvec{q}\end{split}\]where
\[\dmat{J} = \mat{H} \dvec{q}\]and \(\mat{H} \in \mathbb{R}^{6\times n \times n}\) is the Hessian tensor.
The elements of the Hessian are
\[\mat{H}_{i,j,k} = \frac{d^2 u_i}{d q_j d q_k}\]where \(u = \{t_x, t_y, t_z, r_x, r_y, r_z\}\) are the elements of the spatial velocity vector.
Similarly, we can write
\[\mat{J}_{i,j} = \frac{d u_i}{d q_j}\]- References:
Kinematic Derivatives using the Elementary Transform Sequence, J. Haviland and P. Corke
See also
jacob0(),jacob_dot
- delete_rne()[source]
Frees the memory holding the robot object in C if it has been initialised. Not normally needed — the destructor handles this automatically. Use as an explicit early-free escape hatch.
- Return type:
- rne(q, qd=None, qdd=None, gravity=None, fext=None, base_wrench=False)[source]
Inverse dynamics
- Parameters:
q (
Any) – Joint coordinatesqd (
Any) – Joint velocityqdd (
Any) – The joint accelerations of the robotgravity (
Any) – gravitational acceleration in the world frame, downwards gravitational force is equivalent to robot base acceleration upwards (positive); overrides robot’s gravity value if givenfext (
Any) – Specify wrench acting on the end-effector \(W=[F_x F_y F_z M_x M_y M_z]\)
- Return type:
tau = rne(q, qd, qdd, grav, fext)is the joint torque required for the robot to achieve the specified joint positionq(1xn), velocityqd(1xn) and accelerationqdd(1xn), where n is the number of robot joints.fextdescribes the wrench acting on the end-effectorTrajectory operation: If q, qd and qdd (mxn) are matrices with m cols representing a trajectory then tau (mxn) is a matrix with cols corresponding to each trajectory step.
Note
The torque computed contains a contribution due to armature inertia and joint friction.
If a model has no dynamic parameters set the result is zero.
See also
- rne_python(Q, QD=None, QDD=None, gravity=None, fext=None, debug=False, base_wrench=False)[source]
Compute inverse dynamics via recursive Newton-Euler formulation
- Parameters:
Q (
Any) – Joint coordinatesQD (
Any) – Joint velocityQDD (
Any) – Joint accelerationgravity (
Any) – gravitational acceleration in the world frame, downwards gravitational force is equivalent to robot base acceleration upwards (positive); defaults to attribute of selffext (
Any) – end-effector wrench, defaults to Nonedebug (
bool) – print debug information to console, defaults to Falsebase_wrench (
bool) – compute the base wrench, defaults to False
- Raises:
ValueError – for misshaped inputs
- Returns:
Joint force/torques
- Return type:
Recursive Newton-Euler for standard or modified Denavit-Hartenberg notation.
rne_python(q, qd, qdd)where the arguments have shape (n,) where n is the number of robot joints. The result has shape (n,).rne_python(q, qd, qdd)where the arguments have shape (m,n) where n is the number of robot joints and where m is the number of steps in the joint trajectory. The result has shape (m,n).rne_python(p)where the input is a 1D arrayp= [q, qd, qdd] with shape (3n,), and the result has shape (n,).rne_python(p)where the input is a 2D arrayp= [q, qd, qdd] with shape (m,3n) and the result has shape (m,n).
Note
This is a pure Python implementation and slower than the .rne() which is written in C.
This version supports symbolic model parameters
Verified against MATLAB code
See also
- property T: ndarray
Pose of the shape relative to its parent frame in the scene graph (or the world frame if it has no parent), as a 4x4 homogeneous transformation matrix. Set via the
poseargument of the constructor.This is a read/write property. The getter always returns a plain
ndarray; the setter also accepts anSE3.Warning
Because the getter returns an
ndarray, in-place operators likeshape.T *= deltado an elementwise multiply, not a pose composition, even whendeltais anSE3– useshape.T = shape.T * delta(orshape.T @= delta.A) instead.
- classmethod URDF(file, gripper=None, manufacturer=None)
Deprecated. Use
URDFRobotas a base class, or callURDF_read()fromroboticstoolbox.models.URDF.URDFRobotand constructRobotdirectly.- Return type:
- __getitem__(i)
Get link
This also supports iterating over each link in the robot object, from the base to the tool.
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> print(robot[1]) # print the 2nd link RevoluteDH: θ=q, d=0, a=0.4318, ⍺=0.0 >>> print([link.a for link in robot]) # print all the a_j values [0, 0.4318, 0.0203, 0, 0, 0]
Notes
Robotsupports link lookup by name,eg.
robot['link1']
- accel(q, qd, torque, gravity=None)
Compute acceleration due to applied torque
- Parameters:
q (
Any) – Joint coordinatesqd (
Any) – Joint velocitytorque (
Any) – Joint torques of the robotgravity (
Any) – gravitational acceleration in the world frame, downwards gravitational force is equivalent to robot base acceleration upwards (positive); if not supplied, uses thegravityattribute of self
- Returns:
Joint accelerations
- Return type:
qdd = accel(q, qd, torque)calculates a vector (n) of joint accelerations that result from applying the actuator force/torque (n) to the manipulator in stateq(n) andqd(n), andnis the number of robot joints.\[\ddot{q} = \mathbf{M}^{-1} \left(\tau - \mathbf{C}(q)\dot{q} - \mathbf{g}(q)\right)\]Trajectory operation
If
q,qd, torque are matrices (m,n) thenqddis a matrix (m,n) where each row is the acceleration corresponding to the equivalent rows of q, qd, torque.Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.accel(puma.qz, 0.5 * np.ones(6), np.zeros(6)) array([ -7.5544, -12.22 , -6.4022, -5.4303, -4.9518, -2.1178])
Notes
- Useful for simulation of manipulator dynamics, in
conjunction with a numerical integration function.
- Uses the method 1 of Walker and Orin to compute the forward
dynamics.
- Featherstone’s method is more efficient for robots with large
numbers of joints.
Joint friction is considered.
References
- Efficient dynamic computer simulation of robotic mechanisms,
M. W. Walker and D. E. Orin, ASME Journal of Dynamic Systems, Measurement and Control, vol. 104, no. 3, pp. 205-211, 1982.
- accel_x(q, xd, wrench, gravity=None, pinv=False, representation='rpy/xyz')
Operational space acceleration due to applied wrench
- Parameters:
q (
Any) – Joint coordinatesxd (
Any) – Operational space velocity of the end-effectorwrench (
Any) – Wrench applied to the end-effectorgravity (
Any) – gravitational acceleration in the world frame, downwards gravitational force is equivalent to robot base acceleration upwards (positive); if not supplied, uses thegravityattribute of selfpinv (
bool) – use pseudo inverse rather than inverserepresentation (
Literal['rpy/xyz','rpy/zyx','eul','exp']) – the type of analytical Jacobian to use, default is'rpy/xyz'
- Returns:
Operational space accelerations of the end-effector
- Return type:
xdd = accel_x(q, xd, wrench)is the operational space acceleration due towrenchapplied to the end-effector of a robot in joint configurationqand operational space velocityxd.\[\ddot{x} = \dot{\mathbf{J}}_a(q, \dot{q})\dot{q} + \mathbf{J}_a(q) \mathbf{M}(q)^{-1} \left( \mathbf{J}_a(q)^T w - \mathbf{C}(q)\dot{q} - \mathbf{g}(q) \right)\]Trajectory operation
If
qis a matrix (m,n), andxdandwrenchare matrices (m,6), thenxddis a matrix (m,6) where each row is the acceleration corresponding to the equivalent rows ofq,xd, andwrench.Notes
- Useful for simulation of manipulator dynamics, in
conjunction with a numerical integration function.
- Uses the method 1 of Walker and Orin to compute the forward
dynamics.
- Featherstone’s method is more efficient for robots with large
numbers of joints.
Joint friction is considered.
See also
- addconfiguration(name, q)
Add a named joint configuration
Add a named configuration to the robot instance’s dictionary of named configurations.
- Parameters:
- Return type:
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.addconfiguration_attr("mypos", [0.1, 0.2, 0.3, 0.4, 0.5, 0.6]) >>> robot.configs["mypos"] array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6])
See also
- addconfiguration_attr(name, q, unit='rad')
Add a named joint configuration as an attribute
- Parameters:
- Return type:
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.addconfiguration_attr("mypos", [0.1, 0.2, 0.3, 0.4, 0.5, 0.6]) >>> robot.mypos array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6]) >>> robot.configs["mypos"] array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6])
Notes
Used in robot model init method to store the
qrconfiguration- Dynamically adding attributes to objects can cause issues with
Python type checking.
- Configuration is also added to the robot instance’s dictionary of
named configurations.
See also
- attach(object)
Attach a child node
- Parameters:
object (
SceneNode) – the node to attach as a child of this node- Seealso:
- Return type:
- attach_to(object)
Attach this node to a parent node
- Parameters:
object (
SceneNode) – the node to attach this node to, this node will become a child of the parent- Seealso:
- Return type:
- property base: SE3
Get/set robot base transform
robot.baseis the robot base transformrobot.base = ...checks and sets the robot base transform
- property base_link: Link
Get the robot base link
robot.base_linkis the robot base link
- Returns:
the first link in the robot tree
- closest_point(q, shape, inf_dist=1.0, skip=False)
Find the closest point between robot and shape
- Parameters:
- Return type:
- Returns:
tuple of (distance, point on robot, point on shape)
closest_point(shape, inf_dist)returns the minimum euclidean distance between this robot and shape, provided it is less than inf_dist. It will also return the points on self and shape in the world frame which connect the line of length distance between the shapes. If the distance is negative then the shapes are collided.
- collided(q, shape, skip=False)
Check if the robot is in collision with a shape (deprecated)
- Parameters:
q (
ndarray|Sequence[float] |None) – joint configuration, or None for the current configurationshape (
Shape|Robot) – the external shape to check, or this robot itself for self-collision checkingskip (
bool) – Skip setting all shape transforms based on q, use this option if using this method in conjunction with Swift to save time
- Return type:
- Returns:
True if shapes have collided
robot.collided(q, shape)issues a warning and returns the result ofiscollided().- Seealso:
- property comment: str
Get/set robot comment
robot.commentis the robot commentrobot.comment = ...checks and sets the robot comment
- Parameters:
name – the new robot comment
- Returns:
robot comment
- property configs: dict[str, ndarray]
Named joint configurations
- Returns:
dictionary of joint configurations, such as
qrandqz, indexed by name
- property control_mode: str
Get/set robot control mode
robot.control_typeis the robot control moderobot.control_type = ...checks and sets the robot control mode
- Parameters:
control_mode – the new robot control mode
- Returns:
the current robot control mode
- copy()
Make a copy of the robot
- Return type:
- Returns:
a deep copy, which shares no state with the original
- coriolis(q, qd)
Coriolis and centripetal term
- Parameters:
- Returns:
Coriolis/centripetal velocity matrix
- Return type:
coriolis(q, qd)calculates the Coriolis/centripetal matrix (n,n) for the robot in configurationqand velocityqd, wherenis the number of joints.The product \(\mathbf{C} \dot{q}\) is the vector of joint force/torque due to velocity coupling. The diagonal elements are due to centripetal effects and the off-diagonal elements are due to Coriolis effects. This matrix is also known as the velocity coupling matrix, since it describes the disturbance forces on any joint due to velocity of all other joints.
Trajectory operation
If
qandqdare matrices (m,n), each row is interpreted as a joint configuration, and the result (n,n,m) is a 3d-matrix where each plane corresponds to a row ofqandqd.Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.coriolis(puma.qz, 0.5 * np.ones((6,))) array([[-0.4017, -0.5513, -0.2025, -0.0007, -0.0013, 0. ], [ 0.2023, -0.1937, -0.3868, -0. , -0.002 , 0. ], [ 0.1987, 0.193 , -0. , 0. , -0.0001, 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0.0007, 0.0007, 0.0001, 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ]])
Notes
- Joint viscous friction is also a joint force proportional to
velocity but it is eliminated in the computation of this value.
Computationally slow, involves \(n^2/2\) invocations of RNE.
- coriolis_x(q, qd, pinv=False, representation='rpy/xyz', J=None, Ji=None, Jd=None, C=None, Mx=None)
Operational space Coriolis and centripetal term
- Parameters:
q (
Any) – Joint coordinatesqd (
Any) – Joint velocitypinv (
bool) – use pseudo inverse rather than inverse (Default value = False)representation (
Literal['rpy/xyz','rpy/zyx','eul','exp']) – the type of analytical Jacobian to use, default is'rpy/xyz'J (
Any) – pre-computed analytical Jacobian (optional)Ji (
Any) – pre-computed inverse analytical Jacobian (optional)Jd (
Any) – pre-computed time-derivative of analytical Jacobian (optional)C (
Any) – pre-computed joint-space Coriolis matrix (optional)Mx (
Any) – pre-computed operational-space inertia matrix (optional)
- Returns:
Operational space velocity matrix
- Return type:
coriolis_x(q, qd)is the Coriolis/centripetal matrix (m,m) in operational space for the robot in configurationqand velocityqd, wherenis the number of joints.\[\mathbf{C}_x = \mathbf{J}(q)^{-T} \mathbf{C}(q, \dot{q}) \mathbf{J}(q)^{-1} - \mathbf{M}_x(q) \dot{\mathbf{J}}(q, \dot{q}) \mathbf{J}(q)^{-1}\]The product \(\mathbf{C} \dot{x}\) is the operational space wrench due to joint velocity coupling. This matrix is also known as the velocity coupling matrix, since it describes the disturbance forces on any joint due to velocity of all other joints.
The transformation to operational space requires an analytical, rather than geometric, Jacobian.
analyticalcan be one of:Value
Rotational representation
'rpy/xyz'RPY angular rates in XYZ order (default)
'rpy/zyx'RPY angular rates in XYZ order
'eul'Euler angular rates in ZYZ order
'exp'exponential coordinate rates
Trajectory operation
If
qandqdare matrices (m,n), each row is interpreted as a joint configuration, and the result is an array (m,6,6) where each matrix corresponds to a row ofqandqd.Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.coriolis_x(puma.qn, 0.5 * np.ones((6,))) array([[ 12.3365, 4.6387, 13.7633, -0.0409, 0.0043, -0.0409], [ -4.788 , -31430.2949, -3.4675, 0.3301, -0.3188, 0.3301], [ -11.5011, -1.7324, -10.0545, -0.0405, 0. , -0.0405], [ -0.0165, 4869725.6671, -0.0165, -0.3186, 0.0278, -0.3186], [ -0.1112, 0.0531, 0.1332, -0.0251, 0. , -0.0251], [ -0.0165, 4869725.6671, -0.0165, -0.3186, 0.0278, -0.3186]])
Notes
- Joint viscous friction is also a joint force proportional to
velocity but it is eliminated in the computation of this value.
Computationally slow, involves \(n^2/2\) invocations of RNE.
If the robot is not 6 DOF the
pinvoption is set True.pinv()is around 5x slower thaninv()
Warning
Assumes that the operational space has 6 DOF.
See also
- property default_backend: Any
Get default graphical backend
robot.default_backendGet the default graphical backend, used whenno explicit backend is passed to
Robot.plot. This is the value set for the robot, otherwise the value set for all robots byset_default_backend(), otherwiseNone.
robot.default_backend = ...Set the default graphical backend, used whenno explicit backend is passed to
Robot.plot. The default set here will be overridden if the particularRobotsubclass cannot support it.
- Returns:
backend name
- dfs_links(start, func=None)
A link search method
Visit all links from start in depth-first order and will apply func to each visited link
- dotfile(filename, etsbox=False, ets='full', jtype=False, static=True)
Write a link transform graph as a GraphViz dot file
The file can be processed using dot:
% dot -Tpng -o out.png dotfile.dot
The nodes are:
Base is shown as a grey square. This is the world frame origin, but can be changed using the
baseattribute of the robot.Link frames are indicated by circles
ETS transforms are indicated by rounded boxes
The edges are:
an arrow if
jtypeis False or the joint is fixedan arrow with a round head if
jtypeis True and the joint is revolutean arrow with a box head if
jtypeis True and the joint is prismatic
Edge labels or nodes in blue have a fixed transformation to the preceding link.
Notes
If
filenameis a file object then the file will not be closed after the GraphViz model is written.- Parameters:
file – Name of file to write to
etsbox (
bool) – Put the link ETS in a box, otherwise an edge labelets (
Literal['full','brief']) – Display the full ets with “full” or a brief version with “brief”jtype (
bool) – Arrowhead to node indicates revolute or prismatic typestatic (
bool) – Show static joints in blue and bold
- Return type:
See also
- dynamics()
Pretty print the dynamic parameters
The dynamic parameters (inertial and friction) are printed in a table, with one row per link.
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.dynamics() ┌───────┬───────┬─────────────────────────┬────────────────────────────────────────┬──────────┬───────────┬───────────────────┬───────┐ │ j │ m │ r │ I │ Jm │ B │ Tc │ G │ ├───────┼───────┼─────────────────────────┼────────────────────────────────────────┼──────────┼───────────┼───────────────────┼───────┤ │ link1 │ 0 │ 0, 0, 0 │ 0, 0.35, 0, 0, 0, 0 │ 0.0002 │ 0.00148 │ 0.395, -0.435 │ -62.6 │ │ link2 │ 17.4 │ -0.364, 0.006, 0.228 │ 0.13, 0.524, 0.539, 0, 0, 0 │ 0.0002 │ 0.000817 │ 0.126, -0.071 │ 108 │ │ link3 │ 4.8 │ -0.0203, -0.0141, 0.07 │ 0.066, 0.086, 0.0125, 0, 0, 0 │ 0.0002 │ 0.00138 │ 0.132, -0.105 │ -53.7 │ │ link4 │ 0.82 │ 0, 0.019, 0 │ 0.0018, 0.0013, 0.0018, 0, 0, 0 │ 3.3e-05 │ 7.12e-05 │ 0.0112, -0.0169 │ 76 │ │ link5 │ 0.34 │ 0, 0, 0 │ 0.0003, 0.0004, 0.0003, 0, 0, 0 │ 3.3e-05 │ 8.26e-05 │ 0.00926, -0.0145 │ 71.9 │ │ link6 │ 0.09 │ 0, 0, 0.032 │ 0.00015, 0.00015, 4e-05, 0, 0, 0 │ 3.3e-05 │ 3.67e-05 │ 0.00396, -0.0105 │ 76.7 │ └───────┴───────┴─────────────────────────┴────────────────────────────────────────┴──────────┴───────────┴───────────────────┴───────┘
- Return type:
- dynamics_list()
Print dynamic parameters
Display the kinematic and dynamic parameters to the console in reable format
- Return type:
- dynchanged(what=None)
Dynamic parameters have changed
Called from a property setter to inform the robot that the cache of dynamic parameters is invalid.
See also
roboticstoolbox.Link._dirties_frne()- Return type:
- fdyn(T, q0, Q=None, Q_args=None, qd0=None, solver='RK45', solver_args=None, dt=None, progress=False)
Integrate forward dynamics
- Parameters:
T (
float) – integration timeQ (
Callable[[Any,float,ndarray,ndarray],ndarray] |None) – a function that computes generalized joint force as a function of time and/or stateQ_args (
dict|None) – positional arguments passed totorqueqd0 (
ndarray|Sequence[float] |None) – initial joint velocities, assumed zero if not givensolver (
str) – name of SciPy integrator to use, default'RK45'solver_args (
dict|None) – optional arguments passed to the SciPy integratordt (
float|None) – if given, interpolate the results to this timestepprogress (
bool) – show progress bar, default False
- Returns:
robot trajectory
- Return type:
tg = R.fdyn(T, q)integrates the dynamics of the robot with zero input torques over the time interval 0 toTand returns the trajectory as a namedtuple with elements:tthe time vector (M,)qthe joint coordinates (M,n)qdthe joint velocities (M,n)
tg = R.fdyn(T, q, torqfun)as above but the torque applied to the joints is given by the provided function:tau = function(robot, t, q, qd, **args)
where the inputs are:
the robot object
current time
current joint coordinates (n,)
current joint velocity (n,)
args, optional keyword arguments can be specified, these are passed in from the
targskeyword argument.
The function must return a Numpy array (n,) of joint forces/torques.
Examples
To apply zero joint torque to the robot without Coulomb friction:
>>> def myfunc(robot, t, q, qd): >>> return np.zeros((robot.n,))
>>> tg = robot.nofriction().fdyn(5, q0, myfunc)
>>> plt.figure() >>> plt.plot(tg.t, tg.q) >>> plt.show()
We could also use a lambda function:
>>> tg = robot.nofriction().fdyn( >>> 5, q0, lambda r, t, q, qd: np.zeros((r.n,)))
The robot is controlled by a PD controller. We first define a function to compute the control which has additional parameters for the setpoint and control gains (qstar, P, D):
>>> def myfunc(robot, t, q, qd, qstar, P, D): >>> return (qstar - q) * P + qd * D # P, D are (6,)
>>> tg = robot.fdyn(10, q0, myfunc, torque_args=(qstar, P, D))
Many integrators have variable step length which is problematic if we want to animate the result. If
dtis specified then the solver results are interpolated in time steps ofdt.Notes
- This function performs poorly with non-linear joint friction,
such as Coulomb friction. The R.nofriction() method can be used to set this friction to zero.
- If the function is not specified then zero force/torque is
applied to the manipulator joints.
Interpolation is performed using SciPy integrate.ode
The SciPy RK45 integrator is used by default
Interpolation is performed using SciPy interp1d
See also
- fellipse(q, opt='trans', unit='rad', centre='ee', add=True)
Create a force ellipsoid object for plotting with PyPlot.
- Parameters:
q (
ndarray|Sequence[float]) – the joint configuration of the robotopt (
Literal['trans','rot']) –'trans'or'rot'— plot the translational or rotational force ellipsoidunit (
Literal['rad','deg']) –'rad'or'deg'centre (
Union[Literal['ee'],ndarray,Sequence[float]]) – centre of the ellipsoid —'ee'for the end-effector or a 3-vector[x, y, z]in the world frameadd (
bool) – ifTrue, add the ellipsoid to the active plot environment
- Returns:
an EllipsePlot object
- Return type:
EllipsePlot
robot.fellipse(q)creates a force ellipsoid for the robot at poseq. By default the ellipsoid is centered at the end-effector.Notes
By default the ellipsoid related to translational motion is drawn. Use
opt='rot'to draw the rotational velocity ellipsoid.By default the ellipsoid is drawn at the end-effector. The option
centreallows its origin to be set to the specified 3-vector, or the string"ee"ensures it is drawn at the end-effector position.
- fkine_geometry(q, robot_alpha=1.0, collision_alpha=0.0)
Compute the world-frame pose of every rendered geometry part
- Parameters:
- Returns:
one pose per geometry part, in the same order as
_to_dict()/_fk_dict()- Return type:
Pure with respect to
q– computed directly viafkine_all()and each geometry’s fixed local offset (geom._T, spatialgeometry’sSceneNode), not viaSceneNode._propogate_scene_tree()’s cached/mutated world transform. Intended for consumers (e.g. a Swift animation loop) that want link/geometry poses without needing a robot to carry live scene-graph state.Gripper geometry is included, using each gripper’s own current
.q(grippers keep their own separate joint state – not a parameter of this method, and not yet part of the pure-qcomputation this method provides for the main chain).
- friction(qd)
Manipulator joint friction
- Parameters:
qd (
ndarray) – The joint velocities of the robot- Returns:
The joint friction forces/torques for the robot
- Return type:
robot.friction(qd)is a vector of joint friction forces/torques for the robot moving with joint velocitiesqd.The friction model includes:
Viscous friction which is a linear function of velocity.
Coulomb friction which is proportional to sign(qd).
\[\begin{split}\tau_j = G^2 B \dot{q}_j + |G_j| \left\{ \begin{array}{ll} \tau_{C,j}^+ & \mbox{if $\dot{q}_j > 0$} \\ \tau_{C,j}^- & \mbox{if $\dot{q}_j < 0$} \end{array} \right.\end{split}\]Notes
- The friction value should be added to the motor output torque to
determine the nett torque. It has a negative value when qd > 0.
- The returned friction value is referred to the output of the
gearbox.
- The friction parameters in the Link object are referred to the
motor.
Motor viscous friction is scaled up by \(G^2\).
Motor Coulomb friction is scaled up by \(G\).
- The appropriate Coulomb friction value to use in the
non-symmetric case depends on the sign of the joint velocity, not the motor velocity.
- Coulomb friction is zero for zero joint velocity, stiction is
not modeled.
- The absolute value of the gear ratio is used. Negative gear
ratios are tricky: the Puma560 robot has negative gear ratio for joints 1 and 3.
See also
- get_path(end=None, start=None)
Find a path from start to end
- Parameters:
- Raises:
ValueError – link not known or ambiguous
- Return type:
- Returns:
the path from start to end
- Returns:
the number of joints in the path
- Returns:
the tool transform present after end
- graph(format='dot', filename=None, **kwargs)
Render a link transform graph as text
- Parameters:
format (
Literal['dot','mermaid','mermaid_fenced']) – graph output format:"dot","mermaid"or"mermaid_fenced", defaults to"dot"filename (
Union[str,IO[str],None]) – destination path or open text stream, defaults to Nonekwargs (
Any) – forformat="dot", forwarded todotfile()(etsbox,ets,jtype,static); ignored otherwise
- Return type:
- Returns:
rendered graph text
Creates graph text representing the robot’s link transform graph – the same structure
dotfile()/showgraph()render, in a choice of formats. Iffilenameis provided, the rendered text is also written to it."dot"produces the same GraphViz output asdotfile(), just returned as a string rather than requiring a real file –etsbox/ets/jtype/staticbehave exactly as they do there."mermaid"/"mermaid_fenced"render a simplified Mermaid flowchart: one node per link (a double circle for end-effectors, a hexagon for gripper links), edges labelled with the joint type (R/P) and joint index for actuated joints. Mermaid has no equivalent of DOT’s per-edge arrowhead/colour styling, sojtype/static/etsboxonly affect"dot"output."mermaid_fenced"wraps the same text in a fencedmermaidcode block, ready to paste into Markdown or render directly in a Jupyter cell:from IPython.display import Markdown, display display(Markdown(robot.graph(format="mermaid_fenced")))
See also
- property gravity: ndarray
Get/set default gravitational acceleration
robot.gravityis the default gravitational accelerationrobot.gravity = ...checks and sets default gravitationalacceleration
- gravload(q=None, gravity=None)
Compute gravity load
- Parameters:
- Returns:
The generalised joint force/torques due to gravity
- Return type:
robot.gravload(q)calculates the joint gravity loading (n) for the robot in the joint configurationqand using the default gravitational acceleration specified in the DHRobot object.robot.gravload(q, gravity=g)as above except the gravitational acceleration is explicitly specified asg.The return value is referenced to the load, not the motor, the gear ratio is not taken into account.
Trajectory operation
If q is a matrix (nxm) each column is interpreted as a joint configuration vector, and the result is a matrix (nxm) each column being the corresponding joint torques.
Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.gravload(puma.qz) array([ 0. , 37.4837, 0.2489, 0. , 0. , 0. ])
- gravload_x(q=None, gravity=None, pinv=False, representation='rpy/xyz', Ji=None)
Operational space gravity load
- Parameters:
q (
Any) – Joint coordinatesgravity (
Any) – gravitational acceleration in the world frame, downwards gravitational force is equivalent to robot base acceleration upwards (positive); if not supplied, uses thegravityattribute of selfpinv (
bool) – use pseudo inverse rather than inverse (Default value = False)representation (
Literal['rpy/xyz','rpy/zyx','eul','exp']) – the type of analytical Jacobian to use, default is'rpy/xyz'Ji (
Any) – pre-computed inverse analytical Jacobian (optional)
- Returns:
The operational space gravity wrench
- Return type:
robot.gravload_x(q)calculates the gravity wrench for the robot in the joint configurationqand using the default gravitational acceleration specified in the robot object.robot.gravload_x(q, gravity=g)as above except the gravitational acceleration is explicitly specified asg.\[\mathbf{G}_x = \mathbf{J}(q)^{-T} \mathbf{G}(q)\]The transformation to operational space requires an analytical, rather than geometric, Jacobian.
analyticalcan be one of:Value
Rotational representation
'rpy/xyz'RPY angular rates in XYZ order (default)
'rpy/zyx'RPY angular rates in XYZ order
'eul'Euler angular rates in ZYZ order
'exp'exponential coordinate rates
Trajectory operation
If q is a matrix (m,n), each row is interpreted as a joint configuration vector, and the result is a matrix (m,6) with one gravity wrench per row.
Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.gravload_x(puma.qn) array([-30.1218, 7.5797, 53.7378, -0. , -0.0283, -0. ])
Notes
If the robot is not 6 DOF the
pinvoption is set True.pinv()is around 5x slower thaninv()
Warning
Assumes that the operational space has 6 DOF.
See also
- property hascollision: Any
Robot has collision model
- Returns:
Robot has collision model
- Returns:
At least one link has associated collision model.
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.hascollision False
See also
- property hasdynamics: bool
Robot has dynamic parameters
- Returns:
True if at least one link has a non-zero mass or motor inertia
These are the parameters that the inertial dynamics need. It is false for a model of the kinematics only, such as the default
rtb.models.Panda, and the dynamics methodsgravload,inertia,coriolis,accel,fdyn,itorqueandrneraiseValueErrorfor such a model, rather than return zeros or a confusing error. It is any link and not all, since the first link of the DH Puma560 has a mass of zero.The answer is cached, and recomputed only when the mass or motor inertia of a link has been changed, so it costs nothing to ask.
Changed in version 1.5.0: This was true if any dynamic parameter had been assigned, even to zero, and was not reset when the parameters were set back to zero. A robot made from DH links with no masses reported True. The dynamics methods now raise
ValueErrorif it is False, where they returned zeros or raisedLinAlgError.Warning
Behaviour change. Scripts that call the dynamics methods on a kinematics-only model, and accept the zeros, now get a
ValueError.Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.hasdynamics True
- property hasgeometry: Any
Robot has geometry model
At least one link has associated mesh to describe its shape.
- Returns:
Robot has geometry model
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.hasgeometry True
See also
- hessiane(q=None, end=None, start=None, Je=None, tool=None)
Manipulator Hessian in the end-effector frame
- Overloads:
q (
ndarray|Sequence[float]) =..., end (str|Link|Gripper|None) =None, start (str|Link|Gripper|None) =None, Je (None) =None, tool (ndarray|SE3|None) =None→ndarrayq (
None) =None, end (str|Link|Gripper|None) =None, start (str|Link|Gripper|None) =None, Je (ndarray) =..., tool (ndarray|SE3|None) =None→ndarray
- Parameters:
q (
Any) – The joint angles/configuration of the robot (Optional, if not supplied will use the stored q values).end (
str|Link|Gripper|None) – the final link/Gripper which the Hessian representsstart (
str|Link|Gripper|None) – the first link which the Hessian representsJe (
Any) – The manipulator Jacobian in theendframetool (
ndarray|SE3|None) – a static tool transformation matrix to apply to the end of end, defaults to None
- Returns:
The manipulator Hessian in
endframe
The manipulator Hessian tensor maps joint acceleration to end-effector spatial acceleration, expressed in the
endcoordinate frame. This function calulcates this based on the ETS of the robot. One of J0 or q is required. Supply J0 if already calculated to save computation timeThis method computes the manipulator Hessian in the
endframe. If we take the time derivative of the differential kinematic relationship\[\begin{split}\nu &= \mat{J}(\vec{q}) \dvec{q} \\ \alpha &= \dmat{J} \dvec{q} + \mat{J} \ddvec{q}\end{split}\]where
\[\dmat{J} = \mat{H} \dvec{q}\]and \(\mat{H} \in \mathbb{R}^{6\times n \times n}\) is the Hessian tensor.
The elements of the Hessian are
\[\mat{H}_{i,j,k} = \frac{d^2 u_i}{d q_j d q_k}\]where \(u = \{t_x, t_y, t_z, r_x, r_y, r_z\}\) are the elements of the spatial velocity vector.
Similarly, we can write
\[\mat{J}_{i,j} = \frac{d u_i}{d q_j}\]Examples
The following example makes a
Pandarobot object, and solves for the end-effector frame Hessian at the given joint angle configuration>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda() >>> panda.hessiane([0, -0.3, 0, -2.2, 0, 2, 0.7854]) array([[[-0.4816, -0. , -0.4835, -0. , -0.1539, -0. , 0. ], [ 0. , -0.0796, 0. , -0.2466, 0. , -0.2006, 0. ], [-0.0483, -0. , -0.0485, -0. , -0.0154, -0. , 0. ], [ 0. , -0.995 , 0. , 0.995 , -0. , 0.995 , -0. ], [ 0. , 0. , 0.2955, -0. , -0.9463, -0. , -0.0998], [ 0. , -0.0998, 0. , 0.0998, -0. , 0.0998, 0. ]], [[-0. , -0.4896, -0. , 0.4715, -0. , 0.088 , 0. ], [-0.0796, 0. , 0. , -0. , 0. , -0. , 0. ], [-0. , 0.0309, 0. , 0.2952, 0. , 0.2104, -0. ], [ 0. , 0. , 0.9801, 0. , -0.4161, 0. , -1. ], [ 0. , 0. , -0. , -0. , 0. , -0. , 0. ], [ 0. , 0. , -0.1987, -0. , 0.9093, -0. , 0. ]], [[-0.4835, -0. , -0.4763, -0. , -0.1516, -0. , 0. ], [ 0. , 0. , 0. , -0.383 , 0. , -0.2237, 0. ], [-0.0485, 0. , 0.0965, -0. , 0.0307, -0. , 0. ], [ 0. , 0. , 0. , 0.9801, -0. , 0.9801, 0. ], [ 0. , 0. , 0. , -0. , -0.8085, -0. , 0.1987], [ 0. , 0. , 0. , -0.1987, -0. , -0.1987, -0. ]], [[-0. , 0.4715, -0. , -0.4715, 0. , -0.088 , 0. ], [-0.2466, -0. , -0.383 , 0. , -0. , 0. , -0. ], [-0. , 0.2952, -0. , -0.2952, -0. , -0.2104, 0. ], [ 0. , 0. , 0. , 0. , 0.4161, 0. , 1. ], [ 0. , 0. , 0. , 0. , -0. , 0. , -0. ], [ 0. , 0. , 0. , 0. , -0.9093, 0. , 0. ]], [[-0.1539, -0. , -0.1516, 0. , 0.0644, 0. , -0. ], [ 0. , 0. , 0. , -0. , -0. , 0.1676, -0. ], [-0.0154, 0. , 0.0307, -0. , -0.1407, -0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , -0.4161, -0. ], [ 0. , 0. , 0. , 0. , 0. , 0. , -0.9093], [ 0. , 0. , 0. , 0. , 0. , 0.9093, 0. ]], [[-0. , 0.088 , -0. , -0.088 , 0. , -0.088 , 0. ], [-0.2006, -0. , -0.2237, 0. , 0.1676, 0. , -0. ], [-0. , 0.2104, -0. , -0.2104, -0. , -0.2104, 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. , 1. ], [ 0. , 0. , 0. , 0. , 0. , 0. , -0. ], [ 0. , 0. , 0. , 0. , 0. , 0. , 0. ]], [[ 0. , 0. , 0. , 0. , -0. , 0. , 0. ], [ 0. , 0. , 0. , -0. , -0. , -0. , -0. ], [ 0. , -0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. , 0. ]]])
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
- hierarchy()
Pretty print the robot link hierarchy
- Return type:
- Returns:
Pretty print of the robot model
Examples
Makes a robot and prints the hierarchy
>>> import roboticstoolbox as rtb >>> robot = rtb.models.URDF.Panda() >>> robot.hierarchy() panda_link0 panda_link1 panda_link2 panda_link3 panda_link4 panda_link5 panda_link6 panda_link7 panda_link8 panda_hand panda_leftfinger panda_rightfinger
- ik_GN(Tep, end=None, start=None, q0=None, ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, pinv=True, pinv_damping=0.0, tool=None)
Fast numerical inverse kinematics by Gauss-Newton optimization
- Parameters:
Tep (
ndarray|SE3) – The desired end-effector pose (a single pose only, for a trajectory useikine_GN())end (
str|Link|Gripper|None) – the link considered as the end-effectorstart (
str|Link|Gripper|None) – the link considered as the base frame, defaults to the robots’s base frameq0 (
ndarray|None) – initial joint configuration (default to random valid joint configuration constrained by the joint limits of the robot)ilimit (
int) – maximum number of iterations per searchslimit (
int) – maximum number of search attemptstol (
float) – final error tolerancemask (
ndarray|None) – a mask vector which weights the end-effector error priority. Corresponds to translation in X, Y and Z and rotation about X, Y and Z respectivelyjoint_limits (
bool) – constrain the solution to being within the joint limits of the robot (reject solution with invalid joint configurations and perform another search up to the slimit)pinv (
int) – Use the pseudo-inverse instead of the normal matrix inversepinv_damping (
float) – Damping factor for the pseudo-inversetool (
ndarray|SE3|None) – a static tool transformation matrix to apply to the end ofend; defaults to the robot’s ownself.toolif not given
- Returns:
an IKSolution containing joint coordinates
q,successflag,iterations,searchesandresidualerror value (reasonis always empty – this fast C++ solver doesn’t produce a granular failure reason string, unlikeikine_GN())- Return type:
Warning
This method needs the compiled C++ extension. It raises
RuntimeErrorif the extension is unavailable, for example in a pure-Python wheel or under Pyodide/JupyterLite, and if the sequence has a SymPy parameter, even a numeric one such assympy.pi/2, or a joint with anoffset, which the compiled code cannot use. In all of these cases useikine_GN(), which has none of these limits.sol = ets.ik_GN(Tep)are the joint coordinates (n) corresponding to the robot end-effector poseTepwhich is anSE3orndarrayobject. This method can be used for robots with any number of degrees of freedom. This is a fast solver implemented in C++.See the Inverse Kinematics Docs Page for more details and for a tutorial on numerical IK, see here.
Note
When using this method with redundant robots (>6 DoF),
pinvmust be set toTrueThe return value
solis anIKSolutionwith fields:Field
Type
Description
qndarray(n)
joint coordinates in units of radians or metres
successbool
whether a solution was found
iterationsint
total number of iterations
searchesint
total number of searches
residualfloat
final value of cost function
reasonstr
always empty for this C++ solver
If
success == Falsetheqvalues will be valid numbers, but the solution will be in error. The amount of error is indicated by theresidual.Each iteration uses the Gauss-Newton optimisation method
\[\begin{split}\vec{q}_{k+1} &= \vec{q}_k + \left( {\mat{J}(\vec{q}_k)}^\top \mat{W}_e \ {\mat{J}(\vec{q}_k)} \right)^{-1} \bf{g}_k \\ \bf{g}_k &= {\mat{J}(\vec{q}_k)}^\top \mat{W}_e \vec{e}_k\end{split}\]where \(\mat{J} = {^0\mat{J}}\) is the base-frame manipulator Jacobian. If \(\mat{J}(\vec{q}_k)\) is non-singular, and \(\mat{W}_e = \mat{1}_n\), then the above provides the pseudoinverse solution. However, if \(\mat{J}(\vec{q}_k)\) is singular, the above can not be computed and the GN solution is infeasible.
Examples
The following example gets a
pandarobot object, makes a goal poseTep, and then solves for the joint coordinates which result in the poseTepusing theik_GNmethod.>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda() >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854]) >>> panda.ik_GN(Tep) IKSolution: q=[-1.081, -0.5328, 0.9086, -2.178, 0.4612, 1.902, 0.4239], success=True, iterations=98, searches=8, residual=2.8e-09
Notes
When using the this method, the initial joint coordinates \(q_0\), should correspond to a non-singular manipulator pose, since it uses the manipulator Jacobian.
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
See also
- ik_LM(Tep, end=None, start=None, q0=None, ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, k=1.0, method='chan', tool=None)
Fast Levenberg-Marquardt Numerical Inverse Kinematics Solver
- Parameters:
end (
str|Link|Gripper|None) – the link considered as the end-effectorstart (
str|Link|Gripper|None) – the link considered as the base frame, defaults to the robots’s base frameilimit (
int) – How many iterations are allowed within a search before a new search is startedslimit (
int) – How many searches are allowed before being deemed unsuccessfultol (
float) – Maximum allowed residual error Emask (
ndarray|None) – A 6 vector which assigns weights to Cartesian degrees-of-freedom error priorityjoint_limits (
bool) – Reject solutions with joint limit violationsk (
float) – Sets the gain value for the damping matrix Wn in the next iterationmethod (
Literal['chan','wampler','sugihara']) – One of “chan”, “sugihara” or “wampler”. Defines which method is used to calculate the damping matrix Wn in thestepmethodtool (
ndarray|SE3|None) – a static tool transformation matrix to apply to the end ofend; defaults to the robot’s ownself.toolif not given
- Returns:
an IKSolution containing joint coordinates
q,successflag,iterations,searchesandresidualerror value (reasonis always empty – this fast C++ solver doesn’t produce a granular failure reason string, unlikeikine_LM())- Return type:
Warning
This method needs the compiled C++ extension. It raises
RuntimeErrorif the extension is unavailable, for example in a pure-Python wheel or under Pyodide/JupyterLite, and if the sequence has a SymPy parameter, even a numeric one such assympy.pi/2, or a joint with anoffset, which the compiled code cannot use. In all of these cases useikine_LM(), which has none of these limits.A method which provides functionality to perform numerical inverse kinematics (IK) using the Levenberg-Marquardt method. This is a fast solver implemented in C++.
See the Inverse Kinematics Docs Page for more details and for a tutorial on numerical IK, see here.
The operation is defined by the choice of the
methodkwarg.The step is defined as
\[\begin{split}\vec{q}_{k+1} &= \vec{q}_k + \left( \mat{A}_k \right)^{-1} \bf{g}_k \\ % \mat{A}_k &= {\mat{J}(\vec{q}_k)}^\top \mat{W}_e \ {\mat{J}(\vec{q}_k)} + \mat{W}_n\end{split}\]where \(\mat{W}_n = \text{diag}(\vec{w_n})(\vec{w_n} \in \mathbb{R}^n_{>0})\) is a diagonal damping matrix. The damping matrix ensures that \(\mat{A}_k\) is non-singular and positive definite. The performance of the LM method largely depends on the choice of \(\mat{W}_n\).
Chan’s Method
Chan proposed
\[\mat{W}_n = λ E_k \mat{1}_n\]where λ is a constant which reportedly does not have much influence on performance. Use the kwarg
kto adjust the weighting term λ.Sugihara’s Method
Sugihara proposed
\[\mat{W}_n = E_k \mat{1}_n + \text{diag}(\hat{\vec{w}}_n)\]where \(\hat{\vec{w}}_n \in \mathbb{R}^n\), \(\hat{w}_{n_i} = l^2 \sim 0.01 l^2\), and \(l\) is the length of a typical link within the manipulator. We provide the variable
kas a kwarg to adjust the value of \(w_n\).Wampler’s Method
Wampler proposed \(\vec{w_n}\) to be a constant. This is set through the
kkwarg.Examples
The following example makes a
pandarobot object, makes a goal poseTep, and then solves for the joint coordinates which result in the poseTepusing theik_LMmethod.>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda() >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854]) >>> panda.ik_LM(Tep) IKSolution: q=[-1.881, 0.6738, 2.13, -2.162, -0.612, 1.822, 1.262], success=True, iterations=7, searches=1, residual=6.02e-09
Notes
The value for the
kkwarg will depend on themethodchosen and the arm you are using. Use the following as a rough guidechan, k = 1.0 - 0.01,wampler, k = 0.01 - 0.0001, andsugihara, k = 0.1 - 0.0001When using the this method, the initial joint coordinates \(q_0\), should correspond to a non-singular manipulator pose, since it uses the manipulator Jacobian.
This class supports null-space motion to assist with maximising manipulability and avoiding joint limits. These are enabled by setting kq and km to non-zero values.
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
See also
Changed in version 1.0.4: Merged the Levenberg-Marquardt IK solvers into the ik_LM method
- ik_NR(Tep, end=None, start=None, q0=None, ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, pinv=True, pinv_damping=0.0, tool=None)
Fast numerical inverse kinematics using Newton-Raphson optimization
- Parameters:
Tep (
ndarray|SE3) – The desired end-effector pose (a single pose only, for a trajectory useikine_NR())end (
str|Link|Gripper|None) – the link considered as the end-effectorstart (
str|Link|Gripper|None) – the link considered as the base frame, defaults to the robots’s base frameq0 (
ndarray|None) – initial joint configuration (default to random valid joint configuration constrained by the joint limits of the robot)ilimit (
int) – maximum number of iterations per searchslimit (
int) – maximum number of search attemptstol (
float) – final error tolerancemask (
ndarray|None) – a mask vector which weights the end-effector error priority. Corresponds to translation in X, Y and Z and rotation about X, Y and Z respectivelyjoint_limits (
bool) – constrain the solution to being within the joint limits of the robot (reject solution with invalid joint configurations and perform another search up to the slimit)pinv (
int) – Use the pseudo-inverse instead of the normal matrix inversepinv_damping (
float) – Damping factor for the pseudo-inversetool (
ndarray|SE3|None) – a static tool transformation matrix to apply to the end ofend; defaults to the robot’s ownself.toolif not given
- Returns:
an IKSolution containing joint coordinates
q,successflag,iterations,searchesandresidualerror value (reasonis always empty – this fast C++ solver doesn’t produce a granular failure reason string, unlikeikine_NR())- Return type:
Warning
This method needs the compiled C++ extension. It raises
RuntimeErrorif the extension is unavailable, for example in a pure-Python wheel or under Pyodide/JupyterLite, and if the sequence has a SymPy parameter, even a numeric one such assympy.pi/2, or a joint with anoffset, which the compiled code cannot use. In all of these cases useikine_NR(), which has none of these limits.sol = ets.ik_NR(Tep)are the joint coordinates (n) corresponding to the robot end-effector poseTepwhich is anSE3orndarrayobject. This method can be used for robots with any number of degrees of freedom. This is a fast solver implemented in C++.See the Inverse Kinematics Docs Page for more details and for a tutorial on numerical IK, see here.
Note
When using this method with redundant robots (>6 DoF),
pinvmust be set toTrueThe return value
solis anIKSolutionwith fields:Field
Type
Description
qndarray(n)
joint coordinates in units of radians or metres
successbool
whether a solution was found
iterationsint
total number of iterations
searchesint
total number of searches
residualfloat
final value of cost function
reasonstr
always empty for this C++ solver
If
success == Falsetheqvalues will be valid numbers, but the solution will be in error. The amount of error is indicated by theresidual.Each iteration uses the Newton-Raphson optimisation method
\[\vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k\]Examples
The following example gets a
pandarobot object, makes a goal poseTep, and then solves for the joint coordinates which result in the poseTepusing theik_NRmethod.>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda() >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854]) >>> panda.ik_NR(Tep) IKSolution: q=[-1.92, 0.6377, 2.149, -2.166, -0.5755, 1.843, 1.234], success=True, iterations=65, searches=6, residual=1.57e-08
Notes
When using the this method, the initial joint coordinates \(q_0\), should correspond to a non-singular manipulator pose, since it uses the manipulator Jacobian.
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
See also
- ikine_GN(Tep, end=None, start=None, q0=None, ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, seed=None, pinv=False, kq=0.0, km=0.0, ps=0.0, pi=0.3, tool=None, **kwargs)
Gauss-Newton Numerical Inverse Kinematics Solver
- Parameters:
Tep (
ndarray|SE3) – The desired end-effector pose or pose trajectoryend (
str|Link|Gripper|None) – the link considered as the end-effectorstart (
str|Link|Gripper|None) – the link considered as the base frame, defaults to the robots’s base frameq0 (
ndarray|Sequence[float] |None) – The initial joint coordinates, a vector (n,), or a matrix (m, n) whose rows are the starting points of the first m searches (any further searches start from random valid coordinates)ilimit (
int) – How many iterations are allowed within a search before a new search is startedslimit (
int) – How many searches are allowed before being deemed unsuccessfultol (
float) – Maximum allowed residual error Emask (
ndarray|Sequence[float] |None) – A 6 vector which assigns weights to Cartesian degrees-of-freedom error priorityjoint_limits (
bool) – Reject solutions with joint limit violationsseed (
int|None) – A seed for the private RNG used to generate random joint coordinate vectorspinv (
bool) – If True, will use the pseudoinverse in thestepmethod instead of the normal inversekq (
float) – The gain for joint limit avoidance. Setting to 0.0 will remove this completely from the solutionkm (
float) – The gain for maximisation. Setting to 0.0 will remove this completely from the solutionps (
float) – The minimum angle/distance (in radians or metres) in which the joint is allowed to approach to its limitpi (
ndarray|float) – The influence angle/distance (in radians or metres) in null space motion becomes activetool (
ndarray|SE3|None) – a static tool transformation matrix to apply to the end ofend; defaults to the robot’s ownself.toolif not given
- Returns:
an IKSolution containing joint coordinates
q,successflag,iterations,searches,residualerror value, andreasonstring if applicable- Return type:
If
Tepis a trajectory (anSE3with N poses, or an array with shape (N, 4, 4)) each pose is solved independently from the sameq0, so consecutive solutions are not guaranteed to be on the same IK branch.qhas shape (N, n),successis True only if every pose succeeded, andresidualis the maximum over the poses. Seesolve().Changed in version 1.5.0: For a trajectory,
residualis the maximum over the poses, it was the minimum.A method which provides functionality to perform numerical inverse kinematics (IK) using the Gauss-Newton method.
See the Inverse Kinematics Docs Page for more details and for a tutorial on numerical IK, see here.
Note
When using this method with redundant robots (>6 DoF),
pinvmust be set toTrueEach iteration uses the Gauss-Newton optimisation method
\[\begin{split}\vec{q}_{k+1} &= \vec{q}_k + \left( {\mat{J}(\vec{q}_k)}^\top \mat{W}_e \ {\mat{J}(\vec{q}_k)} \right)^{-1} \bf{g}_k \\ \bf{g}_k &= {\mat{J}(\vec{q}_k)}^\top \mat{W}_e \vec{e}_k\end{split}\]where \(\mat{J} = {^0\mat{J}}\) is the base-frame manipulator Jacobian. If \(\mat{J}(\vec{q}_k)\) is non-singular, and \(\mat{W}_e = \mat{1}_n\), then the above provides the pseudoinverse solution. However, if \(\mat{J}(\vec{q}_k)\) is singular, the above can not be computed and the GN solution is infeasible.
Examples
The following example gets a
pandarobot object, makes a goal poseTep, and then solves for the joint coordinates which result in the poseTepusing theikine_GNmethod.>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda() >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854]) >>> panda.ikine_GN(Tep) IKSolution: q=[-1.303, -0.7939, 0.5052, -2.203, 0.3968, 2.174, 0.7305], success=False, reason=iteration and search limit reached, 100 numpy.LinAlgError encountered, iterations=100, searches=100, residual=0.589
Notes
When using the this method, the initial joint coordinates \(q_0\), should correspond to a non-singular manipulator pose, since it uses the manipulator Jacobian.
This class supports null-space motion to assist with maximising manipulability and avoiding joint limits. These are enabled by setting kq and km to non-zero values.
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
See also
Changed in version 1.0.4: Added the Gauss-Newton IK solver method on the
Robotclass
- ikine_NR(Tep, end=None, start=None, q0=None, ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, seed=None, pinv=False, kq=0.0, km=0.0, ps=0.0, pi=0.3, tool=None, **kwargs)
Newton-Raphson Numerical Inverse Kinematics Solver
- Parameters:
Tep (
ndarray|SE3) – The desired end-effector pose or pose trajectoryend (
str|Link|Gripper|None) – the link considered as the end-effectorstart (
str|Link|Gripper|None) – the link considered as the base frame, defaults to the robots’s base frameq0 (
ndarray|Sequence[float] |None) – The initial joint coordinates, a vector (n,), or a matrix (m, n) whose rows are the starting points of the first m searches (any further searches start from random valid coordinates)ilimit (
int) – How many iterations are allowed within a search before a new search is startedslimit (
int) – How many searches are allowed before being deemed unsuccessfultol (
float) – Maximum allowed residual error Emask (
ndarray|Sequence[float] |None) – A 6 vector which assigns weights to Cartesian degrees-of-freedom error priorityjoint_limits (
bool) – Reject solutions with joint limit violationsseed (
int|None) – A seed for the private RNG used to generate random joint coordinate vectorspinv (
bool) – If True, will use the pseudoinverse in thestepmethod instead of the normal inversekq (
float) – The gain for joint limit avoidance. Setting to 0.0 will remove this completely from the solutionkm (
float) – The gain for maximisation. Setting to 0.0 will remove this completely from the solutionps (
float) – The minimum angle/distance (in radians or metres) in which the joint is allowed to approach to its limitpi (
ndarray|float) – The influence angle/distance (in radians or metres) in null space motion becomes activetool (
ndarray|SE3|None) – a static tool transformation matrix to apply to the end ofend; defaults to the robot’s ownself.toolif not given
- Returns:
an IKSolution containing joint coordinates
q,successflag,iterations,searches,residualerror value, andreasonstring if applicable- Return type:
If
Tepis a trajectory (anSE3with N poses, or an array with shape (N, 4, 4)) each pose is solved independently from the sameq0, so consecutive solutions are not guaranteed to be on the same IK branch.qhas shape (N, n),successis True only if every pose succeeded, andresidualis the maximum over the poses. Seesolve().Changed in version 1.5.0: For a trajectory,
residualis the maximum over the poses, it was the minimum.A method which provides functionality to perform numerical inverse kinematics (IK) using the Newton-Raphson method.
See the Inverse Kinematics Docs Page for more details and for a tutorial on numerical IK, see here.
Note
When using this method with redundant robots (>6 DoF),
pinvmust be set toTrueEach iteration uses the Newton-Raphson optimisation method
\[\vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k\]Examples
The following example gets a
pandarobot object, makes a goal poseTep, and then solves for the joint coordinates which result in the poseTepusing theikine_NRmethod.>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda() >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854]) >>> panda.ikine_NR(Tep) IKSolution: q=[-1.49, -0.7934, -2.586, -2.04, 1.404, 1.941, -0.05787], success=False, reason=iteration and search limit reached, 100 numpy.LinAlgError encountered, iterations=100, searches=100, residual=3.15
Notes
When using the this method, the initial joint coordinates \(q_0\), should correspond to a non-singular manipulator pose, since it uses the manipulator Jacobian.
This class supports null-space motion to assist with maximising manipulability and avoiding joint limits. These are enabled by setting kq and km to non-zero values.
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
See also
Changed in version 1.0.4: Added the Newton-Raphson IK solver method on the
Robotclass
- ikine_QP(Tep, end=None, start=None, q0=None, ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, seed=None, kj=1.0, ks=1.0, kq=0.0, km=0.0, ps=0.0, pi=0.3, tool=None, **kwargs)
Quadratic Programming Numerical Inverse Kinematics Solver
- Parameters:
Tep (
ndarray|SE3) – The desired end-effector pose or pose trajectoryend (
str|Link|Gripper|None) – the link considered as the end-effectorstart (
str|Link|Gripper|None) – the link considered as the base frame, defaults to the robots’s base frameq0 (
ndarray|Sequence[float] |None) – The initial joint coordinates, a vector (n,), or a matrix (m, n) whose rows are the starting points of the first m searches (any further searches start from random valid coordinates)ilimit (
int) – How many iterations are allowed within a search before a new search is startedslimit (
int) – How many searches are allowed before being deemed unsuccessfultol (
float) – Maximum allowed residual error Emask (
ndarray|Sequence[float] |None) – A 6 vector which assigns weights to Cartesian degrees-of-freedom error priorityjoint_limits (
bool) – Reject solutions with joint limit violationsseed (
int|None) – A seed for the private RNG used to generate random joint coordinate vectorskj (
float) – A gain for joint velocity norm minimisationks (
float) – A gain which adjusts the cost of slack (intentional error)kq (
float) – The gain for joint limit avoidance. Setting to 0.0 will remove this completely from the solutionkm (
float) – The gain for maximisation. Setting to 0.0 will remove this completely from the solutionps (
float) – The minimum angle/distance (in radians or metres) in which the joint is allowed to approach to its limitpi (
ndarray|float) – The influence angle/distance (in radians or metres) in null space motion becomes activetool (
ndarray|SE3|None) – a static tool transformation matrix to apply to the end ofend; defaults to the robot’s ownself.toolif not given
- Raises:
ImportError – If the package
qpsolversis not installed, see the note below- Returns:
an IKSolution containing joint coordinates
q,successflag,iterations,searches,residualerror value, andreasonstring if applicable- Return type:
If
Tepis a trajectory (anSE3with N poses, or an array with shape (N, 4, 4)) each pose is solved independently from the sameq0, so consecutive solutions are not guaranteed to be on the same IK branch.qhas shape (N, n),successis True only if every pose succeeded, andresidualis the maximum over the poses. Seesolve().Changed in version 1.5.0: For a trajectory,
residualis the maximum over the poses, it was the minimum.A method that provides functionality to perform numerical inverse kinematics (IK) using a quadratic programming approach.
Note
This needs the packages
qpsolversandquadprog, which are not installed with the Toolbox by default. Install them with theqpextra:pip install roboticstoolbox-python[qp].See the Inverse Kinematics Docs Page for more details and for a tutorial on numerical IK, see here.
Each iteration uses the following approach
\[\vec{q}_{k+1} = \vec{q}_{k} + \dot{\vec{q}}.\]where the QP is defined as
\[\begin{split}\min_x \quad f_o(\vec{x}) &= \frac{1}{2} \vec{x}^\top \mathcal{Q} \vec{x}+ \mathcal{C}^\top \vec{x}, \\ \text{subject to} \quad \mathcal{J} \vec{x} &= \vec{\nu}, \\ \mathcal{A} \vec{x} &\leq \mathcal{B}, \\ \vec{x}^- &\leq \vec{x} \leq \vec{x}^+\end{split}\]with
\[\begin{split}\vec{x} &= \begin{pmatrix} \dvec{q} \\ \vec{\delta} \end{pmatrix} \in \mathbb{R}^{(n+6)} \\ \mathcal{Q} &= \begin{pmatrix} \lambda_q \mat{1}_{n} & \mathbf{0}_{6 \times 6} \\ \mathbf{0}_{n \times n} & \lambda_\delta \mat{1}_{6} \end{pmatrix} \in \mathbb{R}^{(n+6) \times (n+6)} \\ \mathcal{J} &= \begin{pmatrix} \mat{J}(\vec{q}) & \mat{1}_{6} \end{pmatrix} \in \mathbb{R}^{6 \times (n+6)} \\ \mathcal{C} &= \begin{pmatrix} \mat{J}_m \\ \bf{0}_{6 \times 1} \end{pmatrix} \in \mathbb{R}^{(n + 6)} \\ \mathcal{A} &= \begin{pmatrix} \mat{1}_{n \times n + 6} \\ \end{pmatrix} \in \mathbb{R}^{(l + n) \times (n + 6)} \\ \mathcal{B} &= \eta \begin{pmatrix} \frac{\rho_0 - \rho_s} {\rho_i - \rho_s} \\ \vdots \\ \frac{\rho_n - \rho_s} {\rho_i - \rho_s} \end{pmatrix} \in \mathbb{R}^{n} \\ \vec{x}^{-, +} &= \begin{pmatrix} \dvec{q}^{-, +} \\ \vec{\delta}^{-, +} \end{pmatrix} \in \mathbb{R}^{(n+6)},\end{split}\]where \(\vec{\delta} \in \mathbb{R}^6\) is the slack vector, \(\lambda_\delta \in \mathbb{R}^+\) is a gain term which adjusts the cost of the norm of the slack vector in the optimiser, \(\dvec{q}^{-,+}\) are the minimum and maximum joint velocities, and \(\dvec{\delta}^{-,+}\) are the minimum and maximum slack velocities.
Examples
The following example gets a
pandarobot object, makes a goal poseTep, and then solves for the joint coordinates which result in the poseTepusing theikine_QPmethod.>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda() >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854]) >>> panda.ikine_QP(Tep) !! [RUNBLOCK-ERROR] robot/DHRobot.py:docstring of roboticstoolbox.robot.RobotKinematics.RobotKinematicsMixin.ikine_QP:3067 Install them using 'pip install roboticstoolbox-python[qp]'
Notes
When using the this method, the initial joint coordinates \(q_0\), should correspond to a non-singular manipulator pose, since it uses the manipulator Jacobian.
This class supports null-space motion to assist with maximising manipulability and avoiding joint limits. These are enabled by setting kq and km to non-zero values.
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
See also
Changed in version 1.0.4: Added the Quadratic Programming IK solver method on the
Robotclass
- inertia(q)
Manipulator inertia matrix
inertia(q)is the symmetric joint inertia matrix (n,n) which relates joint torque to joint acceleration for the robot at joint configuration q.Trajectory operation
If
qis a matrix (m,n), each row is interpreted as a joint state vector, and the result is a 3d-matrix (nxnxk) where each plane corresponds to the inertia for the corresponding row of q.Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.inertia(puma.qz) array([[ 3.9611, -0.1627, -0.1389, 0.0016, -0.0004, 0. ], [-0.1627, 4.4566, 0.3727, 0. , 0.0019, 0. ], [-0.1389, 0.3727, 0.9387, 0. , 0.0019, 0. ], [ 0.0016, 0. , 0. , 0.1924, 0. , 0. ], [-0.0004, 0.0019, 0.0019, 0. , 0.1713, 0. ], [ 0. , 0. , 0. , 0. , 0. , 0.1941]])
Notes
- The diagonal elements
M[j,j]are the inertia seen by joint actuator
j.
- The diagonal elements
- The off-diagonal elements
M[j,k]are coupling inertias that relate acceleration on joint
jto force/torque on jointk.
- The off-diagonal elements
- The diagonal terms include the motor inertia reflected through
the gear ratio.
See also
- inertia_x(q=None, pinv=False, representation='rpy/xyz', Ji=None)
Operational space inertia matrix
- Parameters:
- Returns:
The operational space inertia matrix
- Return type:
robot.inertia_x(q)is the operational space (Cartesian) inertia matrix which relates Cartesian force/torque to Cartesian acceleration at the joint configuration q.\[\mathbf{M}_x = \mathbf{J}(q)^{-T} \mathbf{M}(q) \mathbf{J}(q)^{-1}\]The transformation to operational space requires an analytical, rather than geometric, Jacobian.
analyticalcan be one of:Value
Rotational representation
'rpy/xyz'RPY angular rates in XYZ order (default)
'rpy/zyx'RPY angular rates in XYZ order
'eul'Euler angular rates in ZYZ order
'exp'exponential coordinate rates
Trajectory operation
If
qis a matrix (m,n), each row is interpreted as a joint state vector, and the result is a 3d-matrix (m,n,n) where each plane corresponds to the Cartesian inertia for the corresponding row ofq.Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.inertia_x(puma.qn) array([[17.2954, -2.7542, -9.6233, 0. , 0.2795, 0. ], [-2.7542, 11.6452, 1.2459, 0.0001, -0.0703, 0.0001], [-9.6233, 1.2459, 13.3348, 0. , 0.2767, 0. ], [ 0. , 0.0001, 0. , 0.1941, 0. , 0.1941], [ 0.2795, -0.0703, 0.2767, 0. , 0.1713, 0. ], [ 0. , 0.0001, 0. , 0.1941, 0. , 0.1941]])
Notes
If the robot is not 6 DOF the
pinvoption is set True.pinv()is around 5x slower thaninv()
Warning
Assumes that the operational space has 6 DOF.
See also
- iscollided(q, shape, skip=False)
Check if the robot is in collision with a shape
- Parameters:
q (
ndarray|Sequence[float] |None) – joint configuration, or None for the current configurationshape (
Shape|Robot) – the external shape to check, or this robot itself for self-collision checkingskip (
bool) – Skip setting all shape transforms based on q, use this option if using this method in conjunction with Swift to save time
- Return type:
- Returns:
True if shapes have collided
robot.iscollided(q, shape)checks for collision with an external shape.robot.iscollided(q, robot)callsisselfcollided().- Seealso:
- isprismatic(j)
Check if joint is prismatic
- Return type:
- Returns:
True if prismatic
Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.prismaticjoints [False, False, False, False, False, False] >>> stanford = rtb.models.DH.Stanford() >>> stanford.isprismatic(1) False
See also
- isrevolute(j)
Check if joint is revolute
- Return type:
- Returns:
True if revolute
Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.revolutejoints [True, True, True, True, True, True] >>> stanford = rtb.models.DH.Stanford() >>> stanford.isrevolute(1) True
See also
- isselfcollided(q=None, skip=False)
Check for collisions between non-adjacent links of this robot
- Parameters:
- Return type:
- Returns:
True if any non-adjacent link pair is in collision
- Raises:
ValueError – the model has no collision geometry, or
qis not a single finite joint configuration
Checks the collision geometry of the robot and all its grippers. Shapes attached to the same link, neighbouring links, and links in the same gripper are not tested against each other. Links without collision geometry are transparent when determining neighbours: a link’s nearest ancestor with collision geometry is its neighbour. Links in separate branches are tested, including siblings outside a shared gripper and links belonging to different grippers. Touching counts as a collision, as in
iscollided().Each gripper uses its own current joint configuration. The robot’s stored joint configuration is not changed. With
skip=True,qis ignored and the caller must have updated all world transforms.Collision checking requires the optional
coaldependency. A model with only visual geometry cannot be checked; collision geometry must be supplied explicitly. Only pairs with geometry are checked, so a False result does not establish clearance for links without geometry.- Seealso:
- itorque(q, qdd)
Inertia torque
- Parameters:
- Returns:
The inertia torque vector
- Return type:
itorque(q, qdd)is the inertia force/torque vector (n) at the specified joint configuration q (n) and acceleration qdd (n), andnis the number of robot joints. It is \(\mathbf{I}(q) \ddot{q}\).Trajectory operation
If
qandqddare matrices (m,n), each row is interpreted as a joint configuration, and the result is a matrix (m,n) where each row is the corresponding joint torques.Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.itorque(puma.qz, 0.5 * np.ones((6,))) array([1.8304, 2.3343, 0.5872, 0.0971, 0.0873, 0.0971])
Notes
- If the robot model contains non-zero motor inertia then this
will be included in the result.
See also
- jacob0_dot(q, qd, J0=None, representation=None)
Time derivative of manipulator Jacobian in frame {0}
- Overloads:
q (
ndarray|Sequence[float]), qd (ndarray|Sequence[float]), J0 (None) =None, representation (Optional[Literal['rpy/xyz','rpy/zyx','eul','exp']]) =None→ndarrayq (
None), qd (ndarray|Sequence[float]), J0 (ndarray) =..., representation (Optional[Literal['rpy/xyz','rpy/zyx','eul','exp']]) =None→ndarray
- Parameters:
q (
Any) – The joint configuration of the robot. Must be provided ifrepresentationis specified; may be omitted ifJ0is provided andrepresentationis not.qd (
ndarray|Sequence[float]) – The joint velocity of the robotJ0 (
Any) – Jacobian in {0} frame. Ignored ifrepresentationis specified; may be provided to save computation ifrepresentationis not specified.representation (
Optional[Literal['rpy/xyz','rpy/zyx','eul','exp']]) – Angular representation for analytical Jacobian (‘rpy/xyz’, ‘rpy/zyx’, ‘eul’, or ‘exp’)
- Returns:
The time derivative of the manipulator Jacobian
- Return type:
ndarray(6,n)
robot.jacob0_dot(q, qd)computes the rate of change of the manipulator Jacobian elements\[\dmat{J} = \frac{d \mat{J}}{d \vec{q}} \frac{d \vec{q}}{dt}\]where the first term is the rank-3 Hessian.
If
J0is already calculated for the joint coordinatesqit can be passed in to save computation time.For the geometric Jacobian (
representation=None), it is computed analytically as the mode-3 product of the Hessian tensor and the joint velocity vector:\[\dmat{J}_0 = \mathcal{H}_0 \times_3 \dot{\vec{q}}\]The derivative of an analytical Jacobian can be obtained by setting
representationasrepresentationRotational representation
'rpy/xyz'RPY angular rates in XYZ order
'rpy/zyx'RPY angular rates in ZYX order
'eul'Euler angular rates in ZYZ order
'exp'exponential coordinate rates
When
representationis specified, the Hessian of the analytical Jacobian is evaluated numerically using finite differences viaspatialmath.base.numhess()and contracted withqd. This is an approximate, numerical calculation and is slower than the closed-form geometric Jacobian derivative.Parameter interaction between representation,q, andJ0representationqJ0Behavior
Omitted /
NoneProvided
Omitted /
NoneGeometric Jacobian: computes \(\mat{J}_0\) and Hessian \(\mathcal{H}_0\) from
q, then \(\dmat{J}_0 = \mathcal{H}_0 \times_3 \dot{\vec{q}}\).Omitted /
NoneOmitted (or
None)Provided
Geometric Jacobian: reuses precomputed
J0to compute Hessian \(\mathcal{H}_0\), then \(\dmat{J}_0 = \mathcal{H}_0 \times_3 \dot{\vec{q}}\).Specified (e.g.
'rpy/xyz')Provided
Ignored
Analytical Jacobian: evaluates numerical Hessian via
spatialmath.base.numhess()atqand contracts withqd.Specified (e.g.
'rpy/xyz')Omitted (or
None)Any
Raises
ValueError(qis required to evaluate the analytical Jacobian).References
Kinematic Derivatives using the Elementary Transform Sequence, J. Haviland and P. Corke
See also
jacob0(),hessian0Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> q = robot.qn >>> qd = [0.1, -0.2, 0.3, -0.1, 0.2, -0.3] >>> j0_dot = robot.jacob0_dot(q, qd) >>> j0_dot.shape (6, 6) >>> (6, 6) (6, 6) >>> # If J0 is already computed, it can be passed in directly: >>> J0 = robot.jacob0(q) >>> j0_dot_fast = robot.jacob0_dot(None, qd, J0=J0) >>> import numpy as np >>> np.allclose(j0_dot, j0_dot_fast) True >>> True True
- jacobm(q=None, J=None, H=None, end=None, start=None, axes='all')
The manipulability Jacobian
- Overloads:
q (
ndarray|Sequence[float]) =..., J (None) =None, H (None) =None, end (str|Link|Gripper|None) =None, start (str|Link|Gripper|None) =None, axes (Union[Literal['all','trans','rot'],list[bool]]) ='all'→ndarrayq (
None) =None, J (ndarray) =..., H (ndarray) =..., end (str|Link|Gripper|None) =None, start (str|Link|Gripper|None) =None, axes (Union[Literal['all','trans','rot'],list[bool]]) ='all'→ndarray
- Parameters:
q (
Any) – The joint angles/configuration of the robot (Optional, if not supplied will use the stored q values).J (
Any) – The manipulator Jacobian in any frameH (
Any) – The manipulator Hessian in any frameend (
str|Link|Gripper|None) – the final link or Gripper which the Hessian representsstart (
str|Link|Gripper|None) – the first link which the Hessian represents
- Returns:
The manipulability Jacobian
This measure relates the rate of change of the manipulability to the joint velocities of the robot. One of J or q is required. Supply J and H if already calculated to save computation time.
Yoshikawa’s manipulability measure
\[m(\vec{q}) = \sqrt{\mat{J}(\vec{q}) \mat{J}(\vec{q})^T}\]This method returns its Jacobian with respect to configuration
\[\frac{\partial m(\vec{q})}{\partial \vec{q}}\]References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
- joint_velocity_damper(q=None, ps=0.05, pi=0.1, n=None, gain=1.0)
Compute the joint velocity damper for QP motion control
- Parameters:
ps (
float) – The minimum angle (in radians) in which the joint is allowed to approach to its limitpi (
float) – The influence angle (in radians) in which the velocity damper becomes activen (
int|None) – The number of joints to consider. Defaults to all jointsgain (
float) – The gain for the velocity damper
- Return type:
- Returns:
tuple of (Ain, Bin) inequality constraint matrices for an optimiser
Formulates an inequality constraint which, when optimised for will make it impossible for the robot to run into joint limits. Requires the joint limits of the robot to be specified. See examples/mmc.py for use case.
- jointdynamics(q, qd=None)
Transfer function of joint actuator
- Parameters:
- Returns:
transfer function denominators
- Return type:
tf = jointdynamics(qd, q)calculates a vector of n continuous-time transfer functions that represent the transfer function 1/(Js+B) for each joint based on the dynamic parameters of the robot and the configuration q (n). n is the number of robot joints. The result is a list of tuples (J, B) for each joint.tf = jointdynamics(q, qd)as above but include the linearized effects of Coulomb friction when operating at joint velocity QD (1xN).
- jtraj(q0, qf, t, qd0=None, qd1=None)
Joint-space trajectory between two joint configurations
- Parameters:
- Raises:
TypeError – if
q0orqfis anSE3- Return type:
- Returns:
trajectory
traj = robot.jtraj(q0, qf, t)is a trajectory object whose attributetraj.qis a row-wise joint-space trajectory, a quintic polynomial in time fromq0toqf. It is the method form ofjtraj().Deprecated since version 1.5.0: Passing
SE3poses forq0orqfis deprecated and now raisesTypeError. The poses were converted to joint coordinates by inverse kinematics, which is never simple: which solution is chosen depends on the solver and its starting point, and it can fail. Do that explicitly, so you control and can check it::q0 = robot.ikine_LM(T0, q0=robot.qr).q qf = robot.ikine_LM(Tf, q0=q0).q traj = robot.jtraj(q0, qf, t)
For a Cartesian trajectory see
ctraj().Changed in version 1.5.0: The arguments are joint coordinates only, they were named
T1andT2and could be poses. The**kwargsthat were passed to the inverse kinematics method are gone.
- property keywords: list[str]
Keywords that describe the robot
- Returns:
the keywords, which the model catalog can filter on
- link_collision_damper(shape, q, di=0.3, ds=0.05, xi=1.0, end=None, start=None, collision_list=None)
Compute a collision constrain for QP motion control
- Parameters:
ds (
float) – The minimum distance in which a joint is allowed to approach the collision object shapedi (
float) – The influence distance in which the velocity damper becomes activexi (
float) – The gain for the velocity damperstart (
Link|None) – The start link of the robot to considercollision_list (
list[Shape] |None) – A list of shapes to consider for collision
- Return type:
- Returns:
tuple of (Ain, Bin) inequality constraint matrices for an optimiser
Formulates an inequality constraint which, when optimised for will make it impossible for the robot to run into a collision. Requires See examples/neo.py for use case.
- linkcolormap(linkcolors='viridis')
Create a colormap for robot joints.
- Parameters:
linkcolors (
list[Any] |str) – list of colors or colormap name, defaults to"viridis"- Return type:
- Returns:
the color map
cm = robot.linkcolormap()is an n-element colormap that gives a unique color for every link. The RGBA colors for linkjarecm(j).cm = robot.linkcolormap(cmap)as above butcmapis the name of a valid matplotlib colormap. The default, example above, is theviridiscolormap.cm = robot.linkcolormap(list of colors)as above but a colormap is created from a list of n color names given as strings, tuples or hexstrings.
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> cm = robot.linkcolormap("inferno") >>> print(cm(range(6))) # cm(i) is 3rd color in colormap >>> cm = robot.linkcolormap( ... ['red', 'g', (0,0.5,0), '#0f8040', 'yellow', 'cyan']) >>> print(cm(range(6)))
Notes
Colormaps have 4-elements: red, green, blue, alpha (RGBA)
Names of supported colors and colormaps are defined in the matplotlib documentation.
- manipulability(q=None, J=None, end=None, start=None, method='yoshikawa', axes='all', **kwargs)
Manipulability measure
- Overloads:
q (
ndarray|Sequence[float]) =..., J (None) =None, end (str|Link|Gripper|None) =None, start (str|Link|Gripper|None) =None, method (Literal['yoshikawa','asada','minsingular','invcondition']) ='yoshikawa', axes (Union[Literal['all','trans','rot'],list[bool]]) ='all', **kwargs (Any) →float|ndarrayq (
None) =None, J (ndarray) =..., end (str|Link|Gripper|None) =None, start (str|Link|Gripper|None) =None, method (Literal['yoshikawa','asada','minsingular','invcondition']) ='yoshikawa', axes (Union[Literal['all','trans','rot'],list[bool]]) ='all', **kwargs (Any) →float|ndarray
- Parameters:
q (
Any) – Joint coordinates, one of J or q requiredJ (
Any) – Jacobian in base frame if already computed, one of J or q requiredmethod (
Literal['yoshikawa','asada','minsingular','invcondition']) – method to use, “yoshikawa” (default), “invcondition”, “minsingular” or “asada”axes (
Union[Literal['all','trans','rot'],list[bool]]) – Task space axes to consider: “all” [default], “trans”, or “rot”
- Returns:
manipulability index
manipulability(q)is the scalar manipulability index for the robot at the joint configurationq. It indicates dexterity, that is, how well conditioned the robot is for motion with respect to the 6 degrees of Cartesian motion. The values is zero if the robot is at a singularity.Various measures are supported:
"yoshikawa"– volume of the velocity ellipsoid, distance from singularity [Yoshikawa85]"invcondition"– inverse condition number of Jacobian, isotropy of the velocity ellipsoid [Klein87]"minsingular"– minimum singular value of the Jacobian, distance from singularity [Klein87]"asada"– isotropy of the task-space acceleration ellipsoid which is a function of the Cartesian inertia matrix which depends on the inertial parameters [Asada83]
Trajectory operation:
If
qis a matrix (m,n) then the result (m,) is a vector of manipulability indices for each joint configuration specified by a row ofq.Notes
Invokes the
jacob0method of the robot ifJis not passed- The “all” option includes rotational and translational
dexterity, but this involves adding different units. It can be more useful to look at the translational and rotational manipulability separately.
- Examples in the RVC book (1st edition) can be replicated by
using the “all” option
- Asada’s measure requires inertial a robot model with inertial
parameters.
References
[Yoshikawa85]Manipulability of Robotic Mechanisms. Yoshikawa T., The International Journal of Robotics Research. 1985;4(2):3-9. doi:10.1177/027836498500400201
[Asada83]A geometrical representation of manipulator dynamics and its application to arm design, H. Asada, Journal of Dynamic Systems, Measurement, and Control, vol. 105, p. 131, 1983.
Robotics, Vision & Control, Chap 8, P. Corke, Springer 2011.
Changed in version 1.0.3: Removed ‘both’ option for axes, added a custom list option.
- property manufacturer: Any
Get/set robot manufacturer’s name
robot.manufactureris the robot manufacturer’s namerobot.manufacturer = ...checks and sets the manufacturer’s name
- Returns:
robot manufacturer’s name
- property n: int
Number of joints
- Returns:
Number of joints
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.n 6
See also
- property name: str
Get/set robot name
robot.nameis the robot namerobot.name = ...checks and sets the robot name
- Parameters:
name – the new robot name
- Returns:
the current robot name
- property nlinks: Any
Number of links
The returned number is the total of both variable joints and static links
- Returns:
Number of links
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.nlinks 6
See also
- nofriction(coulomb=True, viscous=False)
Remove manipulator joint friction
- Parameters:
- Return type:
- Returns:
A copy of the robot with dynamic parameters perturbed
nofriction()copies the robot and returns a robot with the same link parameters except the Coulomb and/or viscous friction parameter are set to zero.See also
- partial_fkine0(q, n=3, end=None, start=None)
Manipulator Forward Kinematics nth Partial Derivative
- Parameters:
q (
ndarray|Sequence[float]) – The joint angles/configuration of the robot (Optional, if not supplied will use the stored q values).n (
int) – The derivative order, must be >= 3end (
str|Link|Gripper|None) – the final link/Gripper which the Hessian representsstart (
str|Link|Gripper|None) – the first link which the Hessian represents
- Return type:
- Returns:
The nth Partial Derivative of the forward kinematics
This method computes the nth derivative of the forward kinematics where
nis greater than or equal to 3. This is an extension of the differential kinematics where the Jacobian is the first partial derivative and the Hessian is the second.Examples
The following example makes a
Pandarobot object, and solves for the base-effector frame 4th defivative of the forward kinematics at the given joint angle configuration>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda() >>> panda.partial_fkine0([0, -0.3, 0, -2.2, 0, 2, 0.7854], n=4) array([[[[[ 0.484 , 0. , 0.486 , ..., 0.1547, -0. , 0. ], [-0. , -0.0796, -0. , ..., -0. , -0.2006, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 1. , 0. , ..., -0. , -1. , -0. ], [ 0. , 0. , 0.2955, ..., -0.9463, 0. , -0.0998], [ 0. , -0. , 0. , ..., -0. , 0. , -0. ]], [[ 0. , 0.484 , 0. , ..., 0. , -0.1086, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , -0. , -0. , ..., -0. , 0. , 0. ], [-1. , 0. , -0.9553, ..., 0.3233, -0. , 0.995 ], [-0. , 0. , 0. , ..., -0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[ 0.4624, 0. , 0.4643, ..., 0.1478, -0. , 0. ], [-0. , 0.067 , -0. , ..., -0. , -0.2237, 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0.9553, 0. , ..., -0. , -0.9553, -0. ], [-0.2955, -0. , 0. , ..., -0.8085, 0. , 0.1987], [-0. , -0. , 0. , ..., -0. , 0. , 0. ]], ..., [[-0.1565, -0. , -0.1571, ..., -0.05 , 0. , 0. ], [ 0. , -0.4323, 0. , ..., -0. , 0.1676, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0.3233, 0. , ..., 0. , 0.3233, -0. ], [ 0.9463, 0. , 0.8085, ..., 0. , 0. , -0.9093], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[ 0. , -0.484 , 0. , ..., -0. , 0.1086, 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , -0. , ..., 0. , 0. , 0. ], [ 1. , 0. , 0.9553, ..., -0.3233, 0. , -0.995 ], [-0. , -0. , -0. , ..., -0. , 0. , 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ]], [[-0.4816, -0. , -0.4835, ..., -0.1539, 0. , 0. ], [ 0. , 0.0309, 0. , ..., 0. , 0.2104, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0.995 , 0. , ..., 0. , 0.995 , 0. ], [ 0.0998, 0. , -0.1987, ..., 0.9093, -0. , 0. ], [ 0. , 0. , -0. , ..., 0. , -0. , 0. ]]], [[[ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [-0. , -0.0796, -0. , ..., -0. , -0.2006, 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [ 0. , -0. , 0.2955, ..., -0.9463, 0. , -0.0998]], [[-0. , 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , -0.0796, -0. , ..., -0. , -0.2006, 0. ], [-0.0796, -0. , 0. , ..., 0. , -0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [-0. , 0. , 0.2955, ..., -0.9463, 0. , -0.0998], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0.143 , -0. , -0.1436, ..., -0.0457, -0. , 0. ], [-0. , 0. , -0. , ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [-0. , -0.2955, 0. , ..., -0. , 0.2955, 0. ], [-0.2955, -0. , 0. , ..., -0. , 0. , 0. ]], ..., [[ 0. , 0. , -0. , ..., -0. , 0. , 0. ], [ 0.4581, 0. , 0.4599, ..., 0.1464, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.9463, 0. , ..., 0. , -0.9463, -0. ], [ 0.9463, 0. , 0. , ..., 0. , -0. , 0. ]], [[ 0. , -0. , 0. , ..., -0. , 0. , 0. ], [-0. , 0.0796, 0. , ..., 0. , 0.2006, 0. ], [ 0.0796, 0. , -0. , ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [-0. , -0. , -0.2955, ..., 0.9463, 0. , 0.0998], [-0. , -0. , -0. , ..., 0. , 0. , 0. ]], [[-0. , 0. , -0. , ..., -0. , -0. , 0. ], [ 0.0483, 0. , 0.0485, ..., 0.0154, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , -0. , 0. , ..., -0. , 0. , 0. ], [ 0. , 0.0998, -0. , ..., 0. , -0.0998, 0. ], [ 0.0998, 0. , 0. , ..., 0. , -0. , 0. ]]], [[[ 0.4624, 0. , 0.4643, ..., 0.1478, -0. , 0. ], [-0. , -0.0761, -0. , ..., -0. , -0.1916, 0. ], [-0.143 , -0. , -0.1436, ..., -0.0457, -0. , 0. ], [ 0. , 0.9553, 0. , ..., -0. , -0.9553, -0. ], [ 0. , 0. , 0.2823, ..., -0.904 , 0. , -0.0954], [ 0. , -0.2955, 0. , ..., 0. , 0.2955, 0. ]], [[ 0. , 0.4624, 0. , ..., 0. , -0.1037, 0. ], [-0. , -0. , -0.1436, ..., -0.0457, -0. , 0. ], [ 0. , 0.0091, 0. , ..., 0. , 0.1916, 0. ], [-0.9553, 0. , -0.9127, ..., 0.3089, -0. , 0.9506], [-0. , 0. , 0. , ..., -0. , 0.2955, 0. ], [ 0.2955, 0. , -0.2823, ..., 0.904 , -0. , 0.0954]], [[ 0.4418, 0. , 0.486 , ..., 0.1547, -0. , 0. ], [-0. , 0.064 , -0. , ..., -0. , -0.2137, 0. ], [-0.007 , 0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0.9127, 0. , ..., -0. , -1. , -0. ], [-0.2823, -0. , 0. , ..., -0.7724, 0. , 0.1898], [-0. , 0.2823, 0. , ..., -0. , 0. , 0. ]], ..., [[-0.1495, -0. , -0.286 , ..., -0.091 , 0. , 0. ], [ 0. , -0.413 , 0. , ..., -0. , 0.1601, 0. ], [ 0.0223, -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0.3089, 0. , ..., -0. , 0.5885, -0. ], [ 0.904 , 0. , 0.7724, ..., 0. , 0. , -0.8687], [-0. , -0.904 , 0. , ..., 0. , -0. , -0. ]], [[ 0. , -0.486 , 0. , ..., -0. , 0.0444, 0. ], [-0.143 , 0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0.067 , 0. , ..., 0. , -0. , 0. ], [ 0.9553, 0. , 1. , ..., -0.5885, 0. , -0.9801], [-0. , -0.2955, -0. , ..., -0. , 0. , 0. ], [-0.2955, 0. , -0. , ..., 0. , 0. , 0. ]], [[-0.4601, -0. , -0.4763, ..., -0.1516, 0. , 0. ], [ 0. , 0.0295, 0. , ..., 0. , 0.201 , 0. ], [ 0.0023, 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0.9506, 0. , ..., 0. , 0.9801, 0. ], [ 0.0954, -0. , -0.1898, ..., 0.8687, -0. , 0. ], [-0. , -0.0954, -0. , ..., 0. , -0. , 0. ]]], ..., [[[-0.1565, -0. , -0.1571, ..., -0.05 , 0. , 0. ], [ 0. , 0.0257, 0. , ..., 0. , 0.0648, 0. ], [ 0.4581, 0. , 0.4599, ..., 0.1464, 0. , 0. ], [ 0. , -0.3233, -0. , ..., 0. , 0.3233, 0. ], [ 0. , -0. , -0.0955, ..., 0.3059, -0. , 0.0323], [ 0. , 0.9463, -0. , ..., 0. , -0.9463, -0. ]], [[-0. , -0.1565, -0. , ..., -0. , 0.0351, 0. ], [ 0. , -0. , -0.0457, ..., 0.1464, 0. , 0. ], [-0. , 0.4066, -0. , ..., 0. , -0.0648, 0. ], [ 0.3233, 0. , 0.3089, ..., -0.1045, 0. , -0.3217], [ 0. , 0. , -0. , ..., 0. , -0.9463, -0. ], [-0.9463, 0. , -0.713 , ..., -0.3059, -0. , -0.0323]], [[-0.1495, -0. , -0.1366, ..., -0.091 , -0. , 0. ], [ 0. , -0.0217, 0. , ..., 0. , 0.0723, 0. ], [ 0.2994, 0. , 0.3028, ..., 0.1251, 0. , 0. ], [ 0. , -0.3089, 0. , ..., 0. , 0.5885, 0. ], [ 0.0955, 0. , 0. , ..., 0.2614, -0. , -0.0642], [ 0. , 0.713 , 0. , ..., 0. , -0.8085, -0. ]], ..., [[ 0.0506, 0. , 0.0075, ..., 0.1547, 0. , 0. ], [-0. , 0.1398, -0. , ..., -0. , -0.0542, 0. ], [ 0.2945, 0. , 0.2885, ..., -0. , -0. , 0. ], [-0. , 0.1045, -0. , ..., 0. , -1. , -0. ], [-0.3059, -0. , -0.2614, ..., 0. , 0. , 0.294 ], [-0. , 0.3059, -0. , ..., 0. , 0. , 0. ]], [[ 0. , 0.2318, 0. , ..., 0. , 0.1547, 0. ], [ 0.4581, 0. , 0.5056, ..., -0. , -0. , 0. ], [ 0. , -0.4323, 0. , ..., -0. , -0. , 0. ], [-0.3233, -0. , -0.5885, ..., 1. , 0. , 0.4161], [ 0. , 0.9463, 0. , ..., -0. , 0. , -0. ], [ 0.9463, 0. , 0.8085, ..., -0. , 0. , 0. ]], [[ 0.1557, 0. , 0.1518, ..., 0.0644, 0. , 0. ], [ 0. , -0.01 , 0. , ..., -0. , -0.068 , 0. ], [ 0.0311, -0. , 0.0304, ..., -0. , -0. , 0. ], [-0. , 0.3217, -0. , ..., 0. , -0.4161, 0. ], [-0.0323, 0. , 0.0642, ..., -0.294 , 0. , 0. ], [ 0. , 0.0323, 0. , ..., -0. , 0. , 0. ]]], [[[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0.0796, 0. , ..., 0. , 0.2006, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [ 0. , -0. , -0.2955, ..., 0.9463, 0. , 0.0998]], [[-0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , -0.2006, -0. , ..., 0. , 0.2006, 0. ], [-0.2006, -0. , -0.2237, ..., 0.1676, 0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [-0. , 0. , -0. , ..., -0. , 0. , 0.0998], [ 0. , 0. , -0. , ..., 0. , -0. , 0. ]], [[ 0. , 0.0593, 0. , ..., 0. , -0.0593, 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [ 0. , -0.0349, 0. , ..., 0. , 0.1916, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , -0.0295], [-0. , 0. , 0. , ..., -0. , 0. , 0. ], [ 0.2955, 0. , 0. , ..., 0.8085, -0. , 0.0954]], ..., [[-0. , -0.1898, -0. , ..., 0. , 0.1898, 0. ], [ 0. , -0. , 0. , ..., -0. , -0. , 0. ], [-0. , 0.3296, -0. , ..., -0. , -0.0648, 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0.0945], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [-0.9463, -0. , -0.8085, ..., 0. , 0. , -0.0323]], [[ 0. , -0. , 0. , ..., -0. , -0. , 0. ], [-0. , 0.2006, 0. , ..., -0. , -0.2006, 0. ], [ 0.2006, 0. , 0.2237, ..., -0.1676, -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [-0. , 0. , -0. , ..., -0. , 0. , -0.0998], [-0. , 0. , 0. , ..., -0. , 0. , -0. ]], [[-0. , -0.028 , -0. , ..., -0. , 0. , 0. ], [-0.0483, 0. , -0.0485, ..., -0.0154, -0. , 0. ], [ 0. , 0.0375, 0. , ..., -0. , 0. , 0. ], [ 0. , -0. , 0.0295, ..., -0.0945, 0. , 0. ], [ 0. , -0.0998, -0. , ..., 0. , 0.0998, 0. ], [-0.0998, -0. , -0.0954, ..., 0.0323, 0. , 0. ]]], [[[-0.4816, -0. , -0.4835, ..., -0.1539, 0. , 0. ], [ 0. , 0.0792, 0. , ..., 0. , 0.1996, 0. ], [ 0.0483, 0. , 0.0485, ..., 0.0154, 0. , 0. ], [ 0. , -0.995 , -0. , ..., 0. , 0.995 , 0. ], [ 0. , -0. , -0.294 , ..., 0.9416, -0. , 0.0993], [ 0. , 0.0998, -0. , ..., 0. , -0.0998, 0. ]], [[-0. , -0.4816, -0. , ..., -0. , 0.108 , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0. , -0.1101, -0. , ..., -0. , -0.41 , 0. ], [ 0.995 , 0. , 0.9506, ..., -0.3217, 0. , -0.99 ], [ 0. , 0. , -0. , ..., 0. , -0. , 0. ], [-0.0998, 0. , 0.4927, ..., -1.8509, 0. , -0.0993]], [[-0.4601, -0. , -0.4619, ..., -0.147 , 0. , 0. ], [ 0. , -0.0666, 0. , ..., 0. , 0.2226, 0. ], [-0.2385, -0. , -0.2394, ..., -0.0762, 0. , 0. ], [ 0. , -0.9506, 0. , ..., 0. , 0.9506, 0. ], [ 0.294 , 0. , 0. , ..., 0.8045, -0. , -0.1977], [ 0. , -0.4927, 0. , ..., 0. , 0.4927, 0. ]], ..., [[ 0.1557, 0. , 0.1563, ..., 0.0498, -0. , 0. ], [-0. , 0.4302, -0. , ..., 0. , -0.1667, 0. ], [ 0.8959, 0. , 0.8994, ..., 0.2863, 0. , 0. ], [-0. , 0.3217, -0. , ..., 0. , -0.3217, 0. ], [-0.9416, -0. , -0.8045, ..., 0. , -0. , 0.9048], [-0. , 1.8509, -0. , ..., 0. , -1.8509, -0. ]], [[-0. , 0.4816, -0. , ..., 0. , -0.108 , 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.1101, 0. , ..., 0. , 0.41 , 0. ], [-0.995 , -0. , -0.9506, ..., 0.3217, 0. , 0.99 ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0.0998, -0. , -0.4927, ..., 1.8509, 0. , 0.0993]], [[ 0.4792, 0. , 0.4811, ..., 0.1532, -0. , 0. ], [-0. , -0.0308, -0. , ..., -0. , -0.2093, 0. ], [ 0.0481, 0. , 0.0483, ..., 0.0154, 0. , 0. ], [-0. , 0.99 , -0. , ..., -0. , -0.99 , 0. ], [-0.0993, -0. , 0.1977, ..., -0.9048, 0. , 0. ], [-0. , 0.0993, -0. , ..., 0. , -0.0993, 0. ]]]], [[[[ 0. , 0.484 , 0. , ..., 0. , -0.1086, 0. ], [-0.0796, -0. , -0. , ..., -0. , -0. , 0. ], [-0. , -0. , -0. , ..., -0. , 0. , 0. ], [ 0. , 0. , -0.9553, ..., 0.3233, -0. , 0.995 ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ]], [[ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [-0. , -0.0796, -0. , ..., -0. , -0.2006, 0. ], [ 0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0.2955, ..., -0.9463, 0. , -0.0998], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ]], [[ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [-0.2191, -0. , -0.1436, ..., -0.0457, -0. , 0. ], [-0. , 0. , -0. , ..., -0. , 0. , 0. ], [ 0.9553, 0. , 0. , ..., -0. , -0. , 0. ], [-0. , -0.2955, 0. , ..., -0. , 0.2955, 0. ], [-0. , -0. , 0. , ..., 0. , 0. , 0. ]], ..., [[ 0. , -0. , -0. , ..., -0. , 0. , 0. ], [ 0.4838, 0. , 0.4599, ..., 0.1464, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0.3233, -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.9463, 0. , ..., 0. , -0.9463, -0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ]], [[-0. , -0. , 0. , ..., -0. , 0. , 0. ], [-0. , 0.0796, 0. , ..., 0. , 0.2006, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [-0. , -0. , -0.2955, ..., 0.9463, 0. , 0.0998], [-0. , -0. , -0. , ..., 0. , 0. , 0. ]], [[-0. , 0. , -0. , ..., -0. , 0. , 0. ], [ 0.1276, 0. , 0.0485, ..., 0.0154, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0.995 , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.0998, -0. , ..., 0. , -0.0998, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0. ]]], [[[ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [-0. , -0.0796, -0. , ..., -0. , -0.2006, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0.2955, ..., -0.9463, 0. , -0.0998], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ]], [[ 0. , 0.484 , 0. , ..., 0. , -0.1086, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0.0796, 0. , ..., 0. , 0.2006, 0. ], [ 0. , 0. , -0.9553, ..., 0.3233, -0. , 0.995 ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [ 0. , 0. , -0.2955, ..., 0.9463, -0. , 0.0998]], [[ 0.4154, 0. , 0.4643, ..., 0.1478, -0. , 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [ 0.2952, 0. , 0.1436, ..., 0.0457, 0. , 0. ], [ 0. , 0.9553, 0. , ..., -0. , -0.9553, -0. ], [-0.2955, -0. , 0. , ..., 0. , 0. , 0. ], [-0. , 0.2955, 0. , ..., 0. , -0.2955, -0. ]], ..., [[-0.0058, -0. , -0.1571, ..., -0.05 , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0.5095, -0. , -0.4599, ..., -0.1464, -0. , 0. ], [-0. , -0.3233, 0. , ..., 0. , 0.3233, -0. ], [ 0.9463, 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , -0.9463, -0. , ..., 0. , 0.9463, 0. ]], [[ 0. , -0.484 , 0. , ..., -0. , 0.1086, 0. ], [-0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0.0796, -0. , ..., -0. , -0.2006, 0. ], [ 0. , 0. , 0.9553, ..., -0.3233, 0. , -0.995 ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ], [-0. , 0. , 0.2955, ..., -0.9463, 0. , -0.0998]], [[-0.4657, -0. , -0.4835, ..., -0.1539, 0. , 0. ], [ 0. , -0. , 0. , ..., 0. , -0. , 0. ], [-0.2068, -0. , -0.0485, ..., -0.0154, -0. , 0. ], [-0. , -0.995 , 0. , ..., 0. , 0.995 , 0. ], [ 0.0998, 0. , -0. , ..., -0. , -0. , 0. ], [ 0. , -0.0998, 0. , ..., -0. , 0.0998, 0. ]]], [[[ 0. , 0.4624, 0. , ..., 0. , -0.1037, 0. ], [-0.2191, -0. , -0.1436, ..., -0.0457, -0. , 0. ], [ 0. , 0.0761, 0. , ..., 0. , 0.1916, 0. ], [ 0. , 0. , -0.9127, ..., 0.3089, -0. , 0.9506], [ 0. , -0.2955, 0. , ..., -0. , 0.2955, 0. ], [ 0. , -0. , -0.2823, ..., 0.904 , -0. , 0.0954]], [[-0.0235, 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , -0.067 , 0. , ..., 0. , 0.2237, 0. ], [ 0.0761, 0. , 0. , ..., 0. , 0. , 0. ], [-0. , 0. , -0. , ..., 0. , 0. , 0. ], [ 0.2955, 0. , 0. , ..., 0.8085, -0. , -0.1987], [ 0. , 0. , -0. , ..., 0. , 0. , -0. ]], [[-0. , 0. , 0. , ..., 0. , -0.0661, 0. ], [-0.2232, 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.2137, 0. ], [ 0.9127, 0. , 0. , ..., -0.2389, -0. , 0.0587], [-0. , -0. , 0. , ..., -0. , 0. , 0. ], [ 0.2823, 0. , 0. , ..., 0.7724, -0. , -0.1898]], ..., [[ 0. , -0.0644, -0. , ..., -0. , 0.0495, 0. ], [ 0.1154, -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.3914, -0. , ..., 0. , -0.1601, 0. ], [-0.3089, -0. , 0.2389, ..., 0. , 0. , -0.2687], [ 0. , -0.8085, 0. , ..., 0. , 0. , -0. ], [-0.904 , -0. , -0.7724, ..., -0. , -0. , 0.8687]], [[ 0. , -0. , 0. , ..., -0. , -0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , -0. , 0. , ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [-0.2955, 0. , -0. , ..., -0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[-0. , 0.0158, -0. , ..., -0. , 0.0622, 0. ], [ 0.2227, -0. , 0. , ..., 0. , 0. , 0. ], [-0. , -0.0962, -0. , ..., -0. , -0.201 , 0. ], [-0.9506, -0. , -0.0587, ..., 0.2687, 0. , 0. ], [-0. , 0.1987, -0. , ..., 0. , 0. , 0. ], [-0.0954, 0. , 0.1898, ..., -0.8687, 0. , 0. ]]], ..., [[[ 0. , -0.1565, -0. , ..., -0. , 0.0351, 0. ], [ 0.4838, 0. , 0.4599, ..., 0.1464, 0. , 0. ], [ 0. , -0.0257, 0. , ..., 0. , -0.0648, 0. ], [ 0. , -0. , 0.3089, ..., -0.1045, 0. , -0.3217], [ 0. , 0.9463, -0. , ..., 0. , -0.9463, -0. ], [ 0. , 0. , 0.0955, ..., -0.3059, -0. , -0.0323]], [[ 0.0754, -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.4323, 0. , ..., 0. , -0.1676, 0. ], [-0.0257, 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [-0.9463, 0. , -0.8085, ..., -0. , -0. , 0.9093], [-0. , 0. , -0. , ..., -0. , 0. , 0. ]], [[-0. , -0. , -0. , ..., -0. , 0.0495, 0. ], [ 0.3925, 0. , 0.3929, ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0.1601, 0. ], [-0.3089, -0. , 0. , ..., 0. , 0. , -0.2687], [ 0. , 0.8085, 0. , ..., 0. , 0. , -0. ], [-0.0955, 0. , 0. , ..., -0. , -0. , 0.8687]], ..., [[ 0. , 0. , 0. , ..., 0. , -0.1586, 0. ], [ 0.0668, 0. , 0.1251, ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.0542, 0. ], [ 0.1045, 0. , -0. , ..., 0. , -0. , 0.8605], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0.3059, 0. , 0. , ..., 0. , -0. , -0.294 ]], [[-0. , 0. , -0. , ..., -0. , 0. , 0. ], [ 0. , -0. , 0. , ..., 0. , -0. , 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [-0. , 0. , -0. , ..., 0. , 0. , 0. ], [ 0.9463, 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , -0.0724, 0. , ..., 0. , -0.1991, 0. ], [-0.4578, -0. , -0.4726, ..., 0. , -0. , 0. ], [-0. , 0.4401, -0. , ..., 0. , 0.068 , 0. ], [ 0.3217, 0. , 0.2687, ..., -0.8605, -0. , 0. ], [ 0. , -0.9093, 0. , ..., -0. , -0. , 0. ], [ 0.0323, -0. , -0.8687, ..., 0.294 , -0. , -0. ]]], [[[-0. , 0. , 0. , ..., 0. , -0. , 0. ], [-0. , 0.0796, 0. , ..., 0. , 0.2006, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , -0. , -0.2955, ..., 0.9463, 0. , 0.0998], [ 0. , -0. , -0. , ..., 0. , -0. , 0. ]], [[-0. , -0.484 , -0. , ..., -0. , 0.1086, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0.0796, -0. , ..., -0. , -0.2006, 0. ], [-0. , 0. , 0.9553, ..., -0.3233, 0. , -0.995 ], [ 0. , 0. , -0. , ..., 0. , -0. , -0. ], [ 0. , 0. , 0.2955, ..., -0.9463, 0. , -0.0998]], [[-0.5217, -0. , -0.5304, ..., -0.0983, -0. , 0. ], [ 0. , 0.0897, 0. , ..., -0. , 0.2237, 0. ], [ 0.0486, 0. , 0.0701, ..., -0.2058, 0. , 0. ], [ 0. , -0.9553, 0. , ..., 0. , 0.9553, 0. ], [ 0.2955, 0. , 0. , ..., 1.617 , -0. , -0.1987], [ 0. , -0.2955, 0. , ..., 0. , 0.2955, 0. ]], ..., [[ 0.3463, 0. , 0.3688, ..., -0.1086, 0. , 0. ], [-0. , 0.697 , -0. , ..., 0. , -0.1676, 0. ], [ 0.3932, 0. , 0.3875, ..., 0.2006, 0. , 0. ], [-0. , 0.3233, -0. , ..., 0. , -0.3233, 0. ], [-0.9463, -0. , -1.617 , ..., 0. , -0. , 0.9093], [-0. , 0.9463, -0. , ..., 0. , -0.9463, -0. ]], [[-0. , 0.484 , -0. , ..., 0. , -0.1086, 0. ], [-0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0.0796, 0. , ..., -0. , 0.2006, 0. ], [ 0. , -0. , -0.9553, ..., 0.3233, 0. , 0.995 ], [-0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , -0. , -0.2955, ..., 0.9463, 0. , 0.0998]], [[ 0.4937, 0. , 0.5059, ..., 0.1372, -0. , 0. ], [-0. , -0.2413, -0. , ..., 0. , 0. , 0. ], [-0.072 , -0. , -0.1741, ..., 0.1822, 0. , 0. ], [-0. , 0.995 , -0. , ..., -0. , -0.995 , 0. ], [-0.0998, 0. , 0.1987, ..., -0.9093, 0. , 0. ], [-0. , 0.0998, -0. , ..., 0. , -0.0998, 0. ]]], [[[-0. , -0.4816, -0. , ..., -0. , 0.108 , 0. ], [ 0.1276, 0. , 0.0485, ..., 0.0154, 0. , 0. ], [-0. , -0.0792, -0. , ..., -0. , -0.1996, 0. ], [ 0. , -0. , 0.9506, ..., -0.3217, 0. , -0.99 ], [ 0. , 0.0998, -0. , ..., 0. , -0.0998, 0. ], [ 0. , 0. , 0.294 , ..., -0.9416, 0. , -0.0993]], [[ 0.0079, -0. , 0. , ..., -0. , 0. , 0. ], [-0. , -0.0309, -0. , ..., -0. , -0.2104, 0. ], [-0.0792, -0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [-0.0998, 0. , 0.1987, ..., -0.9093, 0. , 0. ], [-0. , 0. , 0. , ..., -0. , 0. , -0. ]], [[-0. , -0. , -0. , ..., -0. , -0. , 0. ], [-0.0181, -0. , -0.0965, ..., -0.0307, 0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [-0.9506, -0. , 0. , ..., -0. , 0. , 0. ], [ 0. , -0.1987, 0. , ..., 0. , 0.1987, -0. ], [-0.294 , -0. , 0. , ..., -0. , 0. , 0. ]], ..., [[ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0.407 , 0. , 0.4419, ..., 0.1407, -0. , 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0.3217, 0. , 0. , ..., 0. , -0. , -0. ], [-0. , 0.9093, -0. , ..., 0. , -0.9093, 0. ], [ 0.9416, 0. , 0. , ..., 0. , -0. , -0. ]], [[-0.0079, 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , 0.0309, 0. , ..., 0. , 0.2104, 0. ], [ 0.0792, 0. , 0. , ..., 0. , 0. , 0. ], [-0. , 0. , -0. , ..., 0. , 0. , 0. ], [ 0.0998, -0. , -0.1987, ..., 0.9093, 0. , 0. ], [-0. , 0. , -0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0.0796, -0. , 0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0.99 , 0. , -0. , ..., 0. , -0. , 0. ], [-0. , 0. , 0. , ..., -0. , 0. , 0. ], [ 0.0993, 0. , -0. , ..., 0. , -0. , 0. ]]]], [[[[ 0.486 , 0. , 0.4643, ..., 0.1478, -0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0.2237, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0.9553, -0. ], [ 0. , 0. , 0. , ..., -0.8085, 0. , 0.1987], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0. , -0. , -0.1436, ..., -0.0457, -0. , 0. ], [-0. , -0. , -0. , ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , -0. ], [ 0. , 0. , 0. , ..., -0. , 0.2955, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0.4643, 0. , 0.486 , ..., 0.1547, -0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0.2137, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -1. , -0. ], [ 0. , 0. , 0. , ..., -0.7724, 0. , 0.1898], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ]], ..., [[-0.1571, -0. , -0.286 , ..., -0.091 , 0. , 0. ], [-0. , -0.3914, 0. , ..., -0. , 0.1601, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.5885, -0. ], [ 0.8085, 0. , 0.7724, ..., 0. , 0. , -0.8687], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[ 0. , -0.486 , 0. , ..., -0. , 0.0444, 0. ], [-0.143 , 0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0.9553, 0. , 1. , ..., -0.5885, -0. , -0.9801], [-0. , -0.2955, -0. , ..., -0. , 0. , 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ]], [[-0.4835, -0. , -0.4763, ..., -0.1516, 0. , 0. ], [ 0. , 0.0962, 0. , ..., 0. , 0.201 , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.9801, 0. ], [-0.1987, -0. , -0.1898, ..., 0.8687, -0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ]]], [[[ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [-0. , -0. , -0.1436, ..., -0.0457, -0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , -0. ], [ 0. , 0. , 0. , ..., -0. , 0.2955, 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ]], [[ 0.486 , 0. , 0.4643, ..., 0.1478, -0. , 0. ], [ 0. , -0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0. , 0.1436, ..., 0.0457, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0.9553, -0. ], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0.2955, -0. ]], [[ 0. , 0. , 0. , ..., 0. , -0.0661, 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.2137, 0. ], [ 0. , 0. , 0. , ..., -0.2389, -0. , 0.0587], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0.7724, -0. , -0.1898]], ..., [[ 0. , -0.0644, -0. , ..., -0. , 0.0495, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.3914, -0. , ..., 0. , -0.1601, 0. ], [ 0. , 0. , 0.2389, ..., 0. , 0. , -0.2687], [ 0. , 0. , 0. , ..., -0. , 0. , -0. ], [ 0. , -0. , -0.7724, ..., 0. , -0. , 0.8687]], [[-0.0471, -0. , 0. , ..., -0. , -0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0.2191, -0. , 0. , ..., -0. , 0. , 0. ], [ 0. , 0.9553, 0. , ..., -0. , 0. , -0. ], [-0.2955, -0. , -0. , ..., -0. , 0. , -0. ], [-0. , 0.2955, 0. , ..., 0. , 0. , -0. ]], [[-0. , 0.0158, -0. , ..., -0. , 0.0622, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0. , -0.0962, -0. , ..., -0. , -0.201 , 0. ], [ 0. , 0. , -0.0587, ..., 0.2687, 0. , 0. ], [-0. , -0. , -0. , ..., 0. , 0. , -0. ], [-0. , 0. , 0.1898, ..., -0.8687, 0. , 0. ]]], [[[ 0.4643, 0. , 0.486 , ..., 0.1547, -0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0.2137, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -1. , -0. ], [ 0. , 0. , 0. , ..., -0.7724, 0. , 0.1898], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , -0.0661, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.2137, 0. ], [ 0. , 0. , 0. , ..., -0.2389, -0. , 0.0587], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0.7724, -0. , -0.1898]], [[ 0.4435, 0. , 0.4643, ..., 0.1478, -0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0.2237, 0. ], [ 0.1372, 0. , 0.1436, ..., 0.0457, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0.9553, -0. ], [ 0. , 0. , 0. , ..., -0.8085, 0. , 0.1987], [ 0. , 0. , 0. , ..., -0. , -0.2955, -0. ]], ..., [[-0.0344, -0. , -0.2732, ..., -0.087 , 0. , 0. ], [-0. , -0.3929, 0. , ..., -0. , 0.1676, 0. ], [-0.0274, -0. , -0.0845, ..., -0.0269, 0. , 0. ], [ 0. , 0.2389, 0. , ..., 0. , 0.5622, -0. ], [ 0.7724, 0. , 0.8085, ..., 0. , 0. , -0.9093], [ 0. , -0.7724, 0. , ..., 0. , 0.1739, -0. ]], [[ 0. , -0.484 , 0. , ..., -0. , 0.0425, 0. ], [-0.2872, 0. , -0. , ..., -0. , -0. , 0. ], [-0. , -0.0796, 0. , ..., -0. , 0.0131, 0. ], [ 1. , 0. , 0.9553, ..., -0.5622, 0. , -0.9363], [-0. , -0. , -0. , ..., -0. , 0. , 0. ], [-0. , 0. , 0.2955, ..., -0.1739, 0. , -0.2896]], [[-0.4904, -0. , -0.455 , ..., -0.1448, 0. , 0. ], [ 0. , 0.0965, 0. , ..., 0. , 0.2104, 0. ], [-0.1476, -0. , -0.1407, ..., -0.0448, 0. , 0. ], [ 0. , -0.0587, 0. , ..., 0. , 0.9363, 0. ], [-0.1898, -0. , -0.1987, ..., 0.9093, -0. , 0. ], [-0. , 0.1898, 0. , ..., 0. , 0.2896, 0. ]]], ..., [[[-0.1571, -0. , -0.286 , ..., -0.091 , -0. , 0. ], [-0. , 0. , 0. , ..., 0. , 0.0723, 0. ], [ 0.3914, 0. , 0.3929, ..., 0.1251, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.5885, 0. ], [ 0. , -0. , 0. , ..., 0.2614, -0. , -0.0642], [ 0. , 0.8085, -0. , ..., 0. , -0.8085, -0. ]], [[-0. , -0.0644, -0. , ..., -0. , 0.0495, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.3914, -0. , ..., 0. , -0.1601, 0. ], [-0. , 0. , 0.2389, ..., 0. , 0. , -0.2687], [ 0. , 0. , -0. , ..., 0. , -0. , -0. ], [-0.8085, 0. , -0.7724, ..., 0. , -0. , 0.8687]], [[-0.2657, -0. , -0.3893, ..., -0.1239, -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.1316, 0. ], [ 0.3274, 0. , 0.2908, ..., 0.0926, 0. , 0. ], [-0. , -0.2389, 0. , ..., 0. , 0.8011, 0. ], [ 0. , 0. , 0. , ..., 0.4758, -0. , -0.1169], [ 0. , 0.7724, 0. , ..., 0. , -0.5985, -0. ]], ..., [[ 0.0508, 0. , 0.0555, ..., 0.1478, 0. , 0. ], [ 0. , 0.1874, -0. , ..., -0. , -0.0986, 0. ], [ 0.2737, 0. , 0.3901, ..., 0.0457, 0. , 0. ], [-0. , -0. , -0. , ..., 0. , -0.9553, -0. ], [-0.2614, -0. , -0.4758, ..., 0. , 0. , 0.5351], [-0. , -0. , -0. , ..., 0. , -0.2955, -0. ]], [[ 0. , 0.3492, 0. , ..., 0. , 0.1478, 0. ], [ 0.4141, 0. , 0.3929, ..., -0. , -0. , 0. ], [ 0. , -0.3445, 0. , ..., 0. , 0.0457, 0. ], [-0.5885, -0. , -0.8011, ..., 0.9553, 0. , 0.3976], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [ 0.8085, 0. , 0.5985, ..., 0.2955, 0. , 0.123 ]], [[ 0.2864, 0. , 0.2936, ..., 0.0615, 0. , 0. ], [ 0. , -0.0461, 0. , ..., -0. , -0.1238, 0. ], [ 0.0063, -0. , -0.0008, ..., 0.019 , 0. , 0. ], [-0. , 0.2687, -0. , ..., 0. , -0.3976, 0. ], [ 0.0642, 0. , 0.1169, ..., -0.5351, -0. , 0. ], [ 0. , -0.8687, 0. , ..., 0. , -0.123 , 0. ]]], [[[ 0. , -0.0235, 0. , ..., 0. , -0.0593, 0. ], [-0.143 , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0.0761, 0. , ..., 0. , 0.1916, 0. ], [ 0. , 0. , 0.0873, ..., -0.2797, -0. , -0.0295], [ 0. , -0.2955, -0. , ..., -0. , 0. , 0. ], [ 0. , -0. , -0.2823, ..., 0.904 , -0. , 0.0954]], [[-0.486 , -0. , -0.4643, ..., -0.1478, -0. , 0. ], [ 0. , -0.067 , 0. , ..., 0. , 0.2237, 0. ], [ 0. , -0. , -0.1436, ..., -0.0457, 0. , 0. ], [-0. , 0. , -0. , ..., 0. , 0.9553, 0. ], [ 0.2955, 0. , 0. , ..., 0.8085, -0. , -0.1987], [ 0. , 0. , 0. , ..., 0. , 0.2955, 0. ]], [[ 0. , 0.0198, 0. , ..., 0. , -0.0661, 0. ], [-0.1436, 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , -0.064 , 0. , ..., 0. , 0.2137, 0. ], [-0.0873, 0. , 0. , ..., -0.2389, -0. , 0.0587], [ 0. , -0. , 0. , ..., -0. , 0. , 0. ], [ 0.2823, -0. , 0. , ..., 0.7724, -0. , -0.1898]], ..., [[ 0. , -0.2899, -0. , ..., 0. , 0.2117, 0. ], [ 0.0685, -0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0.3252, -0. , ..., -0. , -0.0723, 0. ], [ 0.2797, -0. , 0.2389, ..., 0. , 0. , -0.188 ], [ 0. , -0.8085, 0. , ..., 0. , 0. , -0. ], [-0.904 , -0. , -0.7724, ..., 0. , 0. , 0.0642]], [[-0.0357, -0. , -0.0661, ..., 0.0495, -0. , 0. ], [-0. , 0.2237, 0. , ..., -0. , -0.2237, 0. ], [ 0.0486, 0. , 0.2137, ..., -0.1601, 0. , 0. ], [ 0. , -0.9553, 0. , ..., -0. , 0. , -0. ], [-0. , 0. , -0. , ..., -0. , 0. , 0.1987], [ 0. , -0.2955, 0. , ..., -0. , 0. , -0. ]], [[-0. , 0.049 , -0. , ..., -0. , 0. , 0. ], [ 0.0962, 0. , 0.0965, ..., 0.0307, -0. , 0. ], [-0. , -0.008 , 0. , ..., -0. , 0. , 0. ], [ 0.0295, -0. , -0.0587, ..., 0.188 , 0. , 0. ], [-0. , 0.1987, -0. , ..., 0. , -0.1987, 0. ], [-0.0954, -0. , 0.1898, ..., -0.0642, 0. , 0. ]]], [[[-0.4835, -0. , -0.4763, ..., -0.1516, -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.2226, 0. ], [-0.0962, 0. , -0.0965, ..., -0.0307, 0. , 0. ], [ 0. , -0. , 0. , ..., 0. , 0.9801, 0. ], [ 0. , -0. , 0. , ..., 0.8045, -0. , -0.1977], [ 0. , -0.1987, -0. , ..., 0. , 0.1987, 0. ]], [[-0. , 0.0158, -0. , ..., -0. , 0.0622, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [-0. , -0.0962, -0. , ..., -0. , -0.201 , 0. ], [ 0. , 0. , -0.0587, ..., 0.2687, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , -0. ], [ 0.1987, 0. , 0.1898, ..., -0.8687, 0. , 0. ]], [[-0.4335, -0. , -0.4265, ..., -0.1358, -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.2192, 0. ], [-0.2348, -0. , -0.233 , ..., -0.0742, 0. , 0. ], [-0. , 0.0587, 0. , ..., 0. , 0.8776, 0. ], [ 0. , -0. , 0. , ..., 0.7924, -0. , -0.1947], [ 0. , -0.1898, 0. , ..., 0. , 0.4794, 0. ]], ..., [[ 0.0262, 0. , 0.0234, ..., 0.0074, -0. , 0. ], [-0. , 0.3958, -0. , ..., 0. , -0.1642, 0. ], [ 0.8781, 0. , 0.8728, ..., 0.2779, 0. , 0. ], [-0. , -0.2687, -0. , ..., 0. , -0.0481, 0. ], [-0.8045, -0. , -0.7924, ..., 0. , -0. , 0.8912], [-0. , 0.8687, -0. , ..., 0. , -1.7961, -0. ]], [[-0. , 0.4586, -0. , ..., 0. , -0.1686, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0.1742, 0. , ..., 0. , 0.3976, 0. ], [-0.9801, -0. , -0.8776, ..., 0.0481, 0. , 0.9752], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [-0.1987, -0. , -0.4794, ..., 1.7961, 0. , 0.0978]], [[ 0.4811, 0. , 0.4739, ..., 0.1509, -0. , 0. ], [-0. , -0.0973, -0. , ..., -0. , -0.2062, 0. ], [ 0.0483, 0. , 0.0475, ..., 0.0151, 0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0.9752, 0. ], [ 0.1977, 0. , 0.1947, ..., -0.8912, 0. , 0. ], [-0. , -0. , -0. , ..., 0. , -0.0978, 0. ]]]], ..., [[[[ 0.1547, 0. , 0.1478, ..., -0.05 , 0. , 0. ], [-0. , -0. , -0. , ..., -0. , 0.1676, 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.3233, -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.9093], [ 0. , 0. , 0. , ..., 0. , -0. , -0. ]], [[ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [-0. , -0. , -0.0457, ..., 0.1464, 0. , 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , -0.9463, -0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0. ]], [[ 0.1478, 0. , 0.1547, ..., -0.091 , 0. , 0. ], [-0. , -0. , -0. , ..., -0. , 0.1601, 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.5885, -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.8687], [ 0. , 0. , 0. , ..., 0. , -0. , -0. ]], ..., [[-0.05 , -0. , -0.091 , ..., 0.1547, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0.0542, 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -1. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.294 ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0.2318, 0. , ..., 0. , 0.1547, 0. ], [ 0.4581, 0. , 0.5056, ..., -0. , -0. , 0. ], [ 0. , -0. , 0. , ..., -0. , -0. , 0. ], [-0.3233, -0. , -0.5885, ..., 1. , 0. , 0.4161], [-0. , 0.9463, -0. , ..., -0. , 0. , -0. ], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ]], [[-0.1539, -0. , -0.1516, ..., 0.0644, 0. , 0. ], [ 0. , -0.4401, 0. , ..., -0. , -0.068 , 0. ], [ 0. , -0. , -0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0.4161, 0. ], [ 0.9093, 0. , 0.8687, ..., -0.294 , 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ]]], [[[ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [-0. , -0. , -0.0457, ..., 0.1464, 0. , 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , -0.9463, -0. ], [ 0. , 0. , 0. , ..., 0. , -0. , -0. ]], [[ 0.1547, 0. , 0.1478, ..., -0.05 , 0. , 0. ], [ 0. , -0. , -0. , ..., 0. , 0. , 0. ], [-0. , 0. , 0.0457, ..., -0.1464, -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.3233, -0. ], [ 0. , 0. , 0. , ..., 0. , -0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0.9463, 0. ]], [[ 0. , 0. , 0. , ..., -0. , 0.0495, 0. ], [ 0. , 0. , -0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0.1601, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.2687], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0.8687]], ..., [[-0. , -0. , -0. , ..., 0. , -0.1586, 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [-0. , -0. , -0. , ..., 0. , 0.0542, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0.8605], [ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , -0.294 ]], [[-0.2358, -0. , -0.3049, ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [-0.4838, -0. , -0.5056, ..., 0. , 0. , 0. ], [-0. , -0.3233, -0. , ..., 0. , 0. , 0. ], [ 0.9463, 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , -0.9463, 0. , ..., 0. , 0. , 0. ]], [[ 0. , -0.0724, -0. , ..., 0. , -0.1991, 0. ], [ 0. , -0. , 0. , ..., 0. , -0. , 0. ], [-0. , 0.4401, -0. , ..., 0. , 0.068 , 0. ], [ 0. , 0. , 0.2687, ..., -0.8605, -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , -0. , -0.8687, ..., 0.294 , -0. , -0. ]]], [[[ 0.1478, 0. , 0.1547, ..., -0.091 , 0. , 0. ], [-0. , -0. , -0. , ..., -0. , 0.1601, 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.5885, -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.8687], [ 0. , 0. , 0. , ..., 0. , -0. , -0. ]], [[ 0. , 0. , 0. , ..., -0. , 0.0495, 0. ], [-0. , -0. , -0. , ..., -0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0.1601, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.2687], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0.8687]], [[ 0.1412, 0. , 0.1478, ..., -0.087 , 0. , 0. ], [-0. , -0. , -0. , ..., -0. , 0.1676, 0. ], [ 0.0437, 0. , 0.0457, ..., -0.0269, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.5622, -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.9093], [ 0. , 0. , 0. , ..., 0. , 0.1739, -0. ]], ..., [[-0.0478, -0. , -0.087 , ..., 0.1478, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0.0986, 0. ], [-0.0148, -0. , -0.0269, ..., 0.0457, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0.9553, -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.5351], [ 0. , 0. , 0. , ..., 0. , -0.2955, -0. ]], [[ 0. , 0.2849, 0. , ..., 0. , 0.1478, 0. ], [ 0.4141, 0. , 0.3929, ..., -0. , -0. , 0. ], [ 0. , 0.0469, 0. , ..., 0. , 0.0457, 0. ], [-0.5885, -0. , -0.5622, ..., 0.9553, 0. , 0.3976], [-0. , -0. , -0. , ..., -0. , 0. , 0. ], [ 0. , 0. , -0.1739, ..., 0.2955, 0. , 0.123 ]], [[-0.017 , -0. , -0.1448, ..., 0.0615, 0. , 0. ], [ 0. , -0.4419, 0. , ..., -0. , -0.1238, 0. ], [-0.0241, -0. , -0.0448, ..., 0.019 , 0. , 0. ], [ 0. , 0.2687, 0. , ..., 0. , -0.3976, 0. ], [ 0.8687, 0. , 0.9093, ..., -0.5351, -0. , 0. ], [ 0. , -0.8687, 0. , ..., 0. , -0.123 , 0. ]]], ..., [[[-0.05 , -0. , -0.091 , ..., 0.1547, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0.0542, 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -1. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.294 ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[-0. , -0. , -0. , ..., 0. , -0.1586, 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [-0. , -0. , -0. , ..., 0. , 0.0542, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0.8605], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , -0.294 ]], [[-0.0478, -0. , -0.087 , ..., 0.1478, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0.0986, 0. ], [-0.0148, -0. , -0.0269, ..., 0.0457, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0.9553, -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.5351], [ 0. , 0. , 0. , ..., 0. , -0.2955, -0. ]], ..., [[ 0.0162, 0. , 0.0294, ..., -0.05 , 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0.1676, 0. ], [ 0.0473, 0. , 0.0861, ..., -0.1464, -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0.3233, -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.9093], [ 0. , 0. , 0. , ..., 0. , 0.9463, 0. ]], [[ 0. , -0.484 , 0. , ..., -0. , -0.05 , 0. ], [ 0.2928, 0. , 0.2501, ..., 0. , 0. , 0. ], [-0. , -0.0796, -0. , ..., -0. , -0.1464, 0. ], [ 1. , 0. , 0.9553, ..., -0.3233, 0. , -0.1345], [-0. , -0. , -0. , ..., -0. , 0. , -0. ], [-0. , 0. , 0.2955, ..., -0.9463, 0. , -0.3938]], [[-0.3667, -0. , -0.4107, ..., -0.0208, 0. , 0. ], [ 0. , 0.2108, 0. , ..., -0. , 0.2104, 0. ], [ 0.4286, 0. , 0.4207, ..., -0.0609, -0. , 0. ], [ 0. , -0.8605, 0. , ..., 0. , 0.1345, 0. ], [-0.294 , -0. , -0.5351, ..., 0.9093, 0. , 0. ], [-0. , 0.294 , 0. , ..., -0. , 0.3938, 0. ]]], [[[ 0. , 0.0754, 0. , ..., 0. , 0.1898, 0. ], [ 0.4581, 0. , 0.5056, ..., -0. , -0. , 0. ], [-0. , -0.0257, -0. , ..., -0. , -0.0648, 0. ], [ 0. , -0. , -0.2797, ..., 0.8955, 0. , 0.0945], [ 0. , 0.9463, 0. , ..., -0. , 0. , -0. ], [ 0. , -0. , 0.0955, ..., -0.3059, 0. , -0.0323]], [[-0.1547, -0. , -0.1478, ..., 0.05 , 0. , 0. ], [ 0. , 0.4323, 0. , ..., 0. , -0.1676, 0. ], [ 0. , -0. , -0.0457, ..., 0.1464, 0. , 0. ], [ 0. , 0. , -0. , ..., 0. , -0.3233, 0. ], [-0.9463, 0. , -0.8085, ..., -0. , -0. , 0.9093], [ 0. , 0. , 0. , ..., -0. , -0.9463, -0. ]], [[ 0. , -0.0634, 0. , ..., 0. , 0.2117, 0. ], [ 0.3456, 0. , 0.3929, ..., -0. , -0. , 0. ], [-0. , 0.0217, -0. , ..., -0. , -0.0723, 0. ], [ 0.2797, 0. , 0. , ..., 0.7651, 0. , -0.188 ], [-0. , 0.8085, 0. , ..., -0. , 0. , -0. ], [-0.0955, -0. , 0. , ..., -0.2614, 0. , 0.0642]], ..., [[-0. , 0.4091, -0. , ..., -0. , -0.1586, 0. ], [ 0.1464, -0. , 0.1251, ..., 0. , 0. , 0. ], [ 0. , -0.1398, 0. , ..., -0. , 0.0542, 0. ], [-0.8955, -0. , -0.7651, ..., 0. , 0. , 0.8605], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0.3059, 0. , 0.2614, ..., 0. , 0. , -0.294 ]], [[ 0.501 , 0. , 0.5166, ..., -0.1586, 0. , 0. ], [ 0. , -0.1676, 0. , ..., 0. , 0.1676, 0. ], [ 0.3932, 0. , 0.4333, ..., 0.0542, -0. , 0. ], [-0. , 0.3233, -0. , ..., -0. , 0. , -0. ], [-0. , 0. , -0. , ..., -0. , 0. , -0.9093], [-0. , 0.9463, -0. , ..., -0. , 0. , 0. ]], [[-0. , -0.2116, -0. , ..., -0. , 0. , 0. ], [-0.4401, -0. , -0.4419, ..., -0.1407, 0. , 0. ], [ 0. , -0.0887, 0. , ..., 0. , 0. , 0. ], [-0.0945, -0. , 0.188 , ..., -0.8605, 0. , 0. ], [ 0. , -0.9093, 0. , ..., 0. , 0.9093, -0. ], [ 0.0323, 0. , -0.0642, ..., 0.294 , -0. , -0. ]]], [[[-0.1539, -0. , -0.1516, ..., 0.0644, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , -0.1667, 0. ], [ 0.4401, 0. , 0.4419, ..., 0.1407, 0. , 0. ], [ 0. , 0. , -0. , ..., 0. , -0.4161, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0.9048], [ 0. , 0.9093, -0. , ..., -0. , -0.9093, -0. ]], [[-0. , -0.0724, -0. , ..., -0. , -0.1991, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , 0.4401, 0. , ..., 0. , 0.068 , 0. ], [-0. , 0. , 0.2687, ..., -0.8605, -0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [-0.9093, 0. , -0.8687, ..., 0.294 , -0. , -0. ]], [[-0.2771, -0. , -0.2754, ..., 0.0199, 0. , 0. ], [ 0. , -0. , 0. , ..., 0. , -0.1642, 0. ], [ 0.375 , 0. , 0.3773, ..., 0.1534, 0. , 0. ], [ 0. , -0.2687, 0. , ..., 0. , -0.1288, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0.8912], [ 0. , 0.8687, 0. , ..., -0. , -0.9917, -0. ]], ..., [[ 0.4663, 0. , 0.4672, ..., 0.1123, 0. , 0. ], [-0. , 0. , -0. , ..., -0. , 0.0697, 0. ], [ 0.0034, -0. , 0.0006, ..., -0.1064, -0. , 0. ], [-0. , 0.8605, -0. , ..., 0. , -0.7259, -0. ], [ 0. , -0. , 0. , ..., 0. , 0. , -0.3784], [ 0. , -0.294 , 0. , ..., 0. , 0.6878, 0. ]], [[ 0. , -0.129 , 0. , ..., 0. , 0.2443, 0. ], [-0. , -0. , -0. , ..., -0. , -0. , 0. ], [ 0. , -0.4733, 0. , ..., -0. , -0.1515, 0. ], [ 0.4161, 0. , 0.1288, ..., 0.7259, 0. , -0.4141], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [ 0.9093, 0. , 0.9917, ..., -0.6878, 0. , -0.0415]], [[ 0.1532, 0. , 0.1509, ..., -0.0641, 0. , 0. ], [-0. , 0.4452, -0. , ..., 0. , 0.0876, 0. ], [ 0.0154, -0. , 0.0151, ..., -0.0064, -0. , 0. ], [-0. , -0. , -0. , ..., 0. , 0.4141, 0. ], [-0.9048, -0. , -0.8912, ..., 0.3784, -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0.0415, 0. ]]]], [[[[-0. , -0.1086, -0. , ..., 0. , 0.1086, 0. ], [-0.2006, -0. , -0.2237, ..., 0.1676, -0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.995 ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [-0. , -0.2006, -0. , ..., 0. , 0.2006, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.0998], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[-0. , -0.0444, -0. , ..., 0. , 0.0444, 0. ], [-0.1916, -0. , -0.2137, ..., 0.1601, -0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.9801], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ..., [[ 0. , -0.1547, 0. , ..., 0. , 0.1547, 0. ], [ 0.0648, 0. , 0.0723, ..., -0.0542, -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.4161], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [-0. , 0.2006, -0. , ..., -0. , -0.2006, 0. ], [ 0. , 0. , 0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.0998], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[-0. , -0.4016, 0. , ..., -0. , 0. , 0. ], [ 0.1512, 0. , 0.1741, ..., -0.1822, -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0.995 , 0. , 0.9801, ..., -0.4161, 0. , 0. ], [-0. , -0.0998, -0. , ..., 0. , 0.0998, 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ]]], [[[-0. , -0. , -0. , ..., 0. , 0. , 0. ], [-0. , -0.2006, -0. , ..., 0. , 0.2006, 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.0998], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[-0. , -0.1086, -0. , ..., 0. , 0.1086, 0. ], [-0. , -0. , -0. , ..., 0. , 0. , 0. ], [ 0. , 0.2006, 0. , ..., -0. , -0.2006, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.995 ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.0998]], [[-0.0593, -0. , -0.0661, ..., 0.0495, -0. , 0. ], [-0. , 0. , -0. , ..., 0. , 0. , 0. ], [ 0.1916, 0. , 0.2137, ..., -0.1601, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], ..., [[ 0.1898, 0. , 0.2117, ..., -0.1586, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [-0.0648, -0. , -0.0723, ..., 0.0542, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[-0. , 0.1086, -0. , ..., -0. , -0.1086, 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [ 0. , -0.2006, 0. , ..., 0. , 0.2006, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.995 ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.0998]], [[ 0.4937, 0. , 0.5059, ..., 0.1372, -0. , 0. ], [-0. , -0. , 0. , ..., -0. , 0. , 0. ], [-0.072 , -0. , -0.1741, ..., 0.1822, 0. , 0. ], [ 0. , 0.995 , 0. , ..., -0. , -0.995 , 0. ], [-0.0998, -0. , 0. , ..., 0. , 0. , 0. ], [-0. , 0.0998, 0. , ..., -0. , -0.0998, 0. ]]], [[[-0. , -0.0444, -0. , ..., 0. , 0.0444, 0. ], [-0.1916, -0. , -0.2137, ..., 0.1601, -0. , 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.9801], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[-0.0593, -0. , -0.0661, ..., 0.0495, -0. , 0. ], [-0. , -0. , -0. , ..., 0. , -0. , 0. ], [ 0.1916, 0. , 0.2137, ..., -0.1601, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[-0. , -0.0425, -0. , ..., 0. , 0.0425, 0. ], [-0.2006, -0. , -0.2237, ..., 0.1676, -0. , 0. ], [ 0. , -0.0131, 0. , ..., 0. , 0.0131, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.9363], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.2896]], ..., [[ 0. , -0.1478, 0. , ..., 0. , 0.1478, 0. ], [ 0.118 , 0. , 0.1316, ..., -0.0986, -0. , 0. ], [-0. , -0.0457, -0. , ..., 0. , 0.0457, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.3976], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.123 ]], [[-0. , 0. , -0. , ..., 0. , -0. , 0. ], [-0. , 0.2237, -0. , ..., -0. , -0.2237, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.1987], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[-0. , -0.3903, 0. , ..., -0. , 0. , 0. ], [ 0.1481, 0. , 0.3158, ..., -0.1335, -0. , 0. ], [-0. , -0.052 , 0. , ..., -0. , -0. , 0. ], [ 0.9801, 0. , 0.9363, ..., -0.3976, 0. , 0. ], [-0. , -0. , -0. , ..., -0. , -0.1987, 0. ], [-0. , 0. , 0.2896, ..., -0.123 , 0. , 0. ]]], ..., [[[ 0. , -0.1547, 0. , ..., 0. , 0.1547, 0. ], [ 0.0648, 0. , 0.0723, ..., -0.0542, -0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.4161], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[ 0.1898, 0. , 0.2117, ..., -0.1586, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , -0. , 0. ], [-0.0648, -0. , -0.0723, ..., 0.0542, 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , -0.1478, 0. , ..., 0. , 0.1478, 0. ], [ 0.118 , 0. , 0.1316, ..., -0.0986, -0. , 0. ], [-0. , -0.0457, -0. , ..., 0. , 0.0457, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.3976], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.123 ]], ..., [[-0. , 0.05 , -0. , ..., 0. , -0.05 , 0. ], [-0.2006, -0. , -0.2237, ..., 0.1676, 0. , 0. ], [ 0. , 0.1464, 0. , ..., -0. , -0.1464, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.1345], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.3938]], [[ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0.1676, 0. , ..., 0. , 0.1676, 0. ], [-0. , 0. , -0. , ..., 0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.9093], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[-0. , 0.173 , -0. , ..., -0. , 0. , 0. ], [-0.0989, -0. , -0.0624, ..., -0.0709, 0. , 0. ], [ 0. , -0.0501, 0. , ..., 0. , 0. , 0. ], [-0.4161, -0. , -0.3976, ..., 0.1345, 0. , 0. ], [ 0. , 0. , -0. , ..., 0. , 0.9093, -0. ], [ 0. , -0. , -0.123 , ..., 0.3938, -0. , -0. ]]], [[[-0. , 0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0.2006, -0. , ..., -0. , -0.2006, 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.0998], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], [[-0. , 0.1086, -0. , ..., -0. , -0.1086, 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [ 0. , -0.2006, 0. , ..., 0. , 0.2006, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.995 ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.0998]], [[-0. , 0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0.2237, -0. , ..., -0. , -0.2237, 0. ], [ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0.1987], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ]], ..., [[ 0. , -0. , 0. , ..., 0. , 0. , 0. ], [ 0. , -0.1676, 0. , ..., 0. , 0.1676, 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.9093], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , -0.1086, 0. , ..., 0. , 0.1086, 0. ], [-0. , 0. , -0. , ..., -0. , -0. , 0. ], [-0. , 0.2006, -0. , ..., -0. , -0.2006, 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.995 ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , -0.0998]], [[-0.5217, -0. , -0.5282, ..., -0.1205, 0. , 0. ], [ 0. , 0.2413, 0. , ..., -0. , -0. , 0. ], [ 0.3508, 0. , 0.3966, ..., -0.3489, -0. , 0. ], [ 0. , -0.995 , 0. , ..., 0. , 0.995 , 0. ], [ 0.0998, 0. , -0.1987, ..., 0.9093, -0. , 0. ], [ 0. , -0.0998, 0. , ..., -0. , 0.0998, 0. ]]], [[[-0. , 0.0801, -0. , ..., -0. , -0.108 , 0. ], [ 0.1512, 0. , 0.1741, ..., -0.1822, -0. , 0. ], [ 0. , 0.0792, 0. , ..., 0. , 0.1996, 0. ], [ 0. , 0. , 0.0295, ..., -0.0945, 0. , 0.99 ], [ 0. , -0.0998, -0. , ..., 0. , 0.0998, -0. ], [ 0. , -0. , -0.294 , ..., 0.9416, -0. , 0.0993]], [[ 0.02 , 0. , 0.0223, ..., -0.0167, -0. , 0. ], [ 0. , 0.0309, 0. , ..., 0. , 0.2104, 0. ], [-0.1996, -0. , -0.2226, ..., 0.1667, 0. , 0. ], [-0. , 0. , -0. , ..., 0. , 0. , 0. ], [ 0.0998, 0. , -0.1987, ..., 0.9093, -0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[-0. , 0.0908, 0. , ..., -0. , -0.1064, 0. ], [ 0.2927, 0. , 0.3158, ..., -0.1335, -0. , 0. ], [ 0. , -0.0406, 0. , ..., 0. , 0.1966, 0. ], [-0.0295, 0. , 0. , ..., -0.0807, -0. , 0.9752], [ 0. , 0.1987, 0. , ..., -0. , -0.1987, -0. ], [ 0.294 , -0. , 0. , ..., 0.8045, 0. , 0.0978]], ..., [[-0. , -0.0716, -0. , ..., -0. , 0.0452, 0. ], [-0.5236, -0. , -0.535 , ..., -0.0709, -0. , 0. ], [ 0. , 0.3469, 0. , ..., 0. , -0.0835, 0. ], [ 0.0945, -0. , 0.0807, ..., 0. , 0. , -0.4141], [-0. , -0.9093, 0. , ..., 0. , 0.9093, 0. ], [-0.9416, -0. , -0.8045, ..., 0. , -0. , -0.0415]], [[-0.02 , -0. , -0.0223, ..., 0.0167, -0. , 0. ], [-0. , -0.0309, -0. , ..., -0. , -0.2104, 0. ], [ 0.1996, 0. , 0.2226, ..., -0.1667, -0. , 0. ], [-0. , 0. , 0. , ..., -0. , 0. , -0. ], [-0.0998, 0. , 0.1987, ..., -0.9093, 0. , 0. ], [ 0. , 0. , -0. , ..., 0. , 0. , -0. ]], [[-0. , 0.3996, -0. , ..., 0. , -0. , 0. ], [-0.2006, -0. , -0.2237, ..., 0.1676, 0. , 0. ], [ 0. , 0.0401, 0. , ..., -0. , -0. , 0. ], [-0.99 , -0. , -0.9752, ..., 0.4141, 0. , 0. ], [ 0. , 0. , 0. , ..., -0. , 0. , 0. ], [-0.0993, -0. , -0.0978, ..., 0.0415, 0. , 0. ]]]], [[[[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ..., [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]]], [[[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ..., [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]]], [[[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ..., [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]]], ..., [[[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ..., [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]]], [[[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ..., [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]]], [[[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], ..., [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]], [[ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ], [ 0. , 0. , 0. , ..., 0. , 0. , 0. ]]]]], shape=(7, 7, 7, 6, 7))
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
- payload(m, p=None)
Add a payload to the end-effector
- Parameters:
- Return type:
payload(m, p) adds a payload with point mass m at position p in the end-effector coordinate frame.
payload(m) adds a payload with point mass m at the origin of the end-effector coordinate frame.
payload(0) removes added payload.
The point mass is combined with the mass, centre of mass and inertia of the end-effector link, and
pis expressed in that link’s frame. The link’s own parameters are kept, so each call replaces the payload added by the previous one, and a payload of zero mass leaves the dynamics unchanged.Note
The end-effector link is
ee_links[0]when the robot has a single end-effector. A robot with several end-effectors has no single end-effector link, and the payload is added tolinks[n - 1]as in earlier releases.
- payload_capacity(q, tau_m, w, frame='base')
Compute the payload capacity of the manipulator
- Parameters:
q (
ndarray|Sequence[float]) – Joint coordinates for trajectoryw (
ndarray|Sequence[float]) – External wrench applied to the end-effectorframe (
Literal['base','ee']) – the frame in whichwis expressed,"base"for the base frame (default) and"ee"for the end-effector frame, which includes the tool transform
- Returns:
Payload capacity of the manipulator
- Return type:
For each configuration, row of
q, compute the multiple of the applied external wrenchwthat can be applied to the end-effector without exceeding the actuator torque limitstau_m. Ifwis the weight of a 1 kg mass then the multiple is the capacity in kg. A load such as a weight is fixed in the world, sowis in the base frame by default; useframe="ee"for a wrench that is fixed to the end-effector, such as a force along the tool axis. This multiple is computed for each joint and can bea positive real number
infthe joint has no role in determining the payload capacitynanthe gravity load already exceeds the joint torque limit
The joint with the lowest payload capacity is the one that determines the overall payload capacity for that configuration.
The result is a matrix of payload capacities for each joint and configuration.
The joint force/torque limits
tau_mare given as an array of shape (n,) or (1,n) of maximum values, in which case the minimum is the negative of the maximum, or (2,n), in which case the first row is the minimum and the second row is the maximum.Examples
In this example we compute the payload capacity of the Puma560 robot along a straight line trajectory in the x-direction, moving from tightly folded to almost straight. The end-effector is oriented with the tool frame pointing in the x-direction, and a tool offset is added so that the load causes a moment on the wrist. The external wrench is a downward force of 9.81 N, which is equivalent to a 1 kg mass. The torque limits are the motor fuse limits from Table 2.17 of “Visual Control of Robots”, Corke (1996). The payload capacity, as well as the limiting joint, is plotted as a function of the x-position of the end-effector. The minimum payload capacity is also plotted, along with the index of the joint that determines the payload capacity.
>>> from roboticstoolbox import models >>> import matplotlib.pyplot as plt >>> import numpy as np >>> from spatialmath import SE3 >>> puma = models.DH.Puma560() >>> puma.tool = SE3.Tz(0.05) >>> T = SE3.Tx(np.arange(0.35, 0.85, 0.01)) * SE3.Tz(puma.links[0].d) * SE3.Ry(90, "deg") >>> sol = puma.ikine_a(T) >>> w = [0,0,-9.81,0,0,0] >>> cap = puma.payload_capacity(sol.q, [56, 97, 52,10,10,10], w) >>> plt.plot(T.x, [np.min(c) for c in cap]) >>> plt.plot(T.x, [np.argmin(c) for c in cap])
(
Source code,png,hires.png,pdf)
Derived from the MATLAB functions
payandpaycaporiginally contributed to the MATLAB Robotics Toolbox by Bryan Moutrie (@au-phiware). Ported to Python and adapted forrobotics-toolbox-pythonwith permission from the original author.Added in version 1.5.0.
- Seealso:
- perturb(p=0.1)
Perturb robot parameters
- Parameters:
p (
float) – The percent (+/-) to be perturbed. Default 10%- Return type:
- Returns:
A copy of the robot with dynamic parameters perturbed
rp = perturb(p) is a new robot object in which the dynamic parameters (link mass and inertia) have been perturbed. The perturbation is multiplicative so that values are multiplied by random numbers in the interval (1-p) to (1+p). The name string of the perturbed robot is prefixed by ‘P/’.
Useful for investigating the robustness of various model-based control schemes. For example to vary parameters in the range +/- 10 percent is: r2 = puma.perturb(0.1)
- plot(q, backend=None, block=False, dt=0.05, limits=None, vellipse=False, fellipse=False, fig=None, movie=None, loop=False, notebook=None, ax=None, env=None, view=None, **kwargs)
Graphical display and animation
robot.plot(q, 'pyplot')displays a graphical view of a robot based on the kinematic model and the joint configurationq. This is a stick figure polyline which joins the origins of the link coordinate frames. The plot will autoscale with an aspect ratio of 1.If
q(m,n) representing a joint-space trajectory it will create an animation with a pause ofdtseconds between each frame.- Parameters:
q (
ndarray|Sequence[float]) – The joint configuration of the robot.backend (
Optional[Literal['swift','pyplot','pyplot2']]) – The graphical backend to use, currently ‘swift’ and ‘pyplot’ are implemented. Defaults to ‘swift’ of aRobotand ‘pyplot` for aDHRobotblock (
bool) –Truewaits until the window is closed; the PyPlot backend has already shown the figure, soFalseandNonereturn at once, defaults to Falsedt (
float) – if q is a trajectory, this describes the delay in seconds between frameslimits (
ndarray|Sequence[float] |None) – Custom view limits for the plot. If not supplied will autoscale, [x1, x2, y1, y2, z1, z2] (this option is for ‘pyplot’ only)vellipse (
bool) – (Plot Option) Plot the velocity ellipse at the end-effector (this option is for ‘pyplot’ only)fellipse (
bool) – (Plot Option) Plot the force ellipse at the end-effector (this option is for ‘pyplot’ only)fig (
str|None) – (Plot Option) The figure label to plot in (this option is for ‘pyplot’ only)ax (
Any) – (Plot Option) Existing Matplotlib 3D axes to draw the scene on, instead of making a figure (this option is for ‘pyplot’ only)env (
Connector|None) – The scene returned by an earlierplot, to add this robot to, instead of making a new scene; see Several configurations below. The backend of the scene is used, sobackendis ignored, and the options that are set when a scene is made (limits,fig,ax,render_mode,inline_*,notebookandbrowser) cannot be givencolor – (Plot Option) The color of the robot’s line, any Matplotlib color (this option is for ‘pyplot’ only)
view (
str|None) – (Plot Option)"xy","xz"or"yz"to start with a flat view of that plane, the first axis to the right and the second up, orNone(default) for the usual three-dimensional view. The view is not locked, the plot can be rotated as usual. Withenvit changes the view of that scene (this option is for ‘pyplot’ only)movie (
str|None) – (Plot Option) The filename to save the movie to (this option is for ‘pyplot’ only)loop (
bool) – (Plot Option) Loop the movie (this option is for ‘pyplot’ only)notebook (
bool|None) – (Plot Option, Swift only)Trueshows Swift in a frame of the current notebook cell,Falseopens it in a browser window, andNone(default) chooses the frame in a notebook, unless abrowseris named, and a window otherwise, so the same call works in a script and in a notebook. The browser showing the notebook must be on the machine running the kernel, since the frame points atlocalhostbrowser – (Plot Option, Swift only) the browser for the window, or
None(default) for the system’s. This is a name known to Python’swebbrowsermodule, which depends on the operating system, for example"chrome","firefox"or"safari"on macOS and"google-chrome"or"chromium"on Linux, or a command line with%swhere the URL goes, for any other browser;webbrowser.get(name)tells you whether a name works. Naming a browser means a window, not the notebook frame.browser="notebook"is deprecated, usenotebook=True. Seeswift.Swift.Swift.launch()realtime – (Plot Option) Pace the steps of a trajectory in real time, one each
dt, defaults to True for a trajectory (this option is for ‘swift’ only)jointaxes – (Plot Option) Plot an arrow indicating the axes in which the joint revolves around(revolute joint) or translates along (prosmatic joint) (this option is for ‘pyplot’ only)
eeframe – (Plot Option) Plot the end-effector coordinate frame at the location of the end-effector. Uses three arrows, red, green and blue to indicate the x, y, and z-axes. (this option is for ‘pyplot’ only)
shadow – (Plot Option) Plot a shadow of the robot in the x-y plane. (this option is for ‘pyplot’ only)
name – (Plot Option) Plot the name of the robot near its base (this option is for ‘pyplot’ only)
render_mode – (Plot Option) Rendering mode for matplotlib backends:
'window','notebook-widget', or'notebook-inline'. If omitted, a mode is chosen from the environment, so the same call works for any%matplotlibsetting: for the interactiveipymplbackend a single pose is a widget that can be rotated, but a trajectory uses'notebook-inline', since a widget cannot update while the cell is running.inline_every_n – (Plot Option) In notebook-inline mode, push one rendered frame every N simulation steps. Larger N reduces output load.
inline_format – (Plot Option) In notebook-inline mode, frame format:
'svg'(default) or'png'.inline_dpi – (Plot Option) DPI for PNG inline frames only; ignored when
inline_format='svg'.
- Return type:
- Returns:
A reference to the environment object which controls the figure
Note
Python’s
webbrowsermodule cannot tell whether a browser is installed, so a browser that cannot be opened is not reported as such. On macOS the names"chrome","firefox"and"safari"are always accepted, whether or not the app is installed. If it is not, no window opens and there is no error: Swift waits about 10 seconds for the page to connect and then reportsCould not connect to the Swift simulator. If you see that, check that the browser named bybrowseris installed, or leave it asNoneto use the system’s default browser. Seeswift.Swift.Swift.launch().Several configurations
plotreturns the scene it made, and passing that asenvto anotherplotadds a robot to it instead of making a new scene. The robot is the same model, and each plot of it holds the pose it was given, so the robot is shown in two configurations at once, here the initial and the final. Give each acolor, and turn off what would be drawn twice.import roboticstoolbox as rtb puma = rtb.models.DH.Puma560() env = puma.plot(puma.qr, color="gray", block=False) puma.plot(puma.qn, env=env, color="red", name=False, block=False)
(
Source code,png,hires.png,pdf)
The scene can be given a pose to draw directly,
handle = env.add(puma, q=q), andhandle.q = qmoves only that drawing. A robot that is added without aqfollowspuma.q, as it always has. A trajectory can be plotted on top of an earlier plot in the same way; the earlier plot stays where it was. In a notebook, an animation needs the scene to have been made withrender_mode="notebook-inline".Notes
- By default this method will block until the figure is dismissed.
To avoid this set
block=False.
- For PyPlot, the polyline joins the origins of the link frames,
but for some Denavit-Hartenberg models those frames may not actually be on the robot, ie. the lines to not necessarily represent the links of the robot.
See also
- plot_ellipse(ellipse, block=True, limits=None, jointaxes=True, eeframe=True, shadow=True, name=True)
Plot an ellipsoid.
- Parameters:
ellipse (
EllipsePlot) – the ellipsoid to plotblock (
bool) –Truewaits until the window is closed; the PyPlot backend has already shown the figure, soFalseandNonereturn at once, defaults to Truelimits (
ndarray|Sequence[float] |None) – custom view limits[x1, x2, y1, y2, z1, z2]; autoscales if not suppliedjointaxes (
bool) – plot an arrow indicating the joint axiseeframe (
bool) – plot the end-effector coordinate frameshadow (
bool) – plot a shadow of the robot in the x-y planename (
bool) – plot the name of the robot near its base
- Returns:
a reference to the PyPlot object controlling the matplotlib figure
- Return type:
robot.plot_ellipse(ellipsoid)displays the ellipsoid.
- plot_fellipse(q, block=True, fellipse=None, limits=None, opt='trans', centre='ee', jointaxes=True, eeframe=True, shadow=True, name=True)
Plot the force ellipsoid for a manipulator.
- Parameters:
q (
ndarray|Sequence[float] |None) – the joint configuration of the robotblock (
bool) –Truewaits until the window is closed; the PyPlot backend has already shown the figure, soFalseandNonereturn at once, defaults to Truefellipse (
EllipsePlot|None) – a pre-built force ellipsoid to plotlimits (
ndarray|Sequence[float] |None) – custom view limits[x1, x2, y1, y2, z1, z2]; autoscales if not suppliedopt (
Literal['trans','rot']) –'trans'or'rot'— plot the translational or rotational force ellipsoidcentre (
Union[Literal['ee'],ndarray,Sequence[float]]) – coordinates to plot the ellipse —[x, y, z]or"ee"jointaxes (
bool) – plot an arrow indicating the joint axiseeframe (
bool) – plot the end-effector coordinate frameshadow (
bool) – plot a shadow of the robot in the x-y planename (
bool) – plot the name of the robot near its base
- Raises:
ValueError – if neither
qnorfellipseis supplied- Returns:
a reference to the PyPlot object controlling the matplotlib figure
- Return type:
robot.plot_fellipse(q)displays the force ellipsoid for the robot at poseq. The plot will autoscale with an aspect ratio of 1.robot.plot_fellipse(vellipse=ell)uses a pre-built ellipse object.Notes
By default the ellipsoid related to translational motion is drawn. Use
opt='rot'to draw the rotational velocity ellipsoid.By default the ellipsoid is drawn at the origin. Use
centreto specify a 3-vector, or"ee"to draw at the end-effector.
- plot_vellipse(q, block=True, vellipse=None, limits=None, opt='trans', centre='ee', jointaxes=True, eeframe=True, shadow=True, name=True)
Plot the velocity ellipsoid for a manipulator.
- Parameters:
q (
ndarray|Sequence[float] |None) – the joint configuration of the robotblock (
bool) –Truewaits until the window is closed; the PyPlot backend has already shown the figure, soFalseandNonereturn at once, defaults to Truevellipse (
EllipsePlot|None) – a pre-built velocity ellipsoid to plotlimits (
ndarray|Sequence[float] |None) – custom view limits[x1, x2, y1, y2, z1, z2]; autoscales if not suppliedopt (
Literal['trans','rot']) –'trans'or'rot'— plot the translational or rotational velocity ellipsoidcentre (
Union[Literal['ee'],ndarray,Sequence[float]]) – coordinates to plot the ellipse —[x, y, z]or"ee"jointaxes (
bool) – plot an arrow indicating the joint axiseeframe (
bool) – plot the end-effector coordinate frameshadow (
bool) – plot a shadow of the robot in the x-y planename (
bool) – plot the name of the robot near its base
- Raises:
ValueError – if neither
qnorvellipseis supplied- Returns:
a reference to the PyPlot object controlling the matplotlib figure
- Return type:
robot.plot_vellipse(q)displays the velocity ellipsoid for the robot at poseq. The plot will autoscale with an aspect ratio of 1.robot.plot_vellipse(vellipse=ell)uses a pre-built ellipse object.Notes
By default the ellipsoid related to translational motion is drawn. Use
opt='rot'to draw the rotational velocity ellipsoid.By default the ellipsoid is drawn at the origin. Use
centreto specify a 3-vector, or"ee"to draw at the end-effector.
- property prismaticjoints: list[bool]
Prismatic joints as bool array
- Returns:
array of joint type, True if prismatic
Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.prismaticjoints [False, False, False, False, False, False] >>> stanford = rtb.models.DH.Stanford() >>> stanford.prismaticjoints [False, False, True, False, False, False]
Notes
Fixed joints, that maintain a constant link relative pose, are not included.
See also
- property q: ndarray
Get/set robot joint configuration
robot.qis the robot joint configurationrobot.q = ...checks and sets the joint configuration
- property qd: ndarray
Get/set robot joint velocity
robot.qdis the robot joint velocityrobot.qd = ...checks and sets the joint velocity
- property qdd: ndarray
Get/set robot joint acceleration
robot.qddis the robot joint accelerationrobot.qdd = ...checks and sets the robot joint acceleration
- property qlim: ndarray
Joint limits
Limits are extracted from the link objects. If joints limits are not set for:
a revolute joint [-𝜋. 𝜋] is returned
a prismatic joint an exception is raised
- Parameters:
qlim – An array of joints limits (2, n)
- Raises:
ValueError – unset limits for a prismatic joint
- Returns:
Array of joint limit values
Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot.qlim array([[-2.7925, -0.7854, -3.927 , -1.9199, -1.7453, -4.6426], [ 2.7925, 3.927 , 0.7854, 2.9671, 1.7453, 4.6426]])
- random_q()
Return a random joint configuration
The value for each joint is uniform randomly distributed between the limits set for the robot.
Notes
The joint limit for all joints must be set.
- Return type:
- Returns:
Random joint configuration :rtype: ndarray(n)
- property revolutejoints: list[bool]
Revolute joints as bool array
- Returns:
array of joint type, True if revolute
Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.revolutejoints [True, True, True, True, True, True] >>> stanford = rtb.models.DH.Stanford() >>> stanford.revolutejoints [True, True, False, True, True, True]
Notes
Fixed joints, that maintain a constant link relative pose, are not included.
See also
- property scene_children: list[SceneNode]
Return the child nodes of this object in the scene graph.
Setting a new list of children updates each child’s
scene_parentto this object, but does not remove this object from any previous parent’sscene_children.This is a read/write property.
- Return type:
list(SceneNode)
- Seealso:
- property scene_parent: SceneNode | None
Return the parent node of this object in the scene graph.
Setting a new parent adds this object to the new parent’s
scene_children.This is a read/write property.
- Return type:
SceneNode | None
- Seealso:
- Setter accepts:
- classmethod set_default_backend(be)
Set the default graphical backend for all robots
Robot.set_default_backend("swift")sets the backend used byplot()for every robot, existing or created later, that has not been given one of its own byrobot.default_backend = .... The robot’s own value takes precedence.See also
- showgraph(display_graph=True, **kwargs)
Display a link transform graph in browser
robot.showgraph()displays a graph of the robot’s link frames and the ETS between them. It uses GraphViz dot.- The nodes are:
Base is shown as a grey square. This is the world frame origin, but can be changed using the
baseattribute of the robot.Link frames are indicated by circles
ETS transforms are indicated by rounded boxes
- The edges are:
an arrow if
jtypeis False or the joint is fixedan arrow with a round head if
jtypeis True and the joint is revolutean arrow with a box head if
jtypeis True and the joint is prismatic
Edge labels or nodes in blue have a fixed transformation to the preceding link.
- Parameters:
display_graph (
bool) – Open the graph in a browser if True. Otherwise will return the file pathetsbox – Put the link ETS in a box, otherwise an edge label
jtype – Arrowhead to node indicates revolute or prismatic type
static – Show static joints in blue and bold
- Return type:
Examples
>>> import roboticstoolbox as rtb >>> panda = rtb.models.URDF.Panda() >>> panda.showgraph()
- property structure: str
Return the joint structure string
A string with one letter per joint:
Rfor a revolute joint, andPfor a prismatic joint.- Returns:
joint configuration string
Examples
>>> import roboticstoolbox as rtb >>> puma = rtb.models.DH.Puma560() >>> puma.structure 'RRRRRR' >>> stanford = rtb.models.DH.Stanford() >>> stanford.structure 'RRPRRR'
Notes
Fixed joints, that maintain a constant link relative pose, are not included.
len(self.structure) == self.n.
- teach(q, block=True, limits=None, vellipse=False, fellipse=False, backend=None, view=None)
Graphical teach pendant
robot.teach(q)opens a graphical view (PyPlot or Swift – seebackend) which allows the user to “drive” a graphical robot using a graphical slider panel. The robot’s initial joint configuration isq.robot.teach()as above except the robot’s stored value ofqis used.- Parameters:
q (
ndarray|Sequence[float] |None) – The joint configuration of the robot (Optional, if not supplied will use the stored q values).block (
bool) –Truewaits until the window is closed; the PyPlot backend has already shown the figure, soFalseandNonereturn at once, defaults to Truelimits (
ndarray|Sequence[float] |None) – Custom view limits for the plot. If not supplied will autoscale, [x1, x2, y1, y2, z1, z2] (this option is for ‘pyplot’/’pyplot2’ only)vellipse (
bool) – (Plot Option) Plot the velocity ellipse at the end-effector (this option is for ‘pyplot’ only)fellipse (
bool) – (Plot Option) Plot the force ellipse at the end-effector (this option is for ‘pyplot’ only)backend (
Optional[Literal['swift','pyplot','pyplot2']]) – The graphical backend to use – ‘swift’, ‘pyplot’, or ‘pyplot2’. Defaults to whateverplot()would pick for this robot (see its ownbackendfor the resolution rule).view (
str|None) –"xy","xz"or"yz"to start with a flat view of that plane, the first axis to the right and the second up, orNone(default) for the usual three-dimensional view. The view is not locked, the plot can be rotated as usual (this option is for ‘pyplot’ only)
- Return type:
- Returns:
A reference to the environment object which controls the figure/view
Notes
Program execution is blocked until the teach window is dismissed. If
block=Falsethe method is non-blocking but you need to poll the window manager (PyPlot) or keep callingenv.step()yourself (Swift) to ensure the window/panel remains responsive.Once
teach()returns (block=True),robot.qholds the final pose the sliders were left at – true for every backend, even though Swift’s own live joint state during the session lives on the returned environment’s handle (env.swift_objects[0].q), notrobot.qitself, to keep the robot model plain and shareable while teaching is in progress (see swift’sAssemblyHandle).The slider limits are derived from the joint limit properties. If not set then:
For revolute joints they are assumed to be [-pi, +pi]
For prismatic joint they are assumed unknown and an error occurs.
- todegrees(q)
Convert joint angles to degrees
- Parameters:
q (
Any) – The joint configuration of the robot- Return type:
- Returns:
a vector of joint coordinates in degrees and metres
- Returns:
robot.todegrees(q)converts joint coordinatesqto degrees- Returns:
taking into account whether elements of
qcorrespond to revolute- Returns:
or prismatic joints, ie. prismatic joint values are not converted.
- Returns:
If
qis a matrix, with one column per joint, the conversion is- Returns:
performed columnwise.
Examples
- property tool: SE3
Get/set robot tool transform
robot.toolis the robot tool transform as an SE3 objectrobot._toolis the robot tool transform as a numpy arrayrobot.tool = ...checks and sets the robot tool transform
- toradians(q)
Convert joint angles to radians
robot.toradians(q)converts joint coordinatesqto radians taking into account whether elements ofqcorrespond to revolute or prismatic joints, ie. prismatic joint values are not converted.If
qis a matrix, with one column per joint, the conversion is performed columnwise.- Parameters:
q (
Any) – The joint configuration of the robot- Return type:
- Returns:
a vector of joint coordinates in radians and metres
Examples
>>> import roboticstoolbox as rtb >>> stanford = rtb.models.DH.Stanford() >>> stanford.toradians([10, 20, 2, 30, 40, 50]) array([0.1745, 0.3491, 2. , 0.5236, 0.6981, 0.8727])
- tree()
Render the whole tree this node lives in as indented text – walks up to the root first (the same root-finding as
update()), then renders down from there, with this node marked with a trailing<==so its position in the tree is visible.- Return type:
- tree_children()
Render this node’s own subtree as indented text (one
repr()per line), not walking through parents – the same “not through parents” scope as_propagate_scene_children().Nodes have no
.namein this package, so each line is that node’s ownrepr()(type, constructor params, color, pose) – usually enough to tell siblings apart, since it’s rare for two distinct nodes to share an identical pose as well as everything else.- Return type:
- update()
Recompute the world transform of every node in the scene graph this node belongs to, starting from the root and working down.
Call this after changing any node’s
T/pose(or itsscene_parent) – nothing propagates automatically. It doesn’t matter which node in the graph you call it on: this always walks up to the root first, then pushes fresh world transforms down through the whole tree, not just this node’s own subtree.- Return type:
- vellipse(q, opt='trans', unit='rad', centre='ee', scale=0.1, add=True)
Create a velocity ellipsoid object for plotting with PyPlot.
- Parameters:
q (
ndarray|Sequence[float]) – the joint configuration of the robotopt (
Literal['trans','rot']) –'trans'or'rot'— plot the translational or rotational velocity ellipsoidunit (
Literal['rad','deg']) –'rad'or'deg'centre (
Union[Literal['ee'],ndarray,Sequence[float]]) – centre of the ellipsoid —'ee'for the end-effector or a 3-vector[x, y, z]in the world framescale (
float) – scale factor for the ellipsoidadd (
bool) – ifTrue, add the ellipsoid to the active plot environment
- Returns:
an EllipsePlot object
- Return type:
EllipsePlot
robot.vellipse(q)creates a velocity ellipsoid for the robot at poseq. By default the ellipsoid is centered at the end-effector.Notes
By default the ellipsoid related to translational motion is drawn. Use
opt='rot'to draw the rotational velocity ellipsoid.By default the ellipsoid is drawn at the end-effector. The option
centreallows its origin to be set to the specified 3-vector, or the string"ee"ensures it is drawn at the end-effector position.
- vision_collision_damper(shape, camera=None, camera_n=0, q=None, di=0.3, ds=0.05, xi=1.0, end=None, start=None, collision_list=None)
Compute a vision collision constrain for QP motion control
- Parameters:
camera (
Robot|SE3|None) – The camera link, either as a robotic link or SE3 posecamera_n (
int) – Degrees of freedom of the camera linkds (
float) – The minimum distance in which a joint is allowed to approach the collision object shapedi (
float) – The influence distance in which the velocity damper becomes activexi (
float) – The gain for the velocity damperend (
str|Link|Gripper|None) – The end link of the robot to considerstart (
str|Link|Gripper|None) – The start link of the robot to considercollision_list (
Any) – A list of shapes to consider for collision
- Return type:
- Returns:
tuple of (Ain, Bin) inequality constraint matrices for an optimiser
Formulates an inequality constraint which, when optimised for will make it impossible for the robot to run into a line of sight. See examples/fetch_vision.py for use case.
DHLink
The DHRobot is defined by a list of DHLink subclass objects.
- class DHLink(d=0.0, alpha=0.0, theta=0.0, a=0.0, sigma=0, mdh=False, offset=0, flip=False, qlim=None, **kwargs)[source]
Bases:
LinkA link superclass for all robots defined using Denavit-Hartenberg notation. A Link object holds all information related to a robot joint and link such as kinematics parameters, rigid-body inertial parameters, motor and transmission parameters.
- Parameters:
theta (
float) – kinematic: joint angled (
float) – kinematic - link offsetalpha (
float) – kinematic - link twista (
float) – kinematic - link lengthsigma (
int) – kinematic - 0 if revolute, 1 if prismaticmdh (
bool) – kinematic - False if standard D&H, True for modified D&Hoffset (
float) – kinematic - joint variable offsetqlim (
ndarray|Sequence[float] |None) – joint variable limits [min, max]flip (
bool) – joint moves in opposite directionm (float) – dynamic - link mass
r (ndarray(3,)) – dynamic - position of COM with respect to link frame
I (ndarray) – dynamic - inertia of link with respect to COM
Jm (float) – dynamic - motor inertia
B (float, or ndarray(2,)) – dynamic - motor viscous friction: B=B⁺=B⁻, [B⁺, B⁻]
Tc (ndarray(2,)) – dynamic - motor Coulomb friction [Tc⁺, Tc⁻]
G (float) – dynamic - gear ratio
- References:
Robotics, Vision & Control, P. Corke, Springer 2023, Chap 7.
- property isjoint: bool
Test if link has joint :return: test if link has a joint :rtype: bool The ETS for each ELink comprises a constant part (possible the identity) followed by an optional joint variable transform. This property returns the whether the .. runblock:: pycon
>>> from roboticstoolbox import models >>> robot = models.URDF.Panda() >>> robot[1].isjoint # link with joint >>> robot[8].isjoint # static link
- property theta: Any
Get/set joint angle.
- Returns:
joint angle
- Return type:
link.thetais the joint anglelink.theta = ...checks and sets the joint angle
- property d: Any
Get/set link offset.
- Returns:
link offset
- Return type:
link.dis the link offsetlink.d = ...checks and sets the link offset
- property a: Any
Get/set link length.
- Returns:
link length
- Return type:
link.ais the link lengthlink.a = ...checks and sets the link length
- property alpha: Any
Get/set link twist.
- Returns:
link twist
- Return type:
link.alphais the link twistlink.alpha = ...checks and sets the link twist
- property sigma: Any
Get/set joint type.
- Returns:
joint type
- Return type:
See also
link.sigmais the joint typelink.sigma = ...checks and sets the joint type
The joint type is 0 for a revolute joint, and 1 for a prismatic joint.
- property B: float
Get/set motor viscous friction
link.Bis the motor viscous frictionlink.B = ...checks and sets the motor viscous friction
- Returns:
motor viscous friction
Notes
Referred to the motor side of the gearbox.
Viscous friction is the same for positive and negative motion.
- property G: float
Get/set gear ratio
link.Gis the transmission gear ratiolink.G = ...checks and sets the gear ratio
- Returns:
gear ratio
Notes
The ratio of motor motion : link motion
The gear ratio can be negative, see also the
flipattribute.The default is 1, the motor is coupled directly to the joint.
Changed in version 1.5.0: The default was 0, which silently discarded the motor inertia and friction of a link that did not set
G.See also
flip
- property I: ndarray
Get/set link inertia
- Returns:
link inertia
- Return type:
ndarray(3,3)
Link inertia is a symmetric 3x3 matrix describing the inertia with respect to a frame with its origin at the centre of mass, and with axes parallel to those of the link frame.
link.Iis the link inertialink.I = ...checks and sets the link inertia
The inertia matrix is
\(\begin{bmatrix} I_{xx} & I_{xy} & I_{xz} \\ I_{xy} & I_{yy} & I_{yz} \\I_{xz} & I_{yz} & I_{zz} \end{bmatrix}\)
and can be specified as either:
a 3 ⨉ 3 symmetric matrix
a 3-vector \((I_{xx}, I_{yy}, I_{zz})\)
a 6-vector \((I_{xx}, I_{yy}, I_{zz}, I_{xy}, I_{yz}, I_{xz})\)
Notes
Referred to the link side of the gearbox.
Warning
The array is read-only. To change the inertia assign a new value,
link.I = ..., since editing the array in place,link.I[0, 0] = 1, would bypass the setter and so the dynamics of the robot would not know that it had changed.Changed in version 1.5.0: The array is read-only, and
link.I[0, 0] = 1raisesValueError. It was writeable, and an edit was silently not seen by the dynamics of the robot.
- property Jm: float
Get/set motor inertia
link.Jmis the motor inertialink.Jm = ...checks and sets the motor inertia
- Returns:
motor inertia
Notes
Referred to the motor side of the gearbox.
- property T: ndarray
Pose of the shape relative to its parent frame in the scene graph (or the world frame if it has no parent), as a 4x4 homogeneous transformation matrix. Set via the
poseargument of the constructor.This is a read/write property. The getter always returns a plain
ndarray; the setter also accepts anSE3.Warning
Because the getter returns an
ndarray, in-place operators likeshape.T *= deltado an elementwise multiply, not a pose composition, even whendeltais anSE3– useshape.T = shape.T * delta(orshape.T @= delta.A) instead.
- property Tc: ndarray
Get/set motor Coulomb friction
- Returns:
motor Coulomb friction
- Return type:
ndarray(2,)
link.Tcis the motor Coulomb frictionlink.Tc = ...checks and sets the motor Coulomb friction. If a scalar is given the value is set to [T, -T], if a 2-vector it is assumed to be in the order [Tc⁺, Tc⁻]
Coulomb friction is a non-linear friction effect defined by two parameters such that
\[\begin{split}\tau = \left\{ \begin{array}{ll} \tau_C^+ & \mbox{if $\dot{q} > 0$} \\ \tau_C^- & \mbox{if $\dot{q} < 0$} \end{array} \right.\end{split}\]Notes
Referred to the motor side of the gearbox.
- \(\tau_C^+\) must be \(> 0\), and \(\tau_C^-\) must
be \(< 0\).
Warning
The array is read-only. To change the Coulomb friction assign a new value,
link.Tc = ..., since editing the array in place would bypass the setter and so the dynamics of the robot would not know that it had changed.Changed in version 1.5.0: The array is read-only, and an edit in place raises
ValueError. It was writeable, and an edit was silently not seen by the dynamics of the robot.
- property Ts: ndarray | None
Constant part of link ETS
- Returns:
constant part of link transform
- Return type:
ndarray(4,4) or None
The ETS for each Link comprises a constant part (possible the identity) followed by an optional joint variable transform. This property returns the constant part. If no constant part is given, this returns an identity matrix.
Examples
- attach(object: SceneNode) → None
Attach a child node
- Parameters:
object (
SceneNode) – the node to attach as a child of this node- Seealso:
- Return type:
- attach_to(object: SceneNode) → None
Attach this node to a parent node
- Parameters:
object (
SceneNode) – the node to attach this node to, this node will become a child of the parent- Seealso:
- Return type:
- property children: list[Link] | None
List of child links
- Returns:
child links
The list will be empty for a end-effector link
- closest_point(shape: Shape, inf_dist: float = 1.0, skip: bool = False) → tuple[float | None, ndarray | None, ndarray | None]
Finds the closest point to a shape
- Parameters:
- Return type:
- Returns:
(d, p1, p2) where d is the distance between the shapes, p1 is the point in the world frame on the link [x, y, z], and p2 is the point in the world frame on the shape [x, y, z].
closest_point(shape, inf_dist) returns the minimum euclidean distance between this link and shape, provided it is less than inf_dist. It will also return the points on self and shape in the world frame which connect the line of length distance between the shapes. If the distance is negative then the shapes are collided.
- collided(shape: Shape, skip: bool = False) → Any
Checks for collision with a shape
- Parameters:
- Return type:
- Returns:
True if shapes have collided
iscollided(shape)checks if this link and shape have collided
- property collision: SceneGroup
Get/set joint collision geometry
The collision geometries are what is used to check for collisions.
link.collisionis the list of the collision geometries whichrepresent the collidable shape of the link. :return: the collision geometries :rtype: list of Shape
link.collision = ...checks and sets the collision geometrylink.collision.append(...)add collision geometry
- Setter accepts:
SceneGroup|list[Shape] |Shape
- copy() → Self
Copy of link object
- Return type:
- Returns:
copy of link object
link.copy()is a new Link subclass instance with a copy of all the parameters.
- dyn(indent: int = 0) → Any
Inertial properties of link as a string
link.dyn()is a string representation the inertial properties of the link object in a multi-line format. The properties shown are mass, centre of mass, inertia, friction, gear ratio and motor properties.Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> print(robot.links[2]) # kinematic parameters RevoluteDH: θ=q, d=0.15005, a=0.0203, ⍺=-1.5707963267948966 >>> print(robot.links[2].dyn()) # dynamic parameters m = 4.8 r = -0.02 -0.014 0.07 | 0.066 0 0 | I = | 0 0.086 0 | | 0 0 0.013 | Jm = 0.0002 B = 0.0014 Tc = 0.13(+) -0.1(-) G = -54 qlim = -3.9 to 0.79
See also
dyntable
- property ets: ETS
Get/set link ets
link.etsis the link etslink.ets = ...checks and sets the link ets
- friction(qd: float, coulomb: bool = True) → Any
Compute joint friction
- Parameters:
- Return type:
- Returns:
the friction force/torque
friction(qd)is the joint friction force/torque for joint velocityqd. The friction model includes:Viscous friction which is a linear function of velocity.
Coulomb friction which is proportional to sign(qd).
\[\begin{split}\tau = G^2 B \dot{q} + |G| \left\{ \begin{array}{ll} \tau_C^+ & \mbox{if $\dot{q} > 0$} \\ \tau_C^- & \mbox{if $\dot{q} < 0$} \end{array} \right.\end{split}\]Notes
- The friction value should be added to the motor output torque to
determine the nett torque. It has a negative value when qd > 0.
- The returned friction value is referred to the output of the
gearbox.
- The friction parameters in the Link object are referred to the
motor.
Motor viscous friction is scaled up by \(G^2\).
Motor Coulomb friction is scaled up by math:
G.- The appropriate Coulomb friction value to use in the
non-symmetric case depends on the sign of the joint velocity, not the motor velocity.
- Coulomb friction is zero for zero joint velocity, stiction is
not modeled.
- The absolute value of the gear ratio is used. Negative gear
ratios are tricky: the Puma560 robot has negative gear ratio for joints 1 and 3.
- property geometry: SceneGroup
Get/set joint visual geometry
link.geometryis the list of the visual geometries whichrepresent the shape of the link :return: the visual geometries :rtype: list of Shape
link.geometry = ...checks and sets the geometrylink.geometry.append(...)add geometry
- Setter accepts:
SceneGroup|list[Shape] |Shape
- property hasdynamics: bool
Link has dynamic parameters (Link superclass)
- Returns:
True if the link has a non-zero mass or motor inertia
These are the parameters that the inertial dynamics need. The value is kept up to date by the setters of
mandJm, so it follows a mass that is set, and set back to zero.Changed in version 1.5.0: This was true if any dynamic parameter, or even a kinematic parameter of a DH link, had been assigned, even to zero. A link with only friction parameters, or one made with
m=0, now reports False.Examples
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> robot[1].hasdynamics True
- iscollided(shape: Shape, skip: bool = False) → bool
Checks for collision with a shape
- Parameters:
- Return type:
- Returns:
True if shapes have collided
iscollided(shape)checks if this link and shape have collided
- property isflip: bool
Get/set joint flip
- Returns:
joint flip
link.flipis the joint flip statuslink.flip = ...checks and sets the joint flip status
Joint flip defines the direction of motion of the joint.
flip = Falseis conventional motion direction:revolute motion is a positive rotation about the z-axis
prismatic motion is a positive translation along the z-axis
flip = Trueis the opposite motion direction:revolute motion is a negative rotation about the z-axis
prismatic motion is a negative translation along the z-axis
- islimit(q: float) → Any
Checks if joint exceeds limit
link.islimit(q)is True ifqexceeds the joint limits defined bylink.Notes
If no limits are set always return False.
See also
- property jindex: int | None
Get/set joint index
link.jindexis the joint indexlink.jindex = ...checks and sets the joint index
- Returns:
joint index
For a serial-link manipulator the joints are numbered starting at zero and increasing sequentially toward the end-effector. For branched mechanisms this is not so straightforward. The link’s
jindexproperty specifies the index of its joint variable within a vector of joint coordinates.Notes
jindexvalues must be a sequence of integers startingat zero.
- Setter accepts:
- property m: float
Get/set link mass
link.mis the link masslink.m = ...checks and sets the link mass
- Returns:
link mass
- property mdh: Any
Get/set kinematic convention.
- Returns:
kinematic convention
- Return type:
link.mdhis the kinematic conventionlink.mdh = ...checks and sets the kinematic convention
True for modified Denavit-Hartenberg notation (eg. Craig’s textbook), False for standard Denavit-Hartenberg notation (eg. Siciliano, Spong, Paul).
- property name: str
Get/set link name
link.nameis the link namelink.name = ...checks and sets the link name
- Returns:
link name
- property nchildren: int
Number of child links
- Returns:
number of child links
Will be zero for an end-effector link
- nofriction(coulomb: bool = True, viscous: bool = False) → Any
Clone link without friction
- Parameters:
- Return type:
link.nofriction()is a copy of the link instance with the same parameters except, the Coulomb and/or viscous friction parameters are set to zero.Notes
- For simulation it can be useful to remove Coulomb friction
which can cause problems for numerical integration.
- property parent: Optional[Self]
Parent link
- Returns:
Link’s parent
This is a reference to the links parent in the kinematic chain
Examples
>>> from roboticstoolbox import models >>> robot = models.URDF.Panda() >>> robot[0].parent # base link has no parent >>> robot[1].parent # second link's parent Link(name = "panda_link0")
- property qdlim: float | None
Get/set joint velocity limits
link.qdlimis the joint velocity limitslink.qdlim = ...checks and sets the joint velocity limits
- Returns:
joint velocity limits
Notes
The limits are not widely enforced within the toolbox.
If no joint velocity limits are specified the value is
None
See also
- Setter accepts:
- property qlim: ndarray | None
Get/set joint limits
link.qlimis the joint limitslink.qlim = ...checks and sets the joint limits
- Returns:
joint limits
- Return type:
ndarray(2,) or None
Notes
The limits are not widely enforced within the toolbox.
If no joint limits are specified the value is
None
See also
- property r: ndarray
Get/set link centre of mass
- Returns:
link centre of mass
- Return type:
ndarray(3,)
The link centre of mass is a 3-vector defined with respect to the link frame.
link.ris the link centre of masslink.r = ...checks and sets the link centre of mass
Warning
The array is read-only. To change the centre of mass assign a new value,
link.r = [0, 0.1, 0], since editing the array in place,link.r[1] = 0.1, would bypass the setter and so the dynamics of the robot would not know that it had changed.Changed in version 1.5.0: The array is read-only, and
link.r[1] = 0.1raisesValueError. It was writeable, and an edit was silently not seen by the dynamics of the robot.
- property robot: BaseRobot | None
Get forward reference to the robot which owns this link
link.robotis the robot referencelink.robot = ...checks and sets the robot reference
- Returns:
The robot object
- Setter accepts:
BaseRobot
- property scene_children: list[SceneNode]
Return the child nodes of this object in the scene graph.
Setting a new list of children updates each child’s
scene_parentto this object, but does not remove this object from any previous parent’sscene_children.This is a read/write property.
- Return type:
list(SceneNode)
- Seealso:
- property scene_parent: SceneNode | None
Return the parent node of this object in the scene graph.
Setting a new parent adds this object to the new parent’s
scene_children.This is a read/write property.
- Return type:
SceneNode | None
- Seealso:
- Setter accepts:
- property tlim: float | None
Get/set joint torque limits
link.tlimis the joint torque/force limitslink.tlim = ...checks and sets the joint torque limits
- Returns:
joint torque limits
Notes
The limits are not widely enforced within the toolbox.
If no joint torque limits are specified the value is
None
See also
- Setter accepts:
- tree() → str
Render the whole tree this node lives in as indented text – walks up to the root first (the same root-finding as
update()), then renders down from there, with this node marked with a trailing<==so its position in the tree is visible.- Return type:
- tree_children() → str
Render this node’s own subtree as indented text (one
repr()per line), not walking through parents – the same “not through parents” scope as_propagate_scene_children().Nodes have no
.namein this package, so each line is that node’s ownrepr()(type, constructor params, color, pose) – usually enough to tell siblings apart, since it’s rare for two distinct nodes to share an identical pose as well as everything else.- Return type:
- update() → None
Recompute the world transform of every node in the scene graph this node belongs to, starting from the root and working down.
Call this after changing any node’s
T/pose(or itsscene_parent) – nothing propagates automatically. It doesn’t matter which node in the graph you call it on: this always walks up to the root first, then pushes fresh world transforms down through the whole tree, not just this node’s own subtree.- Return type:
- property v: BaseET | None
Variable part of link ETS
- Returns:
joint variable transform
The ETS for each Link comprises a constant part (possible the identity) followed by an optional joint variable transform. This property returns the latter.
Examples
- property offset: Any
Get/set joint variable offset
link.offsetis the joint variable offset
- Returns:
joint variable offset
- Return type:
link.offset = ...checks and sets the joint variable offset
The offset is added to the joint angle before forward kinematics, and subtracted after inverse kinematics. It is used to define the joint configuration for zero joint coordinates.
- A(q: float = 0.0) → SE3[source]
Link transform matrix
- Parameters:
q (
float) – joint coordinate- Returns:
SE(3) link homogeneous transformation
- Return type:
A(q)is anSE3instance representing the SE(3) homogeneous transformation matrix corresponding to the link’s joint variableqwhich is either the Denavit-Hartenberg parameter \(\theta_j\) (revolute) or \(d_j\) (prismatic).This is the relative pose of the current link frame with respect to the previous link frame.
For details of the computation see the documentation for the subclasses, click on the right side of the class boxes below.
Note
For a revolute joint the
thetaparameter of the link is ignored, andqused instead.For a prismatic joint the
dparameter of the link is ignored, andqused instead.The joint
offsetparameter is added toqbefore computation of the transformation matrix.The computation is different for standard and modified Denavit-Hartenberg parameters.
See also
Revolute - standard DH
- class RevoluteDH(d=0.0, a=0.0, alpha=0.0, offset=0.0, qlim=None, flip=False, **kwargs)[source]
Bases:
DHLinkClass for revolute links using standard DH convention.
- Parameters:
d (
float) – kinematic - link offsetalpha (
float) – kinematic - link twista (
float) – kinematic - link lengthoffset (
float) – kinematic - joint variable offsetqlim (
ndarray|Sequence[float] |None) – joint variable limits [min, max]flip (
bool) – joint moves in opposite directionm (float) – dynamic - link mass
r (ndarray(3,)) – dynamic - position of COM with respect to link frame
I (ndarray) – dynamic - inertia of link with respect to COM
Jm (float) – dynamic - motor inertia
B (float, or ndarray(2,)) – dynamic - motor viscous friction: B=B⁺=B⁻, [B⁺, B⁻]
Tc (ndarray(2,)) – dynamic - motor Coulomb friction [Tc⁺, Tc⁻]
G (float) – dynamic - gear ratio
A subclass of the
DHLinkclass for a revolute joint that holds all information related to a robot link such as kinematics parameters, rigid-body inertial parameters, motor and transmission parameters. The link transform is \(\underbrace{\mathbf{T}_{rz}(q_i)}_{\mbox{variable}} \cdot \mathbf{T}_{tz}(d_i) \cdot \mathbf{T}_{tx}(a_i) \cdot \mathbf{T}_{rx}(\alpha_i)\) where \(q_i\) is the joint variable.- References:
Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7.
See also
Prismatic - standard DH
- class PrismaticDH(theta=0.0, a=0.0, alpha=0.0, offset=0.0, qlim=None, flip=False, **kwargs)[source]
Bases:
DHLinkClass for prismatic link using standard DH convention.
- Parameters:
theta (
float) – kinematic: joint anglealpha (
float) – kinematic - link twista (
float) – kinematic - link lengthoffset (
float) – kinematic - joint variable offsetqlim (
ndarray|Sequence[float] |None) – joint variable limits [min, max]flip (
bool) – joint moves in opposite directionm (float) – dynamic - link mass
r (ndarray(3,)) – dynamic - position of COM with respect to link frame
I (ndarray) – dynamic - inertia of link with respect to COM
Jm (float) – dynamic - motor inertia
B (float, or ndarray(2,)) – dynamic - motor viscous friction: B=B⁺=B⁻, [B⁺, B⁻]
Tc (ndarray(2,)) – dynamic - motor Coulomb friction [Tc⁺, Tc⁻]
G (float) – dynamic - gear ratio
A subclass of the DHLink class for a prismatic joint that holds all information related to a robot link such as kinematics parameters, rigid-body inertial parameters, motor and transmission parameters. The link transform is \(\mathbf{T}_{rz}(\theta_i) \cdot \underbrace{\mathbf{T}_{tz}(q_i)}_{\mbox{variable}} \cdot \mathbf{T}_{tx}(a_i) \cdot \mathbf{T}_{rx}(\alpha_i)\) where \(q_i\) is the joint variable.
- References:
Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7.
See also
Revolute - modified DH
- class RevoluteMDH(d=0.0, a=0.0, alpha=0.0, offset=0.0, qlim=None, flip=False, **kwargs)[source]
Bases:
DHLinkClass for revolute links using modified DH convention.
- Parameters:
d (
float) – kinematic - link offsetalpha (
float) – kinematic - link twista (
float) – kinematic - link lengthoffset (
float) – kinematic - joint variable offsetqlim (
ndarray|Sequence[float] |None) – joint variable limits [min, max]flip (
bool) – joint moves in opposite directionm (float) – dynamic - link mass
r (ndarray(3,)) – dynamic - position of COM with respect to link frame
I (ndarray) – dynamic - inertia of link with respect to COM
Jm (float) – dynamic - motor inertia
B (float, or ndarray(2,)) – dynamic - motor viscous friction: B=B⁺=B⁻, [B⁺, B⁻]
Tc (ndarray(2,)) – dynamic - motor Coulomb friction [Tc⁺, Tc⁻]
G (float) – dynamic - gear ratio
A subclass of the DHLink class for a revolute joint that holds all information related to a robot link such as kinematics parameters, rigid-body inertial parameters, motor and transmission parameters.
The link transform is
\(\mathbf{T}_{tx}(a_{i-1}) \cdot \mathbf{T}_{rx}(\alpha_{i-1}) \cdot \underbrace{\mathbf{T}_{rz}(q_i)}_{\mbox{variable}} \cdot \mathbf{T}_{tz}(d_i)\)
where \(q_i\) is the joint variable.
- References:
Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7.
See also
Prismatic - modified DH
- class PrismaticMDH(theta=0.0, a=0.0, alpha=0.0, offset=0.0, qlim=None, flip=False, **kwargs)[source]
Bases:
DHLinkClass for prismatic link using modified DH convention.
- Parameters:
theta (
float) – kinematic: joint anglealpha (
float) – kinematic - link twista (
float) – kinematic - link lengthoffset (
float) – kinematic - joint variable offsetqlim (
ndarray|Sequence[float] |None) – joint variable limits [min, max]flip (
bool) – joint moves in opposite directionm (float) – dynamic - link mass
r (ndarray(3,)) – dynamic - position of COM with respect to link frame
I (ndarray) – dynamic - inertia of link with respect to COM
Jm (float) – dynamic - motor inertia
B (float, or ndarray(2,)) – dynamic - motor viscous friction: B=B⁺=B⁻, [B⁺, B⁻]
Tc (ndarray(2,)) – dynamic - motor Coulomb friction [Tc⁺, Tc⁻]
G (float) – dynamic - gear ratio
A subclass of the DHLink class for a prismatic joint that holds all information related to a robot link such as kinematics parameters, rigid-body inertial parameters, motor and transmission parameters.
The link transform is
\(\mathbf{T}_{tx}(a_{i-1}) \cdot \mathbf{T}_{rx}(\alpha_{i-1}) \cdot \mathbf{T}_{rz}(\theta_i) \cdot \underbrace{\mathbf{T}_{tz}(q_i)}_{\mbox{variable}}\)
where \(q_i\) is the joint variable.
- References:
Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7.
See also
Models
A number of models are defined in terms of Denavit-Hartenberg parameters, either standard or modified. They can be listed by:
>>> import roboticstoolbox as rtb
>>> rtb.models.catalog(mtype="DH")
┌──────────┬───────────────┬────────────────────┬────────────┬─────┬──────┬──────────────────┬──────────┬──────────┬──────────────────────────┐
│ class │ robot name │ manufacturer │ model type │ DoF │ dims │ structure │ dynamics │ geometry │ keywords │
├──────────┼───────────────┼────────────────────┼────────────┼─────┼──────┼──────────────────┼──────────┼──────────┼──────────────────────────┤
│ Panda │ Panda │ Franka Emika │ DH │ 7 │ 3d │ RRRRRRR │ Y │ Y │ │
│ Puma560 │ Puma 560 │ Unimation │ DH │ 6 │ 3d │ RRRRRR │ Y │ Y │ dynamics, symbolic, mesh │
│ Stanford │ Stanford arm │ Victor Scheinman │ DH │ 6 │ 3d │ RRPRRR │ Y │ │ dynamics │
│ Ball │ ball │ │ DH │ 10 │ 3d │ RRRRRRRRRR │ │ │ │
│ Hyper │ Hyper10 │ │ DH │ 10 │ 3d │ RRRRRRRRRR │ │ │ symbolic │
│ Coil │ Coil10 │ │ DH │ 10 │ 3d │ RRRRRRRRRR │ │ │ symbolic │
│ Cobra600 │ Cobra600 │ Omron │ DH │ 4 │ 3d │ RRPR │ │ │ │
│ IRB140 │ IRB 140 │ ABB │ DH │ 6 │ 3d │ RRRRRR │ Y │ Y │ │
│ KR5 │ KR5 │ KUKA │ DH │ 6 │ 3d │ RRRRRR │ │ Y │ │
│ Orion5 │ Orion 5 │ RAWR Robotics │ DH │ 4 │ 3d │ RRRR │ │ │ │
│ Planar3 │ Planar 3 link │ │ DH │ 3 │ 3d │ RRR │ │ │ planar │
│ Planar2 │ Planar 2 link │ │ DH │ 2 │ 3d │ RR │ │ │ planar │
│ LWR4 │ LWR-IV │ Kuka │ DH │ 7 │ 3d │ RRRRRRR │ │ │ │
│ Sawyer │ Sawyer │ Rethink Robotics │ DH │ 7 │ 3d │ RRRRRRR │ │ │ redundant, symbolic │
│ UR3 │ UR3 │ Universal Robotics │ DH │ 6 │ 3d │ RRRRRR │ Y │ │ dynamics, symbolic │
│ UR5 │ UR5 │ Universal Robotics │ DH │ 6 │ 3d │ RRRRRR │ Y │ │ dynamics, symbolic │
│ UR10 │ UR10 │ Universal Robotics │ DH │ 6 │ 3d │ RRRRRR │ Y │ │ dynamics, symbolic │
│ Mico │ Mico │ Kinova │ DH │ 6 │ 3d │ RRRRRR │ │ │ symbolic │
│ Jaco │ Jaco │ Kinova │ DH │ 6 │ 3d │ RRRRRR │ │ │ symbolic │
│ Baxter │ Baxter-left │ Rethink Robotics │ DH │ 7 │ 3d │ RRRRRRR │ │ │ │
│ TwoLink │ 2 link │ │ DH │ 2 │ 3d │ RR │ Y │ │ planar, dynamics │
│ Hyper3d │ Hyper3d10 │ │ DH │ 10 │ 3d │ RRRRRRRRRR │ │ │ symbolic │
│ P8 │ P8 │ │ DH │ 8 │ 3d │ PPRRRRRR │ Y │ │ mobile, redundant │
│ AL5D │ AL5D │ Lynxmotion │ DH │ 4 │ 3d │ RRRR │ │ │ dynamics, symbolic │
└──────────┴───────────────┴────────────────────┴────────────┴─────┴──────┴──────────────────┴──────────┴──────────┴──────────────────────────┘
- class Panda[source]
Bases:
DHRobotA class representing the Panda robot arm.
Panda()is a class which models a Franka-Emika Panda robot and describes its kinematic characteristics using modified DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Panda() >>> print(robot) DHRobot.Panda: Panda (by Franka Emika), 7 joints (RRRRRRR), dynamics, geometry, modified DH parameters ┌─────────┬────────┬─────┬───────┬─────────┬────────┐ │ aⱼ₋₁ │ ⍺ⱼ₋₁ │ θⱼ │ dⱼ │ q⁻ │ q⁺ │ ├─────────┼────────┼─────┼───────┼─────────┼────────┤ │ 0.0 │ 0.0° │ q1 │ 0.333 │ -166.0° │ 166.0° │ │ 0.0 │ -90.0° │ q2 │ 0.0 │ -101.0° │ 101.0° │ │ 0.0 │ 90.0° │ q3 │ 0.316 │ -166.0° │ 166.0° │ │ 0.0825 │ 90.0° │ q4 │ 0.0 │ -176.0° │ -4.0° │ │ -0.0825 │ -90.0° │ q5 │ 0.384 │ -166.0° │ 166.0° │ │ 0.0 │ 90.0° │ q6 │ 0.0 │ -1.0° │ 215.0° │ │ 0.088 │ 90.0° │ q7 │ 0.107 │ -166.0° │ 166.0° │ └─────────┴────────┴─────┴───────┴─────────┴────────┘ ┌──────┬───────────────────────────────────────┐ │ tool │ t = 0, 0, 0.1; rpy/xyz = -45°, 0°, 0° │ └──────┴───────────────────────────────────────┘ ┌──────┬─────┬────────┬─────┬───────┬─────┬───────┬──────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │ ├──────┼─────┼────────┼─────┼───────┼─────┼───────┼──────┤ │ qr │ 0° │ -17.2° │ 0° │ -126° │ 0° │ 115° │ 45° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴─────┴────────┴─────┴───────┴─────┴───────┴──────┘
Note
SI units of metres are used.
The model includes a tool offset.
Code author: Samuel Drew
Code author: Peter Corke
- class Puma560(symbolic=False)[source]
Bases:
DHRobotClass that models a Puma 560 manipulator
- Parameters:
symbolic (
bool) – use symbolic constants
Puma560()is an object which models a Unimation Puma560 robot and describes its kinematic and dynamic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> print(robot) DHRobot.Puma560: Puma 560 (by Unimation), 6 joints (RRRRRR), dynamics, geometry, standard DH parameters ┌─────┬────────┬────────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├─────┼────────┼────────┼────────┼─────────┼────────┤ │ q1 │ 0.6718 │ 0 │ 90.0° │ -160.0° │ 160.0° │ │ q2 │ 0 │ 0.4318 │ 0.0° │ -45.0° │ 225.0° │ │ q3 │ 0.15 │ 0.0203 │ -90.0° │ -225.0° │ 45.0° │ │ q4 │ 0.4318 │ 0 │ 90.0° │ -110.0° │ 170.0° │ │ q5 │ 0 │ 0 │ -90.0° │ -100.0° │ 100.0° │ │ q6 │ 0 │ 0 │ 0.0° │ -266.0° │ 266.0° │ └─────┴────────┴────────┴────────┴─────────┴────────┘ ┌──────┬─────┬──────┬───────┬─────┬──────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼─────┼──────┼───────┼─────┼──────┼─────┤ │ qr │ 0° │ 90° │ -90° │ 0° │ 0° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ │ qn │ 0° │ 45° │ -180° │ 0° │ 45° │ 0° │ │ qs │ 0° │ 0° │ -90° │ 0° │ 0° │ 0° │ └──────┴─────┴──────┴───────┴─────┴──────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration, ‘L’ shaped configuration
qr, vertical ‘READY’ configuration
qs, arm is stretched out in the x-direction
qn, arm is at a nominal non-singular configuration
Note
SI units are used.
The model includes armature inertia and gear ratios.
The value of m1 is given as 0 here. Armstrong found no value for it and it does not appear in the equation for tau1 after the substitution is made to inertia about link frame rather than COG frame.
Gravity load torque is the motor torque necessary to keep the joint static, and is thus -ve of the gravity caused torque.
Warning
Compared to the MATLAB version of the Toolbox this model includes the pedestal, making the z-coordinates 26 inches larger.
- References:
“A search for consensus among model parameters reported for the PUMA 560 robot”, P. Corke and B. Armstrong-Helouvry, Proc. IEEE Int. Conf. Robotics and Automation, (San Diego), pp. 1608-1613, May 1994. (for kinematic and dynamic parameters)
“A combined optimization method for solving the inverse kinematics problem”, Wang & Chen, IEEE Trans. RA 7(4) 1991 pp 489-. (for joint angle limits)
https://github.com/4rtur1t0/ARTE/blob/master/robots/UNIMATE/puma560/parameters.m
Code author: Peter Corke
- ikine_a(T: SE3 | ndarray, config: str = 'lun', tol: float = 1e-06) → IKSolution[source]
Analytic inverse kinematic solution
- Parameters:
- Return type:
- Returns:
an IKSolution containing joint coordinates
q,successflag,residualerror value, andreasonstring if applicable
robot.ikine_a(T, config)is the joint coordinates which achieve the end-effector poseT. The configuration string selects the specific solution and is a string comprising the following letters:Letter
Meaning
l
Choose the left-handed configuration
r
Choose the right-handed configuration
u
Choose the elbow up configuration
d
Choose the elbow down configuration
n
Choose the wrist not-flipped configuration
f
Choose the wrist flipped configuration
Tis anSE3, or a 4x4 array, for a single pose. If it is anSE3holding N poses, or an array with shape (N, 4, 4), it is a trajectory and each pose is solved independently with the sameconfig. The result is the same as for the numerical IK solvers:qhas shape (n,) for a single pose, or (N, n) for a trajectorysuccessis True only if every pose was solvedresidualis the maximum residual over the poses, and is infinite if any pose is out of reachreasonis the reason given by the last pose that failed, if anyiterationsandsearchesare zero, this is not an iterative method
The joints of a pose that cannot be solved are NaN. Every solution is checked by forward kinematics, so
successis True only if the returnedqreaches the pose to withintol.This is a hand-written solution for the Puma 560 geometry, in particular a zero first link length and a lateral shoulder offset \(d_3\). It does not apply to other robots. Joint limits are not considered.
Changed in version 1.5.0: Accepts an array as well as an
SE3, returns a singleIKSolutionfor a trajectory like the numerical solvers (it was garbled, and failed for an unreachable pose), reports a pose closer to the waist axis than the shoulder offset as out of reach (it returnedsuccess=Truewith NaN joint coordinates), and checks the solution by forward kinematics. It no longer usesikine_6s, which is deprecated.- Reference:
Inverse kinematics for a PUMA 560, Paul and Zhang, The International Journal of Robotics Research, Vol. 5, No. 2, Summer 1986, p. 32-44
- Author:
based on MATLAB code by Robert Biro with Gary Von McMurray, GTRI/ATRP/IIMB, Georgia Institute of Technology, 2/13/95
- class Stanford[source]
Bases:
DHRobotClass that models a Stanford arm manipulator
Stanford()is a class which models a Unimation Puma560 robot and describes its kinematic and dynamic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Stanford() >>> print(robot) DHRobot.Stanford: Stanford arm (by Victor Scheinman), 6 joints (RRPRRR), dynamics, standard DH parameters ┌────────┬───────┬────────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├────────┼───────┼────────┼────────┼─────────┼────────┤ │ q1 │ 0.412 │ 0 │ -90.0° │ -170.0° │ 170.0° │ │ q2 │ 0.154 │ 0 │ 90.0° │ -170.0° │ 170.0° │ │ -90.0° │ q3 │ 0.0203 │ 0.0° │ 0.3048 │ 1.27 │ │ q4 │ 0 │ 0 │ -90.0° │ -170.0° │ 170.0° │ │ q5 │ 0 │ 0 │ 90.0° │ -90.0° │ 90.0° │ │ q6 │ 0 │ 0 │ 0.0° │ -170.0° │ 170.0° │ └────────┴───────┴────────┴────────┴─────────┴────────┘ ┌──────┬─────┬─────┬────┬─────┬─────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼─────┼─────┼────┼─────┼─────┼─────┤ │ qr │ 0° │ 0° │ 0 │ 0° │ 0° │ 0° │ │ qz │ 0° │ 0° │ 0 │ 0° │ 0° │ 0° │ └──────┴─────┴─────┴────┴─────┴─────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration
Note
SI units are used.
Gear ratios not currently known, though reflected armature inertia is known, so gear ratios are set to 1.
- References:
Kinematic data from “Modelling, Trajectory calculation and Servoing of a computer controlled arm”. Stanford AIM-177. Figure 2.3
Dynamic data from “Robot manipulators: mathematics, programming and control” Paul 1981, Tables 6.5, 6.6
Dobrotin & Scheinman, “Design of a computer controlled manipulator for robot research”, IJCAI, 1973.
Code author: Peter Corke
- class Ball(N=10)[source]
Bases:
DHRobotClass that models a ball manipulator
- Parameters:
The ball robot is an abstract robot with an arbitrary number of joints. At zero joint angles it is straight along the x-axis, and as the joint angles are increased (equally) it wraps up into a 3D ball shape.
Ball()is an object which describes the kinematic characteristics of a ball robot using standard DH conventions.Ball(N)as above, but models a robot withNjoints.
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Ball() >>> print(robot) DHRobot.Ball: ball, 10 joints (RRRRRRRRRR), standard DH parameters ┌──────┬────┬─────┬───────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├──────┼────┼─────┼───────┤ │ q1 │ 0 │ 0.1 │ 90.0° │ │ q2 │ 0 │ 0.1 │ 90.0° │ │ q3 │ 0 │ 0.1 │ 90.0° │ │ q4 │ 0 │ 0.1 │ 90.0° │ │ q5 │ 0 │ 0.1 │ 90.0° │ │ q6 │ 0 │ 0.1 │ 90.0° │ │ q7 │ 0 │ 0.1 │ 90.0° │ │ q8 │ 0 │ 0.1 │ 90.0° │ │ q9 │ 0 │ 0.1 │ 90.0° │ │ q10 │ 0 │ 0.1 │ 90.0° │ └──────┴────┴─────┴───────┘ ┌──────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │ q7 │ q8 │ q9 │ ├──────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ │ qr │ 57.3° │ 57.3° │ -38.2° │ 57.3° │ 57.3° │ -38.2° │ -38.2° │ 57.3° │ -38.2° │ 57.3° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
Defined joint configurations are:
qz, zero joint angles
q1, ball shaped configuration
- References:
“A divide and conquer articulated-body algorithm for parallel O(log(n)) calculation of rigid body dynamics, Part 2”, Int. J. Robotics Research, 18(9), pp 876-892.
Code author: Peter Corke
- class Coil(N=10, symbolic=False)[source]
Bases:
DHRobotCreate model of a coil manipulator
- Parameters:
The coil robot is an abstract robot with an arbitrary number of joints that folds into a helix shape. At zero joint angles it is straight along the x-axis, and as the joint angles are increased (equally) it wraps up into a 3D helix shape.
Coil()is an object which describes the kinematic characteristics of a coil robot using standard DH conventions.Coil(N)as above, but models a robot withNjoints.
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Coil() >>> print(robot) DHRobot.Coil: Coil10, 10 joints (RRRRRRRRRR), standard DH parameters ┌──────┬────┬─────┬───────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├──────┼────┼─────┼───────┤ │ q1 │ 0 │ 0.1 │ 90.0° │ │ q2 │ 0 │ 0.1 │ 90.0° │ │ q3 │ 0 │ 0.1 │ 90.0° │ │ q4 │ 0 │ 0.1 │ 90.0° │ │ q5 │ 0 │ 0.1 │ 90.0° │ │ q6 │ 0 │ 0.1 │ 90.0° │ │ q7 │ 0 │ 0.1 │ 90.0° │ │ q8 │ 0 │ 0.1 │ 90.0° │ │ q9 │ 0 │ 0.1 │ 90.0° │ │ q10 │ 0 │ 0.1 │ 90.0° │ └──────┴────┴─────┴───────┘ ┌──────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │ q7 │ q8 │ q9 │ ├──────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ │ qr │ 180° │ 180° │ 180° │ 180° │ 180° │ 180° │ 180° │ 180° │ 180° │ 180° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
Defined joint configurations are:
qz, zero joint angle configuration
- References:
“A divide and conquer articulated-body algorithm for parallel O(log(n)) calculation of rigid body dynamics, Part 2”, Int. J. Robotics Research, 18(9), pp 876-892.
Code author: Peter Corke
- class Hyper(N=10, a=None, symbolic=False)[source]
Bases:
DHRobotCreate model of a hyper redundant planar manipulator
- Parameters:
Hyper()is an object which describes the kinematics of a serial link manipulator with 10 joints which moves in the xy-plane, using standard DH conventions. At zero angles it forms a straight line along the x-axis.Hyper(N)as above, but models a robot withNjoints.
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Hyper() >>> print(robot) DHRobot.Hyper: Hyper10, 10 joints (RRRRRRRRRR), standard DH parameters ┌──────┬────┬─────┬──────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├──────┼────┼─────┼──────┤ │ q1 │ 0 │ 0.1 │ 0.0° │ │ q2 │ 0 │ 0.1 │ 0.0° │ │ q3 │ 0 │ 0.1 │ 0.0° │ │ q4 │ 0 │ 0.1 │ 0.0° │ │ q5 │ 0 │ 0.1 │ 0.0° │ │ q6 │ 0 │ 0.1 │ 0.0° │ │ q7 │ 0 │ 0.1 │ 0.0° │ │ q8 │ 0 │ 0.1 │ 0.0° │ │ q9 │ 0 │ 0.1 │ 0.0° │ │ q10 │ 0 │ 0.1 │ 0.0° │ └──────┴────┴─────┴──────┘ ┌──────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │ q7 │ q8 │ q9 │ ├──────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration
- References:
“A divide and conquer articulated-body algorithm for parallel O(log(n)) calculation of rigid body dynamics, Part 2”, Int. J. Robotics Research, 18(9), pp 876-892.
Code author: Peter Corke
- class Hyper3d(N=10, a=None, symbolic=False)[source]
Bases:
DHRobotCreate model of a hyper redundant manipulator
- Parameters:
Hyper3d()is an object which describes the kinematics of a serial link manipulator with 10 joints which moves in the xy-plane, using standard DH conventions. At zero angles it forms a straight line along the x-axis.Hyper3d(N)as above, but models a robot withNjoints.
>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Hyper3d() >>> print(robot) DHRobot.Hyper3d: Hyper3d10, 10 joints (RRRRRRRRRR), standard DH parameters ┌──────┬────┬─────┬───────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├──────┼────┼─────┼───────┤ │ q1 │ 0 │ 0.1 │ 90.0° │ │ q2 │ 0 │ 0.1 │ 90.0° │ │ q3 │ 0 │ 0.1 │ 90.0° │ │ q4 │ 0 │ 0.1 │ 90.0° │ │ q5 │ 0 │ 0.1 │ 90.0° │ │ q6 │ 0 │ 0.1 │ 90.0° │ │ q7 │ 0 │ 0.1 │ 90.0° │ │ q8 │ 0 │ 0.1 │ 90.0° │ │ q9 │ 0 │ 0.1 │ 90.0° │ │ q10 │ 0 │ 0.1 │ 90.0° │ └──────┴────┴─────┴───────┘ ┌──────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │ q7 │ q8 │ q9 │ ├──────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration
- References:
“A divide and conquer articulated-body algorithm for parallel O(log(n)) calculation of rigid body dynamics, Part 2”, Int. J. Robotics Research, 18(9), pp 876-892.
Code author: Peter Corke
- class Cobra600[source]
Bases:
DHRobotClass that models a Adept Cobra 600 SCARA manipulator
Cobra600()is a class which models an Adept Cobra 600 SCARA robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Cobra600() >>> print(robot) DHRobot.Cobra600: Cobra600 (by Omron), 4 joints (RRPR), standard DH parameters ┌──────┬───────┬───────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├──────┼───────┼───────┼────────┼─────────┼────────┤ │ q1 │ 0.387 │ 0.325 │ 0.0° │ -50.0° │ 50.0° │ │ q2 │ 0 │ 0.275 │ 180.0° │ -88.0° │ 88.0° │ │ 0.0° │ q3 │ 0 │ 0.0° │ 0 │ 0.21 │ │ q4 │ 0 │ 0 │ 0.0° │ -180.0° │ 180.0° │ └──────┴───────┴───────┴────────┴─────────┴────────┘ ┌──────┬─────┬─────┬────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ ├──────┼─────┼─────┼────┼─────┤ │ qz │ 0° │ 0° │ 0 │ 0° │ │ qr │ 0° │ 0° │ 0 │ 0° │ └──────┴─────┴─────┴────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration, ‘L’ shaped configuration
Note
SI units are used.
Robot has only 4 DoF.
Code author: Peter Corke
- class IRB140[source]
Bases:
DHRobotClass that models an ABB IRB140 manipulator
IRB140()is a class which models a Unimation Puma560 robot and describes its kinematic and dynamic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.IRB140() >>> print(robot) DHRobot.IRB140: IRB 140 (by ABB), 6 joints (RRRRRR), dynamics, geometry, standard DH parameters ┌─────┬───────┬──────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├─────┼───────┼──────┼────────┼─────────┼────────┤ │ q1 │ 0.352 │ 0.07 │ -90.0° │ -180.0° │ 180.0° │ │ q2 │ 0 │ 0.36 │ 0.0° │ -100.0° │ 100.0° │ │ q3 │ 0 │ 0 │ -90.0° │ -220.0° │ 60.0° │ │ q4 │ 0.38 │ 0 │ 90.0° │ -200.0° │ 200.0° │ │ q5 │ 0 │ 0 │ -90.0° │ -120.0° │ 120.0° │ │ q6 │ 0.065 │ 0 │ 0.0° │ -400.0° │ 400.0° │ └─────┴───────┴──────┴────────┴─────────┴────────┘ ┌──────┬─────┬──────┬───────┬─────┬──────┬──────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼─────┼──────┼───────┼─────┼──────┼──────┤ │ qr │ 0° │ -90° │ 90° │ 0° │ 90° │ -90° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ │ qd │ 0° │ -90° │ 180° │ 0° │ 0° │ -90° │ └──────┴─────┴──────┴───────┴─────┴──────┴──────┘
Defined joint configurations are:
qz, zero joint angle configuration
qr, vertical ‘READY’ configuration
qd, lower arm horizontal as per data sheet
Note
SI units of metres are used.
- References:
“IRB 140 data sheet”, ABB Robotics.
“Utilizing the Functional Work Space Evaluation Tool for Assessing a System Design and Reconfiguration Alternatives” A. Djuric and R. J. Urbanic
https://github.com/4rtur1t0/ARTE/blob/master/robots/ABB/IRB140/parameters.m
Code author: Peter Corke
- class KR5[source]
Bases:
DHRobotClass that models a Kuka KR5 manipulator
KR5()is a class which models a Kuka KR5 robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.KR5() >>> print(robot) DHRobot.KR5: KR5 (by KUKA), 6 joints (RRRRRR), geometry, standard DH parameters ┌─────┬────────┬──────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├─────┼────────┼──────┼────────┼─────────┼────────┤ │ q1 │ 0.4 │ 0.18 │ -90.0° │ -155.0° │ 155.0° │ │ q2 │ 0 │ 0.6 │ 0.0° │ -180.0° │ 65.0° │ │ q3 │ 0 │ 0.12 │ 90.0° │ -15.0° │ 158.0° │ │ q4 │ -0.62 │ 0 │ -90.0° │ -350.0° │ 350.0° │ │ q5 │ 0 │ 0 │ 90.0° │ -130.0° │ 130.0° │ │ q6 │ -0.115 │ 0 │ 180.0° │ -350.0° │ 350.0° │ └─────┴────────┴──────┴────────┴─────────┴────────┘ ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤ │ qr │ 45° │ 60° │ 45° │ 30° │ 45° │ 30° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ │ qk1 │ 45° │ 60° │ 45° │ 30° │ 45° │ 30° │ │ qk2 │ 45° │ 60° │ 30° │ 60° │ 45° │ 30° │ │ qk3 │ 30° │ 60° │ 30° │ 60° │ 30° │ 60° │ └──────┴──────┴──────┴──────┴──────┴──────┴──────┘
Defined joint configurations are:
qk1, nominal working position 1
qk2, nominal working position 2
qk3, nominal working position 3
Note
SI units of metres are used.
Includes an 11.5cm tool in the z-direction
Code author: Gautam Sinha, Indian Institute of Technology, Kanpur (original MATLAB version)
Code author: Samuel Drew
Code author: Peter Corke
- class Orion5(base=None)[source]
Bases:
DHRobotClass that models a RAWR robotics Orion5 manipulator
Orion5()is a class which models a RAWR Robotics Orion5 robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Orion5() >>> print(robot) DHRobot.Orion5: Orion 5 (by RAWR Robotics), 4 joints (RRRR), standard DH parameters ┌─────┬───────┬─────────┬───────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├─────┼───────┼─────────┼───────┼─────────┼────────┤ │ q1 │ 0.053 │ 0 │ 90.0° │ -180.0° │ 180.0° │ │ q2 │ 0 │ 0.1704 │ 0.0° │ 10.0° │ 122.5° │ │ q3 │ 0 │ -0.1363 │ 0.0° │ 20.0° │ 340.0° │ │ q4 │ 0 │ 0.126 │ 0.0° │ 45.0° │ 315.0° │ └─────┴───────┴─────────┴───────┴─────────┴────────┘ ┌──────┬────────────────────────────────────┐ │ base │ │ │ tool │ t = 0, 0, 0; rpy/xyz = 0°, 90°, 0° │ └──────┴────────────────────────────────────┘ ┌──────┬─────┬──────┬───────┬───────┐ │ name │ q0 │ q1 │ q2 │ q3 │ ├──────┼─────┼──────┼───────┼───────┤ │ qr │ 0° │ 0° │ 180° │ 90° │ │ qz │ 0° │ 0° │ 0° │ 0° │ │ qv │ 0° │ 90° │ 180° │ 180° │ │ qh │ 0° │ 0° │ 180° │ 90° │ └──────┴─────┴──────┴───────┴───────┘
Defined joint configurations are:
qz, zero angles, all folded up
qv, stretched out vertically
qh, arm horizontal, hand down
Note
SI units of metres are used.
Robot has only 4 DoF.
- References:
https://rawrobotics.com.au/orion5https://drive.google.com/file/d/0B6_9_-ZgiRdTNkVqMEkxN2RSc2c/view
Code author: Aditya Dua
Code author: Peter Corke
- class Planar3[source]
Bases:
DHRobotClass that models a planar 3-link robot
Planar2()is a class which models a 3-link planar robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Planar3() >>> print(robot) DHRobot.Planar3: Planar 3 link, 3 joints (RRR), standard DH parameters ┌─────┬────┬────┬──────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├─────┼────┼────┼──────┤ │ q1 │ 0 │ 1 │ 0.0° │ │ q2 │ 0 │ 1 │ 0.0° │ │ q3 │ 0 │ 1 │ 0.0° │ └─────┴────┴────┴──────┘ ┌──────┬─────┬─────┬─────┐ │ name │ q0 │ q1 │ q2 │ ├──────┼─────┼─────┼─────┤ │ qr │ 0° │ 0° │ 0° │ │ qz │ 0° │ 0° │ 0° │ └──────┴─────┴─────┴─────┘
Defined joint configurations are:
qz, zero angles, all folded up
Note
Robot has only 3 DoF.
Code author: Peter Corke
- class Planar2(symbolic=False)[source]
Bases:
DHRobotClass that models a planar 2-link robot
Planar2()is a class which models a 2-link planar robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Planar2() >>> print(robot) DHRobot.Planar2: Planar 2 link, 2 joints (RR), standard DH parameters ┌─────┬────┬────┬──────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├─────┼────┼────┼──────┤ │ q1 │ 0 │ 1 │ 0.0° │ │ q2 │ 0 │ 1 │ 0.0° │ └─────┴────┴────┴──────┘ ┌──────┬──────┬──────┐ │ name │ q0 │ q1 │ ├──────┼──────┼──────┤ │ qr │ 0° │ 90° │ │ qz │ 0° │ 0° │ │ q1 │ 0° │ 90° │ │ q2 │ 90° │ -90° │ └──────┴──────┴──────┘
Defined joint configurations are:
qz, zero angles, all folded up
q1, links are horizontal and vertical respectively
q2, links are vertical and horizontal respectively
Note
Robot has only 2 DoF.
Code author: Peter Corke
- class LWR4[source]
Bases:
DHRobotClass that models a LWR-IV manipulator
LWR4()is a class which models a Kuka LWR-IV robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.LWR4() >>> print(robot) DHRobot.LWR4: LWR-IV (by Kuka), 7 joints (RRRRRRR), standard DH parameters ┌─────┬──────┬────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├─────┼──────┼────┼────────┼─────────┼────────┤ │ q1 │ 0 │ 0 │ 90.0° │ -166.0° │ 166.0° │ │ q2 │ 0 │ 0 │ -90.0° │ -101.0° │ 101.0° │ │ q3 │ 0.4 │ 0 │ -90.0° │ -166.0° │ 166.0° │ │ q4 │ 0 │ 0 │ 90.0° │ -176.0° │ -4.0° │ │ q5 │ 0.39 │ 0 │ 90.0° │ -166.0° │ 166.0° │ │ q6 │ 0 │ 0 │ -90.0° │ -1.0° │ 215.0° │ │ q7 │ 0 │ 0 │ 0.0° │ -166.0° │ 166.0° │ └─────┴──────┴────┴────────┴─────────┴────────┘ ┌──────┬───────────────────────────────────────┐ │ tool │ t = 0, 0, 0.1; rpy/xyz = -45°, 0°, 0° │ └──────┴───────────────────────────────────────┘ ┌──────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │ ├──────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration
Note
SI units are used.
Code author: Peter Corke
- class UR3(symbolic=False)[source]
Bases:
DHRobotClass that models a Universal Robotics UR3 manipulator
- Parameters:
symbolic (
bool) – use symbolic constants
UR3()is an object which models a Unimation Puma560 robot and describes its kinematic and dynamic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.UR3() >>> print(robot) DHRobot.UR3: UR3 (by Universal Robotics), 6 joints (RRRRRR), dynamics, standard DH parameters ┌─────┬─────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├─────┼─────────┼─────────┼────────┤ │ q1 │ 0.1519 │ 0 │ 90.0° │ │ q2 │ 0 │ -0.2437 │ 0.0° │ │ q3 │ 0 │ -0.2132 │ 0.0° │ │ q4 │ 0.1124 │ 0 │ 90.0° │ │ q5 │ 0.08535 │ 0 │ -90.0° │ │ q6 │ 0.0819 │ 0 │ 0.0° │ └─────┴─────────┴─────────┴────────┘ ┌──────┬───────┬─────┬─────┬─────┬──────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼───────┼─────┼─────┼─────┼──────┼─────┤ │ qr │ 180° │ 0° │ 0° │ 0° │ 90° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴───────┴─────┴─────┴─────┴──────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration
qr, arm horizontal along x-axis
Note
SI units are used.
- References:
- Sealso:
Code author: Peter Corke
- class UR5(symbolic=False)[source]
Bases:
DHRobotClass that models a Universal Robotics UR5 manipulator
- Parameters:
symbolic (
bool) – use symbolic constants
UR5()is an object which models a Unimation Puma560 robot and describes its kinematic and dynamic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.UR5() >>> print(robot) DHRobot.UR5: UR5 (by Universal Robotics), 6 joints (RRRRRR), dynamics, standard DH parameters ┌─────┬─────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├─────┼─────────┼─────────┼────────┤ │ q1 │ 0.08946 │ 0 │ 90.0° │ │ q2 │ 0 │ -0.425 │ 0.0° │ │ q3 │ 0 │ -0.3922 │ 0.0° │ │ q4 │ 0.1091 │ 0 │ 90.0° │ │ q5 │ 0.09465 │ 0 │ -90.0° │ │ q6 │ 0.0823 │ 0 │ 0.0° │ └─────┴─────────┴─────────┴────────┘ ┌──────┬───────┬─────┬─────┬─────┬──────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼───────┼─────┼─────┼─────┼──────┼─────┤ │ qr │ 180° │ 0° │ 0° │ 0° │ 90° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴───────┴─────┴─────┴─────┴──────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration
qr, arm horizontal along x-axis
Note
SI units are used.
- References:
- Sealso:
UR4,UR10()
Code author: Peter Corke
- class UR10(symbolic=False)[source]
Bases:
DHRobotClass that models a Universal Robotics UR10 manipulator
- Parameters:
symbolic (
bool) – use symbolic constants
UR10()is an object which models a Unimation Puma560 robot and describes its kinematic and dynamic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.UR10() >>> print(robot) DHRobot.UR10: UR10 (by Universal Robotics), 6 joints (RRRRRR), dynamics, standard DH parameters ┌─────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├─────┼────────┼─────────┼────────┤ │ q1 │ 0.1273 │ 0 │ 90.0° │ │ q2 │ 0 │ -0.612 │ 0.0° │ │ q3 │ 0 │ -0.5723 │ 0.0° │ │ q4 │ 0.1639 │ 0 │ 90.0° │ │ q5 │ 0.1157 │ 0 │ -90.0° │ │ q6 │ 0.0922 │ 0 │ 0.0° │ └─────┴────────┴─────────┴────────┘ ┌──────┬───────┬─────┬─────┬─────┬──────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼───────┼─────┼─────┼─────┼──────┼─────┤ │ qr │ 180° │ 0° │ 0° │ 0° │ 90° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴───────┴─────┴─────┴─────┴──────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration
qr, arm horizontal along x-axis
Note
SI units are used.
The last link’s inertia tensor has \(I_{xx} = 0\) – that’s not a bug in this model, it’s what the manufacturer’s own reference (below) publishes. It makes the robot’s inertia matrix near-singular (
det(robot.inertia(q)) ~ 2e-6), so dynamics work that needs a well-conditioned inertia matrix should account for this.
- References:
- Sealso:
Code author: Peter Corke
- class Sawyer(symbolic=False)[source]
Bases:
DHRobotClass that models a Sawyer manipulator
- Parameters:
symbolic (
bool) – use symbolic constants
Sawyer()is an object which models a Rethink Sawyer robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Sawyer() >>> print(robot) DHRobot.Sawyer: Sawyer (by Rethink Robotics), 7 joints (RRRRRRR), standard DH parameters ┌─────┬────────┬───────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├─────┼────────┼───────┼────────┤ │ q1 │ 0.317 │ 0.081 │ -90.0° │ │ q2 │ 0.1925 │ 0 │ -90.0° │ │ q3 │ 0.4 │ 0 │ -90.0° │ │ q4 │ 0.1685 │ 0 │ -90.0° │ │ q5 │ 0.4 │ 0 │ -90.0° │ │ q6 │ 0.1363 │ 0 │ -90.0° │ │ q7 │ 0.1338 │ 0 │ 0.0° │ └─────┴────────┴───────┴────────┘ ┌──────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │ ├──────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ qr │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ └──────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration, ‘L’ shaped configuration
- References:
-Layeghi, Daniel. “Dynamic and Kinematic Modelling of the Sawyer Arm ” Google Sites, 20 Nov. 2017
Note
SI units of metres are used.
- class Mico(symbolic=False)[source]
Bases:
DHRobotClass that models a Kinova Mico manipulator
- Parameters:
symbolic (
bool) – use symbolic constants
Mico()is an object which models a Kinova Mico robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> print(robot) DHRobot.Puma560: Puma 560 (by Unimation), 6 joints (RRRRRR), dynamics, geometry, standard DH parameters ┌─────┬────────┬────────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├─────┼────────┼────────┼────────┼─────────┼────────┤ │ q1 │ 0.6718 │ 0 │ 90.0° │ -160.0° │ 160.0° │ │ q2 │ 0 │ 0.4318 │ 0.0° │ -45.0° │ 225.0° │ │ q3 │ 0.15 │ 0.0203 │ -90.0° │ -225.0° │ 45.0° │ │ q4 │ 0.4318 │ 0 │ 90.0° │ -110.0° │ 170.0° │ │ q5 │ 0 │ 0 │ -90.0° │ -100.0° │ 100.0° │ │ q6 │ 0 │ 0 │ 0.0° │ -266.0° │ 266.0° │ └─────┴────────┴────────┴────────┴─────────┴────────┘ ┌──────┬─────┬──────┬───────┬─────┬──────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼─────┼──────┼───────┼─────┼──────┼─────┤ │ qr │ 0° │ 90° │ -90° │ 0° │ 0° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ │ qn │ 0° │ 45° │ -180° │ 0° │ 45° │ 0° │ │ qs │ 0° │ 0° │ -90° │ 0° │ 0° │ 0° │ └──────┴─────┴──────┴───────┴─────┴──────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration, ‘L’ shaped configuration
qr, vertical ‘READY’ configuration
qs, arm is stretched out in the x-direction
qn, arm is at a nominal non-singular configuration
Note
SI units are used.
- References:
“DH Parameters of Mico” Version 1.0.8, July 25, 2013.
See also
- class Jaco(symbolic=False)[source]
Bases:
DHRobotClass that models a Kinova Jaco manipulator
- Parameters:
symbolic (
bool) – use symbolic constants
Jaco()is an object which models a Kinova Jaco robot and describes its kinematic characteristics using standard DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> print(robot) DHRobot.Puma560: Puma 560 (by Unimation), 6 joints (RRRRRR), dynamics, geometry, standard DH parameters ┌─────┬────────┬────────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├─────┼────────┼────────┼────────┼─────────┼────────┤ │ q1 │ 0.6718 │ 0 │ 90.0° │ -160.0° │ 160.0° │ │ q2 │ 0 │ 0.4318 │ 0.0° │ -45.0° │ 225.0° │ │ q3 │ 0.15 │ 0.0203 │ -90.0° │ -225.0° │ 45.0° │ │ q4 │ 0.4318 │ 0 │ 90.0° │ -110.0° │ 170.0° │ │ q5 │ 0 │ 0 │ -90.0° │ -100.0° │ 100.0° │ │ q6 │ 0 │ 0 │ 0.0° │ -266.0° │ 266.0° │ └─────┴────────┴────────┴────────┴─────────┴────────┘ ┌──────┬─────┬──────┬───────┬─────┬──────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼─────┼──────┼───────┼─────┼──────┼─────┤ │ qr │ 0° │ 90° │ -90° │ 0° │ 0° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ │ qn │ 0° │ 45° │ -180° │ 0° │ 45° │ 0° │ │ qs │ 0° │ 0° │ -90° │ 0° │ 0° │ 0° │ └──────┴─────┴──────┴───────┴─────┴──────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration, ‘L’ shaped configuration
qr, vertical ‘READY’ configuration
qs, arm is stretched out in the x-direction
qn, arm is at a nominal non-singular configuration
Note
SI units are used.
- References:
“DH Parameters of Jaco” Version 1.0.8, July 25, 2013.
See also
- class Baxter(arm='left')[source]
Bases:
DHRobotClass that models a Baxter manipulator
- Parameters:
symbolic (bool) – use symbolic constants
Baxter()is an object which models the left arm of the two 7-joint arms of a Rethink Robotics Baxter robot using standard DH conventions.Baxter(which)as above but models the specified arm andwhichis either ‘left’ or ‘right’.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Baxter() >>> print(robot) DHRobot.Baxter: Baxter-left (by Rethink Robotics), 7 joints (RRRRRRR), standard DH parameters ┌───────────┬───────┬───────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├───────────┼───────┼───────┼────────┤ │ q1 │ 0.27 │ 0.069 │ -90.0° │ │ q2 + 90° │ 0 │ 0 │ 90.0° │ │ q3 │ 0.364 │ 0.069 │ -90.0° │ │ q4 │ 0 │ 0 │ 90.0° │ │ q5 │ 0.374 │ 0.01 │ -90.0° │ │ q6 │ 0 │ 0 │ 90.0° │ │ q7 │ 0.28 │ 0 │ 0.0° │ └───────────┴───────┴───────┴────────┘ ┌──────┬──┐ │ base │ │ └──────┴──┘ ┌──────┬─────┬──────┬──────┬─────┬──────┬─────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ q6 │ ├──────┼─────┼──────┼──────┼─────┼──────┼─────┼─────┤ │ qr │ 0° │ -90° │ -90° │ 0° │ 0° │ 0° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ │ qs │ 0° │ 0° │ -90° │ 0° │ 0° │ 0° │ 0° │ │ qn │ 0° │ 45° │ 90° │ 0° │ 45° │ 0° │ 0° │ └──────┴─────┴──────┴──────┴─────┴──────┴─────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration
qr, vertical ‘READY’ configuration
qs, arm is stretched out in the X direction
qd, lower arm horizontal as per data sheet
Note
SI units are used.
Warning
The base transform is set to reflect the pose of the arm’s shoulder with respect to the base. Changing the base attribute of the arm will overwrite this, IT DOES NOT CHANGE THE POSE OF BAXTER’s base. Instead do
baxter.base = newbase * baxter.base.- References:
“Kinematics Modeling and Experimental Verification of Baxter Robot” Z. Ju, C. Yang, H. Ma, Chinese Control Conf, 2015.
Code author: Peter Corke
- class TwoLink(symbolic=False, mdh=False, inertia=False)[source]
Bases:
DHRobotClass that models a 2-link robot moving in the vertical plane
- Parameters:
TwoLink()is a class which models a 2-link planar robot and describes its kinematic and dynamic characteristics using standard DH conventions. of a simple planar 2-link mechanism moving in the xz-plane, it experiences gravity loading. All mass is concentrated at the joints.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.TwoLink() >>> print(robot) DHRobot.TwoLink: 2 link, 2 joints (RR), dynamics, standard DH parameters ┌─────┬────┬────┬──────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ ├─────┼────┼────┼──────┤ │ q1 │ 0 │ 1 │ 0.0° │ │ q2 │ 0 │ 1 │ 0.0° │ └─────┴────┴────┴──────┘ ┌──────┬──┐ │ base │ │ └──────┴──┘ ┌──────┬──────┬──────┐ │ name │ q0 │ q1 │ ├──────┼──────┼──────┤ │ qr │ 30° │ -30° │ │ qz │ 0° │ 0° │ │ q1 │ 0° │ 90° │ │ q2 │ 90° │ -90° │ │ qn │ 30° │ -30° │ └──────┴──────┴──────┘
The parameters values depend on the
symbolicandmdhparametersParameters
Numeric values
Symbolic values
link lengths
1, 1
a1, a2
link masses
1, 1
m1, m2
link CoMs in the link frame x-direction DH
-0.5, -0.5
c1, c2
link CoMs in the link frame x-direction MDH
0.5, 0.5
c1, c2
gravitational acceleration
9.8
g
Defined joint configurations are:
qz, zero angles, all folded up
q1, links are horizontal and vertical respectively
q2, links are vertical and horizontal respectively
qn, nominal working configuration
Note
Robot has only 2 DoF.
Motor inertia is 0.
Link inertias are 0 unless
inertiais True.Viscous and Coulomb friction is 0.
- Reference:
Based on Fig 3-6 (p73) of Spong and Vidyasagar (1st edition).
Code author: Peter Corke
- class P8[source]
Bases:
DHRobotClass that models a Puma robot on an XY base
P8()is an object which models an 8-axis robot comprising a Puma 560 robot on an XY base. Joints 0 and 1 are the base, joints 2-7 are the robot arm.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Puma560() >>> print(robot) DHRobot.Puma560: Puma 560 (by Unimation), 6 joints (RRRRRR), dynamics, geometry, standard DH parameters ┌─────┬────────┬────────┬────────┬─────────┬────────┐ │ θⱼ │ dⱼ │ aⱼ │ ⍺ⱼ │ q⁻ │ q⁺ │ ├─────┼────────┼────────┼────────┼─────────┼────────┤ │ q1 │ 0.6718 │ 0 │ 90.0° │ -160.0° │ 160.0° │ │ q2 │ 0 │ 0.4318 │ 0.0° │ -45.0° │ 225.0° │ │ q3 │ 0.15 │ 0.0203 │ -90.0° │ -225.0° │ 45.0° │ │ q4 │ 0.4318 │ 0 │ 90.0° │ -110.0° │ 170.0° │ │ q5 │ 0 │ 0 │ -90.0° │ -100.0° │ 100.0° │ │ q6 │ 0 │ 0 │ 0.0° │ -266.0° │ 266.0° │ └─────┴────────┴────────┴────────┴─────────┴────────┘ ┌──────┬─────┬──────┬───────┬─────┬──────┬─────┐ │ name │ q0 │ q1 │ q2 │ q3 │ q4 │ q5 │ ├──────┼─────┼──────┼───────┼─────┼──────┼─────┤ │ qr │ 0° │ 90° │ -90° │ 0° │ 0° │ 0° │ │ qz │ 0° │ 0° │ 0° │ 0° │ 0° │ 0° │ │ qn │ 0° │ 45° │ -180° │ 0° │ 45° │ 0° │ │ qs │ 0° │ 0° │ -90° │ 0° │ 0° │ 0° │ └──────┴─────┴──────┴───────┴─────┴──────┴─────┘
Defined joint configurations are:
qz, zero joint angle configuration, ‘L’ shaped configuration
Note
SI units are used.
Code author: Peter Corke
See also
Puma560
- class AL5D(symbolic=False)[source]
Bases:
DHRobotClass that models a Lynxmotion AL5D manipulator
- Parameters:
symbolic (
bool) – use symbolic constants
AL5D()is an object which models a Lynxmotion AL5D robot and describes its kinematic and dynamic characteristics using modified DH conventions.>>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.AL5D() >>> print(robot) DHRobot.AL5D: AL5D (by Lynxmotion), 4 joints (RRRR), modified DH parameters ┌─────────┬────────┬─────────────┬──────────┬────────┬───────┐ │ aⱼ₋₁ │ ⍺ⱼ₋₁ │ θⱼ │ dⱼ │ q⁻ │ q⁺ │ ├─────────┼────────┼─────────────┼──────────┼────────┼───────┤ │ 0 │ 180.0° │ q1 + 90° │ -0.06858 │ -90.0° │ 90.0° │ │ 0.002 │ 90.0° │ q2 + 180° │ 0 │ -90.0° │ 90.0° │ │ 0.14679 │ 180.0° │ q3 - 2.45° │ 0 │ -90.0° │ 90.0° │ │ 0.17751 │ 180.0° │ q4 - 92.4° │ 0 │ -90.0° │ 90.0° │ └─────────┴────────┴─────────────┴──────────┴────────┴───────┘ ┌──────┬───────────────────────────────────────┐ │ tool │ t = 0.077, 0, 0; rpy/xyz = 0°, 0°, 0° │ └──────┴───────────────────────────────────────┘ ┌──────┬──────┬──────┬──────┬──────┐ │ name │ q0 │ q1 │ q2 │ q3 │ ├──────┼──────┼──────┼──────┼──────┤ │ home │ 90° │ 90° │ 90° │ 90° │ └──────┴──────┴──────┴──────┴──────┘
Defined joint configurations are:
qz, zero joint angle configuration
Note
SI units are used.
- References:
Code author: Tassos Natsakis