2. The idea of motion
To move a robot smoothly from one pose to another, we need smooth and
coordinated motion of all of its joints.
we begin by looking at how to create smooth paths for the robot end effector
moving from one pose to another. There are two approaches we will introduce you
to. The first is what’s called a joint interpolated trajectory where we take the initial
pose and final pose and we use inverse kinematics to determine the initial and final
sets of joint values; then, we smoothly interpolate between those two sets.
The second approach is to compute a Cartesian interpolated trajectory and what
we do here is interpolate between the initial and final end effector poses. Then, for
each interpolated pose, we compute the inverse kinematics to find the joint values
that are appropriate at that particular time step.
3. Interpolation of a scalar
We want to make our robot to move from A to B , when the motion start, the end
effector of the robot arm is at a position or (pose) A and at the end of the motion ,
the end effector of the robot arm is at a position or (Pose)B , during the motion the
robot's position is changing smoothly and ideally the shortest path.
We’ll start in a simple way and see how this works for a point moving along a
number line, and then apply those principles to two common approaches for
robotic motion: joint interpolation and Cartesian interpolation.
Consider A and B are two points in real number line and we wish to move smoothly
between them. We can construct a function
X(t) = A +(B - A) t
4. Interpolation of a scalar
Such that the time variable t varies from 0 to 1 , that o<= t <=1.you should
convince your self that X(0)=A and X(1)=B we call this a trajectory a set of times
and points(ti , x(i)) that defines how the point moves as a function of time We can
choose to divide the time interval into as many steps, time steps, as we desire. This
is commonly known as linear interpolation and does the job very nicely, but has the
drawback that the motion is not totally smooth - let’s examine why.
The point is initially not moving, and then at t=0 it starts to move with a velocity of
(B - A) since it has to cover the distance from A to B which is (B - A) in 1 second.
When it arrives at B it suddenly stops. The sudden changes in velocity at the start
and at the end mean massive accelerations– this is not a problem when moving a
mathematical point (which has no mass) along a number line but it is a very real
problem for the motors of a real robot.
5. Interpolation of a scalar
What we need is a way for our point to smoothly accelerate at the beginning of the
motion and then smoothly decelerate at the end. Fortunately the Toolbox has a
function that does just this. Consider the problem of moving smoothly from X= - 2
to X = 3 n fifty steps. Using the Toolbox the solution is tpoly(-2,3,50)
If you want to create vector we can do it
X=tpoly(-2,3,50)
6. Joint interpolation in 2 D
we learned how to interpolate a scalar smoothly between two values. Now, we
want to do this for the robot’s joint values, which are a vector.
We define qA as a vector of the joint values (angles or lengths) at the robot’s initial
position (or pose). For a robot with N oints, this will be a vector of length N .
Similarly , qB s a vector of the joint values (angles or lengths) at the robot’s final
position (or pose), and is the same length as qA
Now we want to find a series of vectors that move smoothly between the values qA
and qB . Consider that qA=(-0.3 , 0.5) and qB=(0.5 ,0.2)
qA=[-0.3 0.5]
qB=[0.5 0.2]
q=jtraj(qA,qB,50)
7. Cartesian interpolation in 2 D
Now we have made our non-physical robot move as its joint angles followed a
trajectory – it moved from A to B. However, as we saw in the last step, close
scrutiny shows that between points A and B, the robot’s end effector does not
follow a straight line.
For many robot applications, this is not important and joint interpolated motion is
adequate and easy to compute. However, there are some applications where
following a straight line is important – perhaps the robot is doing a cutting or
welding task. The solution we require is called Cartesian interpolation, and involves
interpolating points in the 2-dimensional (2D) Cartesian coordinate frame rather
than the 2D robot joint space. Consider two points in the 2D Cartesian coordinate
frame
qA=[-0.3 0.5]
qB=[0.5 0.2]
q=mjtraj(@tpoly,qA,qB,50)