Salman Hashmi
sal.hashmi@pm.me
This project originated from Udacity's Robotic arm - Pick & Place project, which, in turn is based on the Amazon Robotics Challenge sponsored by Amazon Robotics LLC.
A robotic arm shelving products in an Amazon fulfillment center [source: GeekWire]
Commercially viable automated picking and stowing in unstructured environments, like picking products off shelves and putting them into shipping boxes, still remains a difficult challenge. The goal of the ARC is to perform simplified versions of the general task of picking and stowing items on shelves. As per ARC Rules: "The Challenge combines object recognition, pose recognition, grasp planning, compliant manipulation, motion planning, task planning, task execution, and error detection and recovery".
The objective of this project is to demonstrate autonomous capability of the KR210 serial manipulator in simulation to pick and place an object in a semi-unstructured environment.
Within the context of this project, a single pick and place cycle can be divided into the following tasks:
The capability of picking and placing objects relies on being able to locate points of interest in a 3D environment and planning movement trajectories to those points. All robotic manipulators in industry depend on this capability.
Robotic serial manipulators can be found in almost every industry
Robotic manipulators have become ubiquitous in almost every industry; from food, beverage, shipping and packaging to manufacturing, foundry and space:
All of these jobs require the same core capability, namely, that of the robotic arm's end-effector to reach specific 3D coordinates within its workspace so that it can interact with the environment at that location, as this project aims to demonstrate.
The project uses ROS Kinetic Kame running on Ubuntu 16.04 LTS (Xenial Xerus).
The following tools are used for simulation and motion planning:
Once ROS is installed, we can proceed with the environment setup for the project:
1. Verify the version of gazebo installed with ROS
gazebo --version
2. If the installed gazebo version is not 7.7.0+, update it as follows
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install gazebo7
3. Create a catkin workspace if haven't already
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_init_workspace
ls -l
Notice that a symbolic link (CMakeLists.txt) has been created to /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
4. Clone or download project repository into the src directory of the catkin workspace
cd ~/catkin_ws/src
git clone https://github.com/Salman-H/pick-place-robot
5. Install missing dependencies if any
cd ~/catkin_ws
rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
6. Change the permissions of script files to turn them executable
cd ~/catkin_ws/src/pick-place-robot/kuka_arm/scripts
sudo chmod u+x target_spawn.py
sudo chmod u+x IK_server.py
sudo chmod u+x safe_spawner.sh
7. Build the project
cd ~/catkin_ws
catkin_make
8. Open .bashrc file found in the home directory and add the following commands at the end
# Inform Gazebo (sim software) where to look for project custom 3D models
export GAZEBO_MODEL_PATH=~/catkin_ws/src/pick-place-robot/kuka_arm/models
# Auto-source setup.bash since the pick and place simulator spins up different nodes in separate terminals
source ~/catkin_ws/devel/setup.bash
9. Save the .bashrc file and open a new terminal for changes to take effect
The simulator environment can be tested by launching the project in demo mode.
10. Open inverse_kinematics.launch
file under /pick-and-place/kuka_arm/launch/
and set the demo flag to "true"
In addition, the spawn location of the target object can be modified if desired. To do this, modify the spawn_location argument in target_description.launch
under /pick-and-place/kuka_arm/launch/
where 0-9 are valid values for spawn_location with 0 being random mode.
11. Launch project by calling the safe_spawner shell script in a fresh terminal
$ cd ~/catkin_ws/src/pick-place-robot/kuka_arm/scripts
$ ./safe_spawner.sh
Note: If Gazebo and RViz do not launch within a couple of seconds, close all processes started by this shell script by entering Ctrl+C
in each of the sprung up terminals. Then rerun the safe_spawner script.
Once Gazebo and RViz are up and running, ensure the following can be seen in the gazebo world:
12. Run the IK_server
ROS node from a new terminal window
cd ~/catkin_ws/src/pick-place-robot/kuka_arm/scripts
rosrun kuka_arm IK_server.py
13. Arrange Gazebo and RViz windows side-by-side and click on Next button on left side of RViz to proceed between states.
The status message in RViz changes as the different stages of simulation are traversed with the Next button. Actuation is observed in the Gazebo window.
The following theoretical concepts are used in this project:
Serial manipulators are robots composed of an assembly of links connected by joints (a Kinematic Chain); they are the most common types of robots in industry.
In the robotics of serial manipulators, Generalized Coordinates are used to define their configuration (or joint) space, which is the set of all possible configurations a manipulator may have. More generally, generalized coordinates are parameters that are used to uniquely describe the instantaneous dynamical configuration of a rigid multi-body system relative to some reference configuration.
The number of independent coordinates (or parameters) that fully define the configuration in free space of a rigid body or mechanical system is called its Degree of Freedom or DOF.
Common DOFs include:
Fig. 3.1 Geometry of a 3-DOF anthropomorphic robot
[Source: Narong Aphiratsakun. AIT]
The serial manipulator shown in figure 3.1 has $n=3$ joints: each a revolute with 1-DOF. Each joint connects with two links, making the total number of links, n+1 = 4, including the fixed base link.
Therefore, the total number of DOF for any serial manipulator with three 1-DOF joints is:
$$\begin{align} DoF & =\ 6\ ( number\ of\ moveable\ links) - 5\ (number\ of\ 1\text{-}DoF\ joints)\ & =\ 6\ (3) - 5\ (3)\ & =\ 18 - 15\ & =\ 3 \end{align}$$
Note: The DOF of a serial manipulator with only revolute and/or prismatic joints is always equal to the number of its joints, except when both ends of the manipulator are fixed (closed chain linkage).
The workspace of a robotic manipulator is defined as the set of points that can be reached by its end-effector [2]. In other words, it is simply the 3D space in which the robot mechanism works.
Fig. 3.2 Workspaces of 3-DOF SCARA and anthropomorphic manipulators
[Source: Federica.EU]
Figure 3.2 shows two types of serial manipulators, SCARA and Anthropomorphic with their associated workspaces. Figure 3.1 also shows the workspace of the 3-DOF manipulator from a top and side perspective.
It is important to note that no kinematic solution exists for the manipulator's configuration or joint space for any desired end-effector position outside of the workspace.
A spherical wrist of a robotic manipulator is designed by arranging its last three revolute joints such that their axes of rotations intersect at a common point, referred to as the wrist center.
Fig. 3.3 Difference between a spherical and non-spherical wrist
[Source: Khaled Elashry, ResearchGate]
Figure 3.3 shows the difference between a spherical and non-spherical wrist. In 3.3 (a), joint axes of rotations A, B, C all intersect at the wrist center, whereas, in 3.3(b), the wrist center is non-existent. Physically speaking, a six DOF serial manipulator like the one in figure 3.3 would use the first three joints to control the position of the wrist center while the last three joints (spherical wrist) would orient the end effector as needed, as in a human arm.
The spherical wrist is an important design characteristic in anthropomorphic manipulators which simplifies their kinematic analysis, as demonstrated in section 5.
Rotation matrices are a means of expressing a vector in one coordinate frame in terms of some other coordinate frame.
Fig. 3.4 A 2D geometric rotation between coordinate frames A and B
In figure 3.2, Point P is expressed with vector $\boldsymbol{u}$ relative to coordinate frame B. The objective is to express point P with vector $\boldsymbol{v}$ relative to coordinate frame A. The basis vectors of $\boldsymbol{v}$, $\boldsymbol{v_x}$ and $\boldsymbol{v_y}$ can be expressed in terms of the basis vectors of $\boldsymbol{u}$, $\boldsymbol{u_x}$ and $\boldsymbol{u_y}$ as follows:
$$ \begin{equation} \begin{bmatrix} v{x} \ v{y} \ \end{bmatrix} = \begin{bmatrix} \boldsymbol{\hat{a{x}}} \cdot \boldsymbol{\hat{b{x}}} & \boldsymbol{\hat{a{x}}} \cdot \boldsymbol{\hat{b{y}}} \ \boldsymbol{\hat{a{y}}} \cdot \boldsymbol{\hat{b{x}}} & \boldsymbol{\hat{a{y}}} \cdot \boldsymbol{\hat{b{y}}} \ \end{bmatrix} \begin{bmatrix} u{x} \ u{y} \ \end{bmatrix} \end{equation} $$
where unit vectors of frame A, $\boldsymbol{\hat{a_x}}$ and $\boldsymbol{\hat{a_y}}$ are expressed in terms of unit vectors of frame B, $\boldsymbol{\hat{b_x}}$ and $\boldsymbol{\hat{b_y}}$ as follows:
$$ \begin{align} \boldsymbol{\hat{a{x}}} &= \boldsymbol{\hat{b{x}}}\cos\theta = -\boldsymbol{\hat{b{y}}}\sin\theta \ \boldsymbol{\hat{a{y}}} &= \boldsymbol{\hat{b{x}}}\sin\theta = \boldsymbol{\hat{b{y}}}\cos\theta \end{align} $$
Substituting (2) in (1) and solving for the dot products yields the following equation:
$$ \begin{equation} \begin{bmatrix} v{x} \ v{y} \ \end{bmatrix} = \begin{bmatrix} \cos\theta & -\sin\theta \ \sin\theta & \cos\theta \ \end{bmatrix} \begin{bmatrix} u{x} \ u{y} \ \end{bmatrix} \end{equation} $$
where the first term on the right-hand side is the 2D Rotation Matrix, denoted in this case as $\boldsymbol{^a_bR}$. Any point on coordinate frame B multiplied by $^a_bR$ will project it onto frame A. In other words, to express a vector $\boldsymbol{u}$ on some frame B as a vector $\boldsymbol{v}$ on a different frame A, $\boldsymbol{u}$ is multiplied by the rotation matrix with angle theta by which frame A is rotated from fram B. Also worth noting is that the rotation from A to B is equal to the transpose of the rotation of B to A.
Euler angles are a system to describe a sequence or a composition of rotations. According to Euler's Rotation Theorem, the orientation of any rigid body relative to some fixed reference frame can always be described by three elementary rotations in a given sequence as shown in figure 3.3.
Fig. 3.5 Defining Euler angles from a sequence of rotations
[Source: CHRobotics]
Conventionally, the movements about the three axes of rotations and their associated angles are described by the 3D rotation matrices in figure 3.4.
Fig. 3.6 3D counter-clockwise rotation matrices describing yaw, pitch and roll
Euler angles are characterized by the following properties:
Intrinsic or body-fixed rotations are performed about the coordinate system as rotated by the previous rotation. The rotation sequence changes the axis orientation after each elemental rotation while the body remains fixed.
$$ \begin{align} ^ABR{ZXY}(\psi,\theta,\phi) &= R{Z}(\psi)R{Y}(\theta)R_{X}(\phi) \ &= \begin{pmatrix} c\psi & -s\psi & 0 \ s\psi & c\psi & 0 \ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} c\theta & 0 & s\theta \ 0 & 1 & 0 \ -s\theta & 0 & c\theta \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 \ 0 & c\phi & -s\phi \ 0 & s\phi & c\phi \end{pmatrix} \end{align} $$
In an intrinsic sequence of rotations, such as, a Z-Y-X convention of a yaw, followed by a pitch, followed by a roll, subsequent elemental rotations are post-multiplied.
Extrinsic or fixed-axis rotations are performed about the fixed world reference frame. The original coordinate frame remains motionless while the body changes orientation.
$$ \begin{align} ^ABR{ZXY}(\psi,\theta,\phi) &= R{X}(\phi)R{Y}(\theta)R_{Z}(\psi) \ &= \begin{pmatrix} 1 & 0 & 0 \ 0 & c\phi & -s\phi \ 0 & s\phi & c\phi \end{pmatrix} \begin{pmatrix} c\theta & 0 & s\theta \ 0 & 1 & 0 \ -s\theta & 0 & c\theta \end{pmatrix} \begin{pmatrix} c\psi & -s\psi & 0 \ s\psi & c\psi & 0 \ 0 & 0 & 1 \end{pmatrix} \end{align} $$
In an extrinsic sequence of rotations, such as, a Z-Y-X convention of a yaw, followed by a pitch, followed by a roll, subsequent elemental rotations are pre-multiplied.
Note: An extrinsic rotation sequence of A, B, C = an intrinsic rotation sequence of C, B, A.
Euler angles, normally in the Tait–Bryan, Z-X-Y convention, are also used in robotics for describing the degrees of freedom of a spherical wrist of a robotic manipulator.
Of particular importance is a phenomenon associated with Euler angles known as a Gimbal Lock which occurs when there is a loss of one degree of freedom as a result of the axes of two of the three gimbals driven into a parrallel configuration.
In the case where a reference frame is both simultaneously rotated and translated (transformed) with respect to some other reference frame, a homogeneous transform matrix describes the transformation.
Fig. 3.7 Rotation and Translation of frame B relative to frame A
[Source: Salman Hashmi. BSD License]
In figure 3.7, point P is expressed relative to frame B and the objective is to express it relative to frame A. To do so would require projecting or superimposing frame B onto frame A i.e. first rotating frame B to orient it with frame A and then translating it such that the centers B0 and A0 of both frames are aligned.
$$ ^A \vec r_{\frac{P}{A_0}} =\ ^ABT\ \cdot\ ^B \vec r{\frac{P}{B_0}} $$
$$ ^A \vec r_{\frac{P}{A_0}} =\ ^ABR\ \cdot\ ^B \vec r{\frac{P}{B0}}\ +\ ^A \vec r{\frac{B_0}{A_0}} $$
$$ \begin{equation} \left[\begin{array}{c} ^A \vec r_{\frac{P}{A_0}} \ \hdashline 1 \ \end{array}\right] = \left[\begin{array}{ccc:c} & ^ABR & & ^A \vec r{\frac{B_0}{A0}} \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] \left[\begin{array}{c} ^B \vec r{\frac{P}{B_0}} \ \hdashline 1 \ \end{array}\right] \tag{3} \end{equation} $$
$$ \begin{equation} \left[\begin{array}{c} r{Ax} \ r{Ay} \ r{Az} \ \hdashline 1 \ \end{array}\right] = \left[\begin{array}{ccc:c} r{11} & r{12} & r{13} & r{BAx} \ r{21} & r{22} & r{23} & r{BAy} \ r{31} & r{32} & r{33} & r{BAz} \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] \left[\begin{array}{c} r{Bx} \ r{By} \ r{Bz} \ \hdashline 1 \ \end{array}\right] \end{equation} $$
where the entries of the rotation matrix R depend on the type of rotation.
The relationship between the three vectors in figure 3.7 is shown in equation (1). The desired vector to point P from A0 is the sum of the vector to point P from B0, rotated to frame A, and the translation vector to B0 relative to A0. Equations (2) and (3) are the matrix-forms of equation (1) so that it can be rendered in software with linear algebra libraries.
Fig. 3.8 Anatomy of the homogeneous transform relationship
Figure 3.8 describes the components of equation (2). The desired vector to point P (relative to to A0) is obtained by multiplying the given vector to point P (relative to B0) by the homogeneous transform matrix, composed of the block Rotation matrix projecting B onto A and the block translation vector to B relative to A0.
Fig. 3.9 Transformation between adjacent revolute joint frames
As shown in figure 3.9, the position of the end-effector is known relative to its coordinate reference frame C. The objective is to express it relative to the fixed world coordinate reference frame W. This is because the positions of all objects of interest in the manipulator's environment are expressed relative to the world reference frame. In other worlds, both, the end-effector, and the objects it interacts with need to be defined on the same coordinate reference frame.
Point P relative to frame W can be found by successively applying equation (4) between adjacent joints. More specifically,
$$ ^W\ \vec r_{\frac{P}{W_0}} =\ ^WCT\ \cdot\ ^C \vec r{\frac{P}{C_0}} $$
where $\ ^W_CT =\ ^B_CT \cdot\ ^A_BT \cdot\ ^W_AT$
Using the point $P_{C} (0.5, 0, 17)$ vector relative to frame C, we first compute the point P vector relative to frame B:
$$ \begin{align} ^B \vec r_{\frac{P}{B_0}} &= \left[\begin{array}{ccc:c} & ^BCR & & ^B \vec r{\frac{C_0}{B0}} \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] \left[\begin{array}{c} ^C \vec r{\frac{P}{C_0}} \ \hdashline 1 \ \end{array}\right] \ &= \left[\begin{array}{ccc:c} \cos(60) & 0 & \sin(60) & 0 \ 0 & 1 & 1 & 0 \ -\sin(60) & 0 & \cos(60) & 34 \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] \left[\begin{array}{c} 0.5 \ 0 \ 17 \ \hdashline 1 \ \end{array}\right] \ &= \left[\begin{array}{c} 0.5\cos(60) + 17\sin(60) + 0 \ 0 \ -0.5\sin(60) + 17\cos(60) + 34 \ \hdashline 1 \ \end{array}\right] = \left[\begin{array}{c} 15 \ 0 \ 42 \ \hdashline 1 \ \end{array}\right] \end{align} $$
We then use this point $P_{B} (15, 0, 42)$ vector relative to to frame B to similarly compute the point P vector relative to frame A:
$$ \begin{align} ^A \vec r_{\frac{P}{A_0}} &= \left[\begin{array}{ccc:c} & ^ABR & & ^A \vec r{\frac{B_0}{A0}} \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] \left[\begin{array}{c} ^B \vec r{\frac{P}{B_0}} \ \hdashline 1 \ \end{array}\right] \ &= \left[\begin{array}{ccc:c} \cos(110) & 0 & \sin(110) & 1 \ 0 & 1 & 1 & 0 \ -\sin(110) & 0 & \cos(110) & 30 \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] \left[\begin{array}{c} 15 \ 0 \ 42 \ \hdashline 1 \ \end{array}\right] \ &= \left[\begin{array}{c} 15\cos(110) + 42\sin(110) + 1 \ 0 \ -15\sin(110) + 42\cos(110) + 30 \ \hdashline 1 \ \end{array}\right] = \left[\begin{array}{c} 35 \ 0 \ 1.5 \ \hdashline 1 \ \end{array}\right] \end{align} $$
And finally, using this point $P_{A} (15, 0, 42)$ vector relative to frame A, we can compute the point P vector relative to the world reference frame W:
$$ \begin{align} ^W \vec r_{\frac{P}{W_0}} &= \left[\begin{array}{ccc:c} & ^WAR & & ^W \vec r{\frac{A_0}{W0}} \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] \left[\begin{array}{c} ^W \vec r{\frac{P}{W_0}} \ \hdashline 1 \ \end{array}\right] \ &= \left[\begin{array}{ccc:c} \cos(-20) & 0 & \sin(-20) & 10 \ 0 & 1 & 1 & 0 \ -\sin(-20) & 0 & \cos(-20) & 15 \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] \left[\begin{array}{c} 35 \ 0 \ 1.5 \ \hdashline 1 \ \end{array}\right] \ &= \left[\begin{array}{c} 35\cos(-20) + 1.5\sin(-20) + 10 \ 0 \ -35\sin(-20) + 1.5\cos(-20) + 15 \ \hdashline 1 \ \end{array}\right] = \left[\begin{array}{c} 42 \ 0 \ 28 \ \hdashline 1 \ \end{array}\right] \end{align} $$
So, point $P_W$, reprenting the end-effector position relative to the base of the robot, is $(42, 0, 28)$.
Before the homogeneous transforms between adjacent links can be computed, the coordinate frames of the joint links on which the transforms are applied must be defined. The Denavit–Hartenberg (DH) parameters are four parameters describing the rotations and translations between adjacent links. The definition of these parameters constitutes a convention for assigning coordinate reference frames to the links of a robotic manipulator. Figure 3.8 shows the so-called modified convention of DH parameters as defined by [Craig, JJ. (2005)].
Fig. 3.8 The four parameters of the Modified DH convention
[Source: Modified from Wikipedia Commons]
The parameters are defined as follows:
Note:
Recall that to compute the position of the end-effector relative to the base or world reference frame, transforms between adjacent links are composed as follows:
$$ \begin{equation} T^0_N =\ T^0_1\ T^1_2\ T^2_3 \cdots\ T^{N-1}_N \end{equation} $$
where the base frame is denoted by 0 and the end-effector's frame denoted by N. Thus, $^0_NT$ defines the homogeneous transformation that projects frame N onto frame 0. More specifically, a single transform between links $i-1$ and $i$ is made up up of two rotations R of magnitudes α and θ, and two displacements D of magnitudes ɑ and d.
$$ T_i^{i-1} =\ RX (\alpha{i-1}) DX (a{i-1}) R_Z (\theta_i) D_Z (d_i) $$
As shown previously, this can be expanded in terms of the homegeneous transform matrix (equation 4):
$$ T_i^{i-1} = \left[\begin{array}{ccc:c} c (\theta_i) & -s (\thetai) & 0 & a{i-1} \ s (\thetai) c (\alpha{i-1}) & c (\thetai) c (\alpha{i-1}) & -s (\alpha{i-1}) & -s (a{i-1}) d_i \ s (\thetai) s (\alpha{i-1}) & c (\thetai) s (\alpha{i-1}) & c (\alpha{i-1}) & c (\alpha{i-1}) d_i \ \hdashline 0 & 0 & 0 & 1 \ \end{array}\right] $$
where $c$ and $s$ and shorthands for $\cos$ and $\sin$ respectively.
The parameter assignment process for open kinematic chains with n degrees of freedom (i.e., joints) is summarized as:
Special cases involving the Zi-1 and Zi axes:
Once the frame assignments are made, the DH parameters are typically presented in tabular form (below). Each row in the table corresponds to the homogeneous transform from frame {i} to frame {i+1}.
Table 3 The four parameters of the Modified DH convention
twist angle | link length | link offset | joint angle | |
---|---|---|---|---|
Rotation R about x |
Translation D along x |
Translation D along z |
Rotation R about z |
|
$i$ | $\boldsymbol{\alpha}_{i-1}$ | $\boldsymbol{a}_{i-1}$ | $\boldsymbol{d}_i$ | $\boldsymbol{\theta}_i$ |
$T ^0_1$ | $\alpha_0$ | $a_0$ | $d_1$ | $\theta_1$ |
$\vdots$ | ||||
$T ^{i-1}_i$ | $\alpha_{i-1}$ | $a_{i-1}$ | $d_i$ | $\theta_i$ |
$\vdots$ | ||||
$T ^{n-1}_n$ | $\alpha_{n-1}$ | $a_{n-1}$ | $d_n$ | $\theta_n$ |
Forward Kinematics is the process of computing a manipulator's end-effector position in Cartesian coordinates from its given joint angles. This can be achieved by a composition of homogeneous transformations that map the base frame onto the end-effector's frame, taking as input the joint angles. The end-effector's coordinates can then be extracted from the resulting composite transform matrix.
The relationship between Forward and Inverse Kinematics is depicted in figure 3.9,
Fig. 3.9 Relationship between Forward and Inverse Kinematics
Inverse Kinematics is the reverse process where the EE position is known and a set of joint angles that would result in that position need to be determined. This is a more complicated process than FK as multiple solutions can exist for the same EE position. However, no joint angle solutions exist for any EE position outside the manipulator's workspace. There are two main approaches to solve the IK problem: numerical and analytical. The later approach is used in this project.
The scope of the design is limited to a single pick-and-place cycle that consists of the following steps:
Figure 4.1 shows these steps in Gazebo.
Fig 4.1 A single pick-and-place cycle
[Source: Gazebo]
The primary metrics of interest are:
Fig 4.2 Planned EE trajectory to drop-off location
[Source: RViz, MoveIt!]
The minimum criteria is to achieve a success rate of at least 80% with an EE trajectory error not greater than 0.5.
In order to perform a single pick-and-place operation, joint angles corresponding to the given locations of the target object and drop-off site need to be determined. Towards this goal, an Inverse Kinematic analysis is performed and implemented in software using ROS and Python.
Figure 5.1 (a) shows the Kuka KR210 serial manipulator and (b) shows its zero configuration schematic indicating its DH parameters. In the zero configuration, all joint angles are assumed to be zero.
Fig. 5.1 The KUKA KR210 6-DOF robotic manipulator and its schematic architecture
[Source: (a) KUKA Roboter GmbH, (b) Salman Hashmi, BSD License]
Note that, for joint 2, there is a constant -90 degree offset between x1 and x2.
The following steps are performed to construct the KR210 schematic and derive its DH Table:
The last step is implemented using table 5.1 which is constructed from the KR210 URDF file, kr210.urdf.xacro
.
Table 5 Location of joint {i} relative to its parent joint {i-1} from the KR210 URDF file
Joint name | Parent Link | Child link | x(m) | y(m) | z(m) | roll | pitch | yaw |
joint_1 | base_link | link_1 | 0 | 0 | 0.33 | 0 | 0 | 0 |
joint_2 | link_1 | link_2 | 0.35 | 0 | 0.42 | 0 | 0 | 0 |
joint_3 | link_2 | link_3 | 0 | 0 | 1.25 | 0 | 0 | 0 |
joint_4 | link_3 | link_4 | 0.96 | 0 | -0.054 | 0 | 0 | 0 |
joint_5 | link_4 | link_5 | 0.54 | 0 | 0 | 0 | 0 | 0 |
joint_6 | link_5 | link_6 | 0.193 | 0 | 0 | 0 | 0 | 0 |
gripper_joint | link6 | link_7 | 0.11 | 0 | 0 | 0 | 0 | 0 |
TOTAL | 2.153 | 0 | 1.946 |
Note the following concerning the URDF file and table 5.1,
The DH Table is then derived from figure 5.1 (b) and table 5.1,
Table 6 Modified DH Table of the KR210
i | αi-1(deg) | ɑi-1(m) | di(m) | θi(deg) |
1 | 0 | 0 | 0.75 | θ1 |
2 | –90 | 0.35 | 0 | θ2– 90 |
3 | 0 | 1.25 | 0 | θ3 |
4 | –90 | –0.054 | 1.50 | θ4 |
5 | 90 | 0 | 0 | θ5 |
6 | –90 | 0 | 0 | θ6 |
7 | 0 | 0 | 0.303 | 0 |
Fig. 5.2 Finding location of WC relative to base frame O
Fig. 5.3 Calculation of θ1 and θ2 using an SSS triangle
Fig. 5.4 Calculation of θ3 and accounting for sag in the links between j3 and j5
Fig. 6.1 Steps followed in a single pick-and-place cycle
[Source: Gazebo, MoveIt!]
Fig. 6.2 Executing a planned EE trajectory
[Source: MoveIt!]
(a) Received EE positions in IK request (b) Comparison of received and fk EE positions
Fig. 6.3 Visualizing planned EE trajectories and associated error