jsk-ros-pkg / jsk_model_tools

JSK model utilities
https://github.com/jsk-ros-pkg/jsk_model_tools
BSD 3-Clause "New" or "Revised" License
6 stars 29 forks source link

With use-base 0.1, expect PR2 to use base and move around. #119

Closed aginika closed 9 years ago

aginika commented 9 years ago

I expect ":use-base" will make PR2 use kind of move-base to solve the Inverse-kinematics. But at the below code, PR2 just move the arm as "8" and pr2's base doesn't move.(Torso is working) Even if I move the target coords far from PR2, this just ended to fail Inverse-kinematics. It didn't move.

https://github.com/jsk-ros-pkg/jsk_model_tools/blob/065556181e1ac10cd2103e9dc7ca3cad7f83e0de/euscollada/test/euscollada-pr2-test.l#L25

(I also needed to add ":move-target" ":link-list" to prevent some errors)

k-okada commented 9 years ago

please look into pr2-util.l and jskeus

◉ Kei Okada

On Mon, Jun 22, 2015 at 5:37 PM, Yuto Inagaki notifications@github.com wrote:

I expect ":use-base" will make PR2 use kind of move-base to solve the Inverse-kinematics. But at the below code, PR2 just move the arm as "8" and pr2's base doesn't move.(Torso is working) Even if I move the target coords far from PR2, this just ended to fail Inverse-kinematics. It didn't move.

https://github.com/jsk-ros-pkg/jsk_model_tools/blob/065556181e1ac10cd2103e9dc7ca3cad7f83e0de/euscollada/test/euscollada-pr2-test.l#L25

(I also needed to add ":move-target" ":link-list" to prevent some errors)

— Reply to this email directly or view it on GitHub https://github.com/jsk-ros-pkg/jsk_model_tools/issues/119.

aginika commented 9 years ago

Thank you! With pr2util.l, it use the base of PR2, but the many of Inverse Kinematics failed...

I test some of parameters Not Use-base pr2_now_default

Use-base 0.1 pr2_now1

Use-base 0.5 pr2_now2

Use-base 0.9 pr2_now3

Use-base 0.99 pr2_now4

Use-base 10 was as same as 0.99

What can I do with these things?... It seems to just add the base to addtional-weight-list. Do I need to move the pr2 as near to the target as possible by myself?

k-okada commented 9 years ago

what is expected behavior? all box should be red? please run ik with :debug t and see what's going on. Also commit your code under pr2 as test program and create PR

◉ Kei Okada

On Mon, Jun 22, 2015 at 8:47 PM, Yuto Inagaki notifications@github.com wrote:

Thank you! With pr2util.l, it use the base of PR2, but the many of Inverse Kinematics failed...

I test some of parameters Not Use-base [image: pr2_now_default] https://cloud.githubusercontent.com/assets/3803922/8281087/6f0359ba-191f-11e5-9763-6b7d01b3d6aa.png

Use-base 0.1 [image: pr2_now1] https://cloud.githubusercontent.com/assets/3803922/8281089/76703a2e-191f-11e5-8b58-21059740bdda.png

Use-base 0.5 [image: pr2_now2] https://cloud.githubusercontent.com/assets/3803922/8281093/7da3ac68-191f-11e5-8220-97e1d65f1506.png

Use-base 0.9 [image: pr2_now3] https://cloud.githubusercontent.com/assets/3803922/8281103/86f4662c-191f-11e5-98a4-67b70a609ea4.png

Use-base 0.99 [image: pr2_now4] https://cloud.githubusercontent.com/assets/3803922/8281104/919bf63a-191f-11e5-8a94-450cf44a7705.png

Use-base 10 was as same as 0.99

What can I do with these things?... It seems to just add the base to addtional-weight-list. Do I need to move the pr2 as near to the target as possible by myself?

— Reply to this email directly or view it on GitHub https://github.com/jsk-ros-pkg/jsk_model_tools/issues/119#issuecomment-114076362 .

aginika commented 9 years ago

Yes, I hope all the box become red. Ok, I will.

k-okada commented 9 years ago

If would debug as follows:

1 attach end coords directory to the base, and solve IK, this is 3dof(x,y,yaw) robot should find solution 2 use arm end coords but set small weight ( I suppose use greater number for eus arguments?) not to move arms . Of cause, arm initial arm postures is set to grab object no the ground. From the kinematics point of view, this is almost equals to 1. So it should move. 3 if 2 works, your program should work, with small modification.

Good luck!

◉ Kei Okada

2015/06/22 21:19、Yuto Inagaki notifications@github.com のメッセージ:

Yes, I hope all the box become red. Ok, I will.

— Reply to this email directly or view it on GitHub.

aginika commented 9 years ago

Thank you. I will.

As a reference this is the behavior of the IK with use-base 0.99, pr2_ik_failere

h-kamada commented 9 years ago

I was also using :use-base and encountered the same problem. And, I was searching for the file in which the :inverse-kinematics method is written and adding weight is defined. I couldn't find where something about adding weight is defined.

super class of pr2-robot is euscollada-robot and it's written in euscollada/src/euscollada-robot.l. super class of euscollada-robot is robot-model and it's written in euslisp/jskeus/irteus/irtrobot.l. super class of robot-model is cascaded-link and it's written in euslisp/jskeus/irteus/irtmodel.l.

I thought something about adding weight is written in above files. But, I couldn't find it. Where is it defined?

snozawa commented 9 years ago

Did you check pr2eus/pr2-utils.l?

h-kamada commented 9 years ago

yes. But, in that file, detail of that is not written. Word additional-weight-list is in irtmodel or irtrobot, so detail may be in that file. But, structure of function is complex, so couldn't find.

snozawa commented 9 years ago

I see. Learning from irtmodel.l will help you. https://github.com/euslisp/jskeus/blob/master/irteus/irtmodel.l

In inverse-kinematics calculation, :calc-inverse-kinematics-weight-from-link-list is called: https://github.com/euslisp/jskeus/blob/master/irteus/irtmodel.l#L1716 Then, calculated weight value is used in SR-inverse calculation: https://github.com/euslisp/jskeus/blob/master/irteus/irtmodel.l#L1045

:calc-inverse-kinematics-weight-from-link-list returns weighting vector: https://github.com/euslisp/jskeus/blob/master/irteus/irtmodel.l#L1548 additional-weight-list directly changes weighting value for specified joints in this method.

If you want to weight vector value in each iteration, please use :debug-view t.

h-kamada commented 9 years ago

Thank you very much!