ADVRHumanoids / ROSEndEffector

ROS End-Effector package: provides a ROS-based set of standard interfaces to command robotics end-effectors in an agnostic fashion
Apache License 2.0
27 stars 6 forks source link

NonLinear mimic joints #58

Open torydebra opened 4 years ago

torydebra commented 4 years ago

I am working on providing a way to put a nonLinear relationship for mimic joints. With ROS standards, only mimicPos = multiplierfatherPos + offset and mimicVel = multiplierfatherVel is possible. I added an attribute nlFunPos (bad name, proposal accepted) in the <mimic> tag like this:

<mimic joint="SFB1__SFP1_1" multiplier="1.2" offset="0.2" nlFunPos="x^2"/>

Things that ROSEE uses that need to be updated

Pull request for ROSEE here #59

torydebra commented 4 years ago

At the end I used numexpr. It should be safe to use (not like eval), any info about? I also need to substitute ^ with ** for python code.

lia2790 commented 4 years ago

Hi Dav, I d like to know why you are doing that in ordet to understand. thanks :)

torydebra commented 4 years ago

Hi Dav, I d like to know why you are doing that in ordet to understand. thanks :)

I am working on providing a way to put a nonLinear relationship for mimic joints

For example, I can say joint_mimic_pos = joint_father_pos ^ 2, simply indicating x^2 in the urdf, among the mimic tags. We will use this for HERI (not x^2 obviusly)

lia2790 commented 4 years ago

perfect! I get it!

torydebra commented 4 years ago

Maybe I also have to remember to specifically put some tests for this part

lia2790 commented 4 years ago

yes! I suggest you too to provide some usage examples and or some explanation of how to use it :)

torydebra commented 4 years ago

Updates: With nonlinear functions, it has become important to enforce the limit of mimic joints; because approximating non linear function can cause weird joint movements if the father move more than expected by the function approximation.

torydebra commented 4 years ago

I noticed that we can have problem if the father of a mimic joint is a mimic joint itself (i.e., there is a "grand-father" or more). This because we iterate the mimic map, and we do not know if the "children" will be updated BEFORE the "nephews", as it should be. BTW, I think this is a really strange case, and we can keep this. Only remember to warn the user that the father of a non linear mimic joint cannot be a mimic NL joint itself (this is instead possible with the "standard" official mimic tag). This warn is also for the fork of the mimic plugins and joint state publishers

torydebra commented 4 years ago

I should add a check too see that all the "father" joints are effectively contained in the "activeJoint" list (ie not mimic, nor passive)