IK paper
IK paper
2019 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any
current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new
collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other
works.
keywords={},
doi={10.1109/ICAR46387.2019.8981554},
ISSN={},
month={Dec},}
Inverse Kinematics with Forward Dynamics Solvers for Sampled
Motion Tracking
Stefan Scherzinger1 , Arne Roennau1 and Rüdiger Dillmann2
Abstract— Tracking Cartesian motion with end effectors is sparse to serve as direct joint control commands and cause
a fundamental task in robot control. For motion that is not jumps in the robot’s actuators. A remedy is interpolating
known in advance, the solvers must find fast solutions to the in task space, leading again to the problem of decoupled
inverse kinematics (IK) problem for discretely sampled target
poses. On joint control level, however, the robot’s actuators solutions in joint space.
operate in a continuous domain, requiring smooth transitions In this paper we describe an IK approach that inherently
between individual states. In this work, we present a boost achieves both goals for real-time target following. Our ap-
to the well-known Jacobian transpose method to address proach enhances the well-known Jacobian transpose method
this goal, using the mass matrix of a virtually conditioned with a simple but effective component – a conditioned,
twin of the manipulator. Results on the UR10 show superior
convergence and quality of our dynamics-based solver against virtual mass matrix – leading to intuitive solutions of the
the plain Jacobian method. Our algorithm is straightforward IK solver and to smooth intermediate states between sparse
to implement as a controller, using common robotics libraries. targets. To support the vastly growing Robot Operating
System (ROS)4 [10], we accompany the paper with a ROS-
I. INTRODUCTION control [11] controller implementation as power-on-and-go
In robotics, solutions to the Inverse Kinematics (IK) solution for the robotics community5 .
problem are fundamental for manipulator control. Articulated
mechanisms are powered in their joints, and hence require II. P ROBLEM STATEMENT AND RELATED WORK
control algorithms to perform continuous mappings from The forward mapping of the joint positions vector q to
task space to joint space. Being such a core element in Cartesian space is given by
robot control, IK has received significant attention in the last
x = g (q) (1)
decades and has lead to a wide range of different methods.
See e.g. [1] for an overview. Among the fastest approaches such that q = g −1 (x) would represent a close form solu-
are closed form solutions, which are analytically derived tion to the inverse problem, which is to be approximated
solutions, specifically tailored for each robot kinematics. numerically. The velocity vector q̇ maps with
IKFast3 with an example application in [2]. However, closed
form solutions are sensitive to impossible-to-reach targets. ẋ = J (q) q̇ (2)
Numerical approaches provide trade-offs between accuracy to end effector velocity ẋ, using the manipulator Jacobian
and stability, usually leveraging the manipulator Jacobian: J . Furthermore, the common relation
E.g. its transpose [3], [4], [5], its inverse with singularity
stabilizing measures, such as Damped Least Squares (DLS) τ = J T (q) f (3)
[6], [7], [8] or Selectively Damped Least Squares (SDLS) holds for a static end effector force vector f and torques τ
[9]. More recent improvements have shown excellent success in the joints of the robot manipulator. In further notations
rates for general IK solving [8]. While suitable for searching we will drop the joint configuration dependency of J (q) for
vast regions of the solution space in the context of motion the sake of brevity. Using J T to solve (1) for q has been
planning, finding individual joint configurations is not always proposed independently by Wolovich et al [3] and Balestrino
sufficient: et al [4].
Target motion is often sampled into discrete target poses, In [4] the authors describe a dynamical systems according
such as in virtual servoing or end effector teleoperation. to
Solving the IK problem for each target individually leads q̇ = J T Q(xd − g(q)) + w (4)
to valid, but decoupled solutions in joint space with no
guaranteed feasibility of execution. On the other hand, for for coordinate transformations from task- to joint space,
low-frequency sampled targets, individual solutions are too with Q denoting an arbitrary positive definite matrix and
w (Q, J , ) representing an adaptation term, whose exact
1 Stefan Scherzinger and Arne Roennau are with FZI Research
expression we do not repeat here. The authors show asymp-
Center for Information Technology, Haid-und-Neu-Str. 10-14,
76131 Karlsruhe, Germany [email protected] totic stability around the Cartesian desired pose xd with
[email protected]
2 Rüdiger Dillmann is with IAR Institute for Anthropomatics and 3 http://openrave.org/docs/0.8.2/openravepy/ikfast/
4 www.ros.org
Robotics, HIS Humanoids and Intelligence Systems Lab, KIT Karl-
sruhe Institute of Technology, Adenauerring 2, 76131 Karlsruhe, Germany 5 https://github.com/fzi-forschungszentrum-
[email protected] informatik/cartesian_controllers
= xd − g(q), and validate their approach on a three
DOF mechanism. Although proving effective in converging,
(4) does not offer an intuitive interpretation. Furthermore,
the authors state that velocity tracking is only matched in
the mean, requiring additional filters to deliver real angular
Fig. 1: Closed loop control scheme of our IK solver. The control
velocities for robot control. plant uses simplified forward dynamics computation of a virtually-
In [5] Pechev uses a similar technique with Feedback In- conditioned twin of the real robot.
verse Kinematics (FIK) from a control perspective, deriving
−1 d
q̇ = J T Q J J T Q + I ẋ (5)
respectively. Rearranging for q̈ and using (3) yields the
as system dynamics. In this case Q denotes a dynamic, non- manipulator’s acceleration due to external forces f acting
diagonal matrix that involves an off-line state space optimiza- on its end effector.
tion subject to manipulator dynamics and task requirements.
Solving (5) in a feedback loop as a filter avoids matrix q̈ = H −1 J T f − H −1 C(q, q̇) − H −1 G(q) (8)
inversions, and performs well in singularity experiments Again, we dropped the dependency of q in the notation
in comparison to the DLS method from [6], albeit only for brevity. Solving (8) for q is considered with forward
presented on a three DOF planar manipulator. The Jacobian dynamics, i.e. simulating the mechanism’s motion through
transpose is also commonly used in Cartesian control, see time if loads f are applied. This is commonly achieved
e.g. [12], using the real plants dynamics in these cases. Here, with numerical integration methods and is a vital part in
however, we separate the computation of the IK problem physics engines. The right-hand side of (8) is a superposi-
from the underlying manipulator, which we see as a black tion of acceleration terms in joint space. While taking all
box to be controlled in an open loop fashion with desired terms into consideration is crucial for simulating physically
configurations q d (t) exclusively. correct motion, our approach for solving IK problems has
In [3] the authors derive a solution to the IK problem by a different focus and motivates two simplifications: If we
proposing the usage of J T in form of a simpler dynamical drop acceleration due to gravity (G = 0) and consider
system instantaneous motion only for each cycle (i.e. q̇ = 0), which
q̈ = KJ T xd − g(q)
(6) equals setting H −1 C(q, q̇) = 0, our system still accelerates
They provide a Lyapunov stability analysis and show that in the direction pointed to by f , but that acceleration is not
the system is asymptotically stable in the error dynamics, biased by velocity-dependent non-linearities, nor the effect
using an arbitrary positive definite matrix K. However, they of gravity. To be concise with this simplification, we do not
leave a possible conditioning of K aside and remain with accumulate velocity during time integration in our algorithm
the general proof. In the remainder of the paper we will refer in section IV. Implications of this approach are discussed in
to this approach as the Jacobian transpose method. section VI. Expelling both acceleration terms from (8), we
In this work, we investigate the benefits of choosing K obtain the simplified system
from (6) not to be constant, but instead to be the dynamically
q̈ = H −1 J T f , (9)
changing inertia matrix of a virtually conditioned twin of the
robot manipulator. Like the work in [5] we show the impor- which relates f to instantaneous joint acceleration q̈. Turning
tance of matrices with off-diagonal elements, but introduce the search for IK solutions into a control problem, (9) is the
a more intuitive interpretation, using manipulator dynamics. control plant we chose at the core of our solver.
A primary contribution of this paper is to propose forward We use the distance error = xd − g(q) as the error
dynamics solvers in the context of J T -based IK solving. between target and current end effector pose. Its entries are
This general idea bases on previous findings [13]. Here, we T
present an enhanced algorithm with improved convergence = [x , y , z , rx , ry , rz ] (10)
with physically plausible intermediate solutions for motion
with the translational error components and rotational error
control.
components of the according Rodrigues vector.
III. FORWARD DYNAMICS IK SOLVER Relating this distance error vector to a virtual Cartesian
A. Simulation of Robot Motion end effector input
Approximating the manipulator as a set of articulated, f = Kp + Kd ˙ (11)
rigid bodies, the governing equations of motion obtain the
following form in matrix notation with the positive definite, diagonal gain matrices Kp and
Kd , we obtain
τ = H(q)q̈ + C(q, q̇) + G(q) (7)
q̈ = H −1 J T (Kp + Kd )
˙ (12)
in which H denotes the mechanism’s positive definite in-
ertia matrix and C and G represent vectors with separated as our forward dynamics motivated controller. Fig. 1 shows
Coriolis an centrifugal terms and gravitational components the closed loop control scheme for solving IK.
Note the similarity to (6): Setting Kp = I and Kd = 0
yields
q̈ = H −1 J T xd − g(q) .
(13)
However, H −1 generates physically plausible joint accel-
erations q̈ that really reflect the mechanism reaction to
the Cartesian error vector for instantaneous motion. This
means that meeting kinematic constraints, the mechanism
accelerates in Cartesian space with ẍ in the direction as
pointed to by f . In the experiments section we show that this
indeed causes faster and more goal-directed convergence.
B. Homogenization Methods
A goal of this paper is to provide insight on the condition-
ing of the mechanism such that H(q) possesses beneficial
behavior throughout the joint space. Note that unlike the
kinematics of the system, which we can not change, we are
free to give the simulated manipulator any dynamic behavior Fig. 2: Dynamics-conditioned twin of an exemplary mechanism.
The end effector comprises all of the mechanism’s mass m and
we wish. In this context we propose to think of the solver rotational inertia I, which is illustrated with the oversized sphere.
concept from Fig. 1 as using a virtually conditioned twin Links and joints are considered massless, such that their configu-
of the real mechanism for which we wish to solve IK. The ration has a vanishing influence on the overall dynamics.
basic idea behind this approach has been presented in our
previous work [13]. In this paper, we present more detailed
aspects behind this concept and provide an empirical proof IV. IMPLEMENTATION
of this earlier proposition.
The time derivative of (2) gives We implemented the closed loop scheme from Fig. 1 as a
ROS controller in C++. The pseudo code for the IK-solving
ẍ = J˙ q̇ + J q̈ . (14) part is listed in Algorithm 1.
We again consider instantaneous accelerations while the
mechanism is still at rest and set J˙ q̇ = 0. Together with Algorithm 1 IK with forward dynamics
(9) we obtain
1: procedure S OLVER(xd , q0 , ∆t, N )
ẍ = J H −1 J T f , (15)
2: 0 = 0
which describes the Cartesian instantaneous acceleration due 3: for i = 1 to N do
to the controlled distance error f . With setting M −1 = 4: i = xd − g(qi−1 )
J H −1 J T we obtain the more concise notation 5: ˙ i = (i − i−1 )/∆t
ẍ = M −1 f . (16) 6: fi = Kp i + Kd ˙ i
7: q̈i = H −1 (qi−1 )J T (qi−1 )fi
Our intention now is to achieve 8: q̇i = 0.5 q̈i ∆t . q̈i−1 ≡ 0
M −1 (q) to be an almost con- 9: qi = qi−1 + 0.5 q̇i ∆t . q̇i−1 ≡ 0
stant, diagonal matrix for all 10: end for
possible joint configurations q, 11: q d = qN
as illustrated on the right. So 12: return q d
that the gain matrices Kp and 13: end procedure
Kd generate uniform system ac-
celerations ẍ, and our control loop from Fig. 1 has equal
convergence throughout the Cartesian workspace. Note that the computation of H −1 and J T is not part
To achieve this behavior, we follow a mechanically- of the algorithm. For this task we used the Kinematics
motivated assumption: The error-correcting f acts directly on and Dynamics Library (KDL)1 , which is common place
the mechanism’s end effector. If this end effector comprises in ROS. Note that the number of steps N can be chosen
all of the mechanism’s mass and inertia, as illustrated in freely to give the solver (virtual) time for any given xd .
Fig. 2a, then joint configurations will have less effects on M . In combination with the gain matrices Kp and Kd this is
The overall center of mass remains unchanged. This effect is a partially redundant means to tweak the solver to range
depicted in Fig. 2b where f experiences the same rotational from a one-shot IK-solver to an interpolating controller to
inertia M , although having shifted most of the mechanism’s smooth noisy targets xd . We discuss this behavior in the
structure away from the rotatory axis in one case. In the experiment on interpolation performance for low frequency
experiments section we sample a massive number of joint sampled targets.
configurations and show empirically that this approach in-
deed achieves a good homogenization of M −1 = J H −1 J T . 1 http://wiki.ros.org/orocos_kinematics_dynamics
V. EXPERIMENTS AND RESULTS
In our experiments, we chose the Universal Robot UR10
as manipulator (Fig. 3), which is ubiquitous both in indus-
try and academia, and represents a well-known platform
for many possible users. We want to emphasize, however,
that our proposed IK solver has been used successfully
(a)
on various manipulators. Since a central theme of this
work is to use a dynamics motivated approach for IK 3.2
Average μ
method to the Jacobian transpose method where appropriate.
1.6
0.8
A. Controller Homogenization 0.0
In this experiment we evaluated 1.6
Variance σ 2
1.2
compared it both to the Jacobian
0.8
transpose method from (6) and a
reference dynamics model. For all 0.4
εx [m]
εy [m]
εz [m]
0.0 0.0 0.0
jacobian transpose
our method
−0.2 −0.2 −0.2
0 50 100 150 0 50 100 150 0 50 100 150
iterations N
εrz [rad]
εrx [rad]
εry [rad]
−0.1 −0.1 −0.1
Fig. 5: Experiment B. Analysis of the solver convergence for the Jacobian method: q̈ = αI6 J T Kp (xd − g(q)), and our method:
q̈ = H −1 J T Kp (xd − g(q)), with a simulation time interval of ∆t = 1 s and N = 150 iterations. The plots show the six Cartesian
dimensions of the error xd − g(q) for each iteration.
0.70 0.65
0.65 kp = 0.5
0.60 kp = 1
z [m]
kp = 2
jacobian transpose
z [m]
0.60
0.55 kp = 5
our method
kp = 50
0.55
0.50
0.50
0.45
0.45
0.15 0.20 0.25 0.30 0.35 0.40 0.45
0.40 y [m]
0.2 0.3 0.4
y [m]
error [m]
0.425 0.1
x [m]
0.400
0.375
0.0
0 1 2 3 4 5 6
0 500 1000 1500 2000 2500 3000 3500 4000
time [s]
steps
with ∆t = 0.1 s. The Cartesian end effector positions are computed 0.001
with the robots forward kinematics g(q) for each step.
0.000
0 1 2 3 4 5 6
B. Controller Gains time [s]