tacman-fp7 / handover

This module implements Task 4.4, to transfer an object from one hand to the other. It first localised the object in the robots hand. Then, the robot selects a pose for the second hand in which the object can be successfully transferred. The second hand grasps the object. Once a stable grasp is achieved, the first hand releases the object.
GNU General Public License v3.0
2 stars 1 forks source link

Approach method 2: consider first and second arm as a closed chain #20

Closed giuliavezzani closed 7 years ago

giuliavezzani commented 7 years ago

This is to integrate Roncone's code in our scenario.

giuliavezzani commented 7 years ago

The idea is to integrate pose selection discussed in #15 and a close chain approach, as implemented here.

The close chain approach, in fact, must be used also during pose selection procedure. We need to take into account the fact that also the first hand moves in order to correctly select a good pose.

giuliavezzani commented 7 years ago

Short summary of the work accomplished in commit 4cad86e:

tutti0

x-20

and then, to reach the position x= 0.2, y= 0, z= 0, always in the left hand frame:

x 20-2

I performed similar tests also for the y and the z axis, and I noticed the same behaviour. We need to better investigate this fact (maybe on the related paper) and to take into account for the handover task.

pattacini commented 7 years ago

Good starting point @giuliavezzani 🎖

Perhaps, @alecive didn't investigate in depth this aspect in his previous work, 'cause he was concerned only with reaching the origin of the floating root reference frame, not a point expressed in that coordinates system. That's only my educated guess, although I might be wrong.

Anyway, I believe it should be pretty easy to get around this problem by using a suitable H0 matrix that conveniently rotates the axes of that floating root reference frame.

giuliavezzani commented 7 years ago

That's what exactly I'm doing now :smiley: But I need to investigate the problem in the detail, since I got some strange poses in trying to perform the handover task. There might be an error in my code or there might be something else to take into account :wink:

giuliavezzani commented 7 years ago

I performed further tests in order to better discover how to define the desired pose for the moving hand. The scenario is the following:

position no. 1: x=-0.2 y=0.0 z=0.0

pos-x

position no. 2: x=0.0 y=-0.2 z=0.0

pos-x 1

position no. 3: x=0.0 y=0.0 z=-0.2

pos-x 2

At first, I just thought that it was enough to apply a correction matrix H0, so that to invert the direction of all the axes. But if we do like that, the final frame is not a right-handed frame, and in fact, the H0 we would need is : H0=diag(-1, -1, -,1 ,1), whose determinant is equal to -1.

I'm a little bit confused about this result and I'll keep working on this problem, trying to understand, at first, if my approach and my code is correct and, then, if there is some problems in the closed chain library.

giuliavezzani commented 7 years ago

Problem in the previous comment has been solved :smile:

pattacini commented 7 years ago

Great news, does this mean it's now working nicely?

giuliavezzani commented 7 years ago

Not yet, I'm checking the operation in our scenario.

At the moment, if I ask the right palm to reach position no.1, 2 and 3 of the previous comment, I got the correct positions, withouth using the H0 matrix (with det= -1.0), mentioned before.

giuliavezzani commented 7 years ago

After a detailed study, I managed to make the code working :tada:

Brief summary

  1. I had some problems with the reached orientations. Positions were correct (as said in the previous comment) but orientations were not consistent

  2. I performed some tests, asking the right hand to reach particular and simple orientations (such as: x-right=x-left, y-right=y-left, z-right=z-left)

  3. This way, I found the correction matrix to be applied:

    H_corr= [ 0  1  0
          0  0 -1
         -1  0  0 ]
  4. I tested the use of H_corr successfully in the handover task

Results

The following figures shows the 8 poses in the estimated object pose and the iCub hands in the final positions (from the iCub cameras viewpoint, on the left and from an external viewpoint, on the right) .

Currently, the best pose is selected by using the standard iCub kinematics and enabling the torso. But this is just a method to select and compute a reachable pose. The pose obtained by inverting the kinematic is shown together with the 8 poses since it is not always exactly overlapped with the desired pose.

The final hand poses are instead computed and executed by the two-arms closed-chain.

starts-working1

starts-working2

1 the orientation is not exactly the same, but we can accept this kind of results at the moment.

pattacini commented 7 years ago

Nice!

One major comment though: I wouldn't rank poses on the basis of one hand approach + torso. This has barely to do with the final overall movement indeed...

It should be fairly easy to use the new kinematics chain also during ranking stage.

giuliavezzani commented 7 years ago

Yes, of course! This is just a temporary result :smiley: Next step is to use the new kinematics chain also to select the best pose.

pattacini commented 7 years ago

Perfect!

giuliavezzani commented 7 years ago

Code has been updated in order to perform pose selection according to the new closed-chain kinematics.

Results

This is an example of pose ranking obtained with closed-chain:

pose-raking

According to the red-green colour scale, pose 2 and 7 are the best ones, since they are enough far away from the first hand and the orientations are easily reachable by the second hand. This raking turns out to be the same we obtained with the one hand approach. That's a good news, since pose 2 and 7 are actually the only good poses for the handover task, in this example.

NB: the hand poses shown in the figures are the final poses, after the movement has been already accomplished.

To-do

pattacini commented 7 years ago

Superb! It is a great satisfaction when things behave as we had in mind when the project started! 😃

The only point we still need to take in consideration is that the first hand will be moving, hence it is not unlikely that the object might displace or even fall. To avoid that, we could make the movement slower, limit the displacement of the first hand and so on...

giuliavezzani commented 7 years ago

Yes, this is a quite good result :smile: This point you stressed out is absolutely correct and, unfortunately, is not the only critical aspect of our task. Let's keep working hard and let's hope to manage to solve all problems :muscle:

giuliavezzani commented 7 years ago

Problems ranked in the previous comment (to do section) have been solved (just debugging).

I also successfully checked that

computed_pose

reached-pose

giuliavezzani commented 7 years ago

Issue summary: best pose selection with two-arms closed chain

This is to summarize my work on closed-chain approach for handover task.

Idea

Best pose for handover task is selected by using a two-arms closed chain. The poses attached to the object model are ranked according to 3 parameters:

Main upgrade

Previous approach: consider first hand fixed and solve the kinematics for the second hand, enabling torso (the second hand workspace is too small without enabling the torso). Cons: we should controll both the arms, keeping fixed the first hand and moving the second hand

Current and new approach: use a unique closed-chain including both the arms.

What I did:

Results

I performed some tests in order to test the correct working of the new approach.

Scenario:

Tests

computed_pose

reached-pose

To Do