1
$\begingroup$

Consider a robotic manipulator with 7-DOF (all joints are revolute) that accepts joint velocities as execution commands. What I am trying to achieve is the following:

I want to calculate the velocities of the joints needed in order for the $z$ vector of the end effector frame to point towards a ball which moves on the $xy$ plane. I am asked only to change the end effectors orientation and not its position. The position and the velocity of the ball, both expressed in the end effector frame are given by a function get_state(). The time step of the simulation is $T = 0.004ms$. So, basically the procedure is like this:

  • Simulate one step of the ball
  • Use get_state() function to obtain ball's position and velocity expressed in the end effector frame
  • Do what it needs to be done to calculate the appropriate joint velocities such that $z$ vector of end effector frame points towards the ball
  • Repeat

Considering the fact that the $z$ vector of the end effector should point towards the center of the ball, the problem breaks down to the simpler one that the $z$ vector should point towards a point in space. Consider also that the forward kinematics is solved, so the homogeneous transform from the 'world_frame' to the 'end_effector_frame' is known. My thoughts for solving it are:

  • At the end the $z$ vector of the "end_effector_frame" should be aligned to the unit vector $u$ in the direction from the origin of the end effector frame to the point $p$ which is the position of the ball expressed in the end effector frame and is known.
  • So, basically I have to come up with a rotation matrix $R$ capable of rotating the $z$ vector onto the $u$ vector. I found a possible way of deriving this rotation matrix here.
  • After having this rotation matrix $R$, I thought of expressing it as an $[ \text{angle} \ \text{axis} ]$ representation and then calculate $dw = angle \cdot axis$, which is the rotational movement the end effector has to perform in order to achieve the new orientation (maybe add also a proportional controller $K \cdot dw$).
  • So, because then end effector performs only a rotational movement and not at all any translational, its total desired movement should be: $ D = [0 \ \ 0 \ \ 0 \ \ dw(1) \ \ dw(2) \ \ dw(3)]^T $.
  • Final step is to compute the joint velocities by using the pseudoinverse of the manipulator's jacobian, like so: $ \dot{q} = J^{-1}(q) \cdot D $.

Basically it is cartesian control of the manipulator. First of all, my basic concern is whether this approach is correct or is it completely wrong and if it is correct, should I use the aforementioned formula (found at the link) in order to compute the proper rotation matrix or is there another way of finding this matrix that is more suitable for robotics ? Besides that would an inverse kinematics approach be more suitable ?

Finally, I am curious about the fact that the velocity of the ball is given and expressed in the end effector frame. The procedure I described above doesn't use this knowledge and I am curious if I am missing something and I should use this velocity in any certain way.

$\endgroup$
1
$\begingroup$

By imposing that the position of the end-effector $\mathbf{x} \in \mathbb{R}^3$ has to remain fixed, you're actually limiting your IK that, as a result, might struggle to achieve the task of aligning the vector $\mathbf{z} \in \mathbb{R}^3$ to point toward the target $\mathbf{p} \in \mathbb{R}^3$ when, for instance, one of the joints $\mathbf{q} \in \mathbb{R}^n$ reaches its bounds. To sum up, we are not required to stick to the same position, but rather to point to the ball.

To this end, you could try to solve a different optimization problem. Aligning the vector $\mathbf{z}$ to point toward $\mathbf{p}$ can be written as:

$$ \max_{\mathbf{q}} \{ \mathbf{z}\left(\mathbf{q}\right) \cdot \left(\mathbf{p}-\mathbf{x}\left(\mathbf{q}\right)\right) \}, $$

where $\mathbf{z}$, $\mathbf{x}$ and $\mathbf{p}$ are all expressed in the world reference frame.

The maximization of the dot product can be easily turned into the following minimization:

$$ \min_{\mathbf{q}} \{ \mathbf{z}\left(\mathbf{q}\right) \cdot \left(\mathbf{x}\left(\mathbf{q}\right)-\mathbf{p}\right) \}, $$

At this point, you can apply standard IK algorithms such as the Jacobian transposed, the pseudoinverse, the damped least-squares, and the like.

Concerning the velocity of the ball $\dot{\mathbf{p}}$, you could recruit the well-known differential law $\dot{\mathbf{p}}=\mathbf{J} \dot{\mathbf{q}}$, invert it and plug into your IK using the null-space policy.

My suggestion is to start off considering that, instead of dealing with $\mathbf{p}$ in the minimization above, you could come up with a better estimate using a look-ahead, which is in its simplest form $\tilde{\mathbf{p}} = \mathbf{p} + \dot{\mathbf{p}} \cdot \Delta t$.

Interestingly, in the past, I implemented something similar for the iCub robot using a nonlinear constrained optimization package called Ipopt. See the relative pull request and the corresponding code.

$\endgroup$
5
  • $\begingroup$ What an interesting answer. Thank you so much, a great deal of great concepts to dive into. I really appreciate it. My problem though is that first of all the project asks for the position to be fixed, I didn't impose it and moreover this project is kind of a starter to robotics dealing with: Rotations, Homogeneous Transforms, FWK, IK, Jacobians and velocities expressed in different coordinate frames. $\endgroup$ Nov 7 '20 at 13:08
  • $\begingroup$ Ok then, it wasn't very clear at the beginning. My recommendation is that you take a look at robotics.stackexchange.com/a/19531/6941 where the internal motion is exploited to achieve a hierarchy of tasks. In your case, the primary task is to keep the position unchanged, whereas the secondary task is to align $\mathbf{z}$. $\endgroup$ Nov 7 '20 at 14:51
  • $\begingroup$ The orientation error can be expressed as the axis-angle representation of the matrix $\mathbf{R}_d \cdot \mathbf{R}^T$, where the former accounts for the desired orientation and the latter is the transposed of the current orientation. $\endgroup$ Nov 7 '20 at 14:53
  • $\begingroup$ Yes, I see. So, I know the desired $z_d$ axis but what about the $x_d$ and $y_d$ axes ? I need them to construct $^{0}R_{d}$ which is the $R_d$ matrix as you stated. Can I find these axes just by having the $z_d$ and applying rotation matrices properties (cross product, column norm, row norm etc) ? $\endgroup$ Nov 7 '20 at 15:24
  • $\begingroup$ The resource you found out math.stackexchange.com/a/476311 is spot on to determine the matrix $\mathbf{R}^*$ so that $\mathbf{R}_d = \mathbf{R}^* \cdot \mathbf{R}$. Thus, it turns out that the orientation error is simply the axis-angle representation of $\mathbf{R}^*$ as you correctly pointed out in your original post. $\endgroup$ Nov 7 '20 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.