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.