-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coupling handlers for ergoCub hand MK3, 4 and 5 possibly incorrect #647
Comments
cc @ale-git |
Hi @xEnVrE, this assumption isn't correct:
In fact, the YARP side controlled DOF is the angle of the fingertip with respect to the palm, i.e. q1+q2. |
I talked f2f with @ale-git which explained that the current implementation of the plugin is reflecting what the firmware of the hand should have done i.e., controlling the angle of the fingertip with respect to the palm. This statement is the same as what @ale-git explained above:
However, the current firmware, for that I asked @sgiraz and @AntonioConsilvio, is implementing things differently, i.e. the user controls the angle of the first phalanx with respect to the palm. For that, I think that the implementation of the coupling handlers should be updated as I explained above. Can I proceed opening a PR for that? |
I agree on aligning the simulator with the robot, thanks a lot @xEnVrE . It would be great if we could also align the documentation that was added in icub-tech-iit/documentation#249, fyi @Nicogene . |
From my understanding, the documentation still holds. It is just how the coupling law is used in Gazebo that is making the difference at the moment. |
Of course I agree too, I'm getting up to speed and checking the needed modifications. |
@xEnVrE has already a branch for that, I guess. |
Indeed, it can be found in https://github.com/xEnVrE/gazebo-yarp-plugins/commits/fix/mk5_coupling However, it will not work properly if not coupled with the proper configuration file Changes has been done directly on the URDF - instead on the simmechanics part - just because it is easier to make quick tests. Edit: Moreover,I did not implement the coupling handlers for the velocity and torque control modes as my goal was to first check the standard coupling laws in joint space. |
After discussing a bit with @ale-git in icub-tech-iit/documentation#257, I have changed the implementation of the coupling handlers again. Starting from the index, the match with the real finger seems much better now: comparison-2023-03-23_00.01.11.mp4I will made comparisons with the other fingers as soon as the real hand is available again.
At this point, it seems to me that the documentation is to be updated according to the discussion made in icub-tech-iit/documentation#257. |
As a side note, I think there is also the need to discuss how the coupling law is to be implemented for the velocity and torque control modes before opening a PR. |
I guess icub-tech-iit/documentation#267 is related, even if I am not 100% of the issue status at the moment. |
Yes it is @traversaro |
We were waiting to update the documentation before proceeding to update the coupling handlers. I will work on it starting from the next week. |
Great, thanks! |
Historically, as far as I know, coupling handlers within the
controlboard
plugin were designed to operate as follows:decouple*
methods takes the state of physical joints simulated in Gazebo and reconstruct the state of the DoFs that the user can actually control YARP-sidedecoupleRef*
methods take the desired reference for the DoFs YARP-side and convert it to references, one for each physical joint, simulated in GazeboAs an example, for the thumb distal joints of iCub2.x we get:
gazebo-yarp-plugins/plugins/controlboard/src/ControlBoardDriverCoupling.cpp
Lines 183 to 188 in 4b35f02
i.e., the
l_thumb_distal
YARP-side is reconstructed as the sum of the two physical jointsl_hand_thumb_1_joint
andl_hand_thumb_2_joint
, where I am using the names coming from the iCub joints nomenclature and those from the URDF config files, respectively.Then, for the second method we have:
gazebo-yarp-plugins/plugins/controlboard/src/ControlBoardDriverCoupling.cpp
Lines 210 to 219 in 4b35f02
i.e.,
Let's now have a look at the implementation of the coupling handler for the ergoCub hand MK5 (differently from iCub2.x we don't have a C++ handler for each finger, rather a single C++ handler for the whole hand).
I assume that, given the figure below - taken from the documentation - and given my understanding that
q1
is what we can actually control (via q0?);q2
depends directly onq1
given the leverism via the coupling law q2 = f(q1)Given the above, a sketch of the
decouple*
method should be - here I will use names from the URDF conf files and from the ergoCub joints nomenclature and concentrate on the thumb jointWhile a sketch of the
decoupleRef*
method should be:Instead, by looking at the code what we found is, for the
decouple*
method:gazebo-yarp-plugins/plugins/controlboard/src/ControlBoardDriverCoupling.cpp
Line 1327 in 4b35f02
equivalent to
thumb_oc = thumb_prox + thumb_dist
, and for thedecoupleRef*
method:gazebo-yarp-plugins/plugins/controlboard/src/ControlBoardDriverCoupling.cpp
Lines 1378 to 1379 in 4b35f02
equivalent to
As it can be seen, these are different from the laws that I have sketched above.
Moreover, the configuration files of the ergoCub fingers in simulation are reflecting the same problem.
The section of the limits should contain the limits for the actual physical joints simulated in Gazebo, however it only contains the limits for the coupled ones and the others are set to 0:
The limits for the coupled joints - unfortunately optional software-side - are missing:
Is the reasoning above correct? If not, is there anything I am missing which explains why the current implementation of the coupling handler is different from the one I expected?
Thank you and sorry for the long description - unfortunately coupling laws are always a bit painful to deal with
cc @Nicogene @mfussi66 @pattacini @traversaro
The text was updated successfully, but these errors were encountered: