Very Rigid Hinge joint with custom joint API

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Very Rigid Hinge joint with custom joint API

Postby Gianluca » Wed Mar 10, 2010 9:37 am

Hello,
I'm trying to replicate the behaviour of the joint of the iCub robot (http://eris.liralab.it/iCub/dox/html/index.html) in order to simulate it.
The joints of the robot are very rigid and they are controlled specifying the desired final position or directly setting the velocity of the motors.

I tryed... but I'm defenitely not able to implement a very rigid joint using the customjoint api provided by Newton.

My code is browseable at http://eris.liralab.it/italk/dox/html/index.html
In particular, the code for setting the desired position of a joint is at row 289 of
http://eris.liralab.it/italk/dox/html/p ... ource.html

I used a AddAngularRow for rotation the hinge joint to the desired position. But the newton never reach the desired position setted by AddAngularRow because the gravity force act against the movement and the final position is different.
The worst situation is when the arm of the robot is opened, and the gravity force acting on the hand is amplified (due to lever rule) on the shoulder and so, the shoulder start to flex down.
In the real robot the joint are very rigid, and there is no gravity effect on joints movements. So, I need to add rigidity to my custom joints in order to move the joint in the desired position and keep the joint exactly in that position even is the gravity acts against the joint.

I tryed to use the same tricks for blocking the rotational movements with AddLinearRow used on rows 214-219 for implementing the hinge rotation toward the desired position... but I'm not able to do that. (I tryed... but I failed :-( )

Anybody can help me to solve this problems ???

Thank you,
Gianluca M.
Gianluca
 
Posts: 53
Joined: Fri Nov 11, 2005 4:37 am
Location: Rome - Italy

Re: Very Rigid Hinge joint with custom joint API

Postby Dave Gravel » Wed Mar 10, 2010 5:07 pm

Do you have try to set the good min and max angle limit at final position.
Exemple you can update joint position by changing the limit angle value.
If you change the min and max limit in runtime both with same angle you get a very rigid joint effect.
I'm not sure if it can help you, I just like to let's you know.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 801
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Very Rigid Hinge joint with custom joint API

Postby Gianluca » Thu Mar 11, 2010 5:14 am

I tryed... but it failed. Because also the angle limits are not so rigid as one could expect.
In fact, one of the others problems is the behaviour on the limits. When the arm is fully flexed with the inner of the palm up, then the elbow is pushed to the limit by gravity, and it cannot go back because the limit is not rigid as I would. :-(

There is something wrong in my code that I cannot figure out.
I tryed to set all masses to 1 in order to avoid big differences in mass-ratio... and didn't work.
I supposed that the little dimension of the object could be a problem... and I resized the robot till 10 meter ... and didn't work.

Any idea on what problem could be ??

Thanks,
Gianluca.
Gianluca
 
Posts: 53
Joined: Fri Nov 11, 2005 4:37 am
Location: Rome - Italy

Re: Very Rigid Hinge joint with custom joint API

Postby Julio Jerez » Thu Mar 11, 2010 8:31 am

I will download this this weekend and see what I can do.

I think you are right the joints will be too soft, I have to try to solve that problem one and for all.
I think the only what to do it is by making a two pass solver.
the first one is the way it is now. but only solve for the velocities.
after teh velocites are integrates an dteh enter system is advanced,
it need to do a secund pass and solve the error positions in the same step.

for a long time I wnat to add the option to the engine but I always get scared of lossing too much performeance.
But there are few projects tah do requaire that type of behavior.

I see what I can do, I coudl use thsi project to try that solution.
Is this a window or a Linux project?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Very Rigid Hinge joint with custom joint API

Postby Julio Jerez » Thu Mar 11, 2010 8:49 am

when I try to dwonload the project I get thsi snv error

Command: Checkout from https://svn.cognitivehumanoids.eu/italk/trunk/italk, revision HEAD, Fully recursive, Externals included
Error: OPTIONS of 'https://svn.cognitivehumanoids.eu/italk/trunk/italk': Server
Error: certificate verification failed: certificate issued for a different hostname,
Error: issuer is not trusted (https://svn.cognitivehumanoids.eu)
Finished!:


It gives me the options to ignore or to reject,
if I reject it stops download, if I ignored it, it download the project but I get a whole bunch of errors when I run CMAKE
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Very Rigid Hinge joint with custom joint API

Postby JernejL » Thu Mar 11, 2010 9:01 am

Julio Jerez wrote:I think the only what to do it is by making a two pass solver.
the first one is the way it is now. but only solve for the velocities.
after teh velocites are integrates an dteh enter system is advanced,
it need to do a secund pass and solve the error positions in the same step.


I hope this will be optional, a lot of projects don't need such precise joints and require performance.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Very Rigid Hinge joint with custom joint API

Postby Gianluca » Thu Mar 11, 2010 9:10 am

Sorry, the project that I linked is part of a bigger project... so, it depends to a lot of stuff.
If you need to compile by yourself, I can make a version without any dependencies that compile easly.

The two pass solver can be activated optionally using the function NewtonSetSolverModel, because I understand that it useful only in my context and for me performances is not a priority. So, don't worry if it slow down Newton.

Thaks,
Gianluca.
Gianluca
 
Posts: 53
Joined: Fri Nov 11, 2005 4:37 am
Location: Rome - Italy

Re: Very Rigid Hinge joint with custom joint API

Postby Julio Jerez » Thu Mar 11, 2010 9:36 am

ok if you can make the test project that will be good.

you are not the only one that have problem with soft joint, I need to take a look at that problem.
I do not know if I will be able to solve it but I will give it my best, at least I will try to make it better than it is know.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Very Rigid Hinge joint with custom joint API

Postby kallaspriit » Thu Mar 11, 2010 4:50 pm

Stiffer joints would be great for my project too, hope there is something that can be done, good luck :)
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Very Rigid Hinge joint with custom joint API

Postby Gianluca » Mon Mar 15, 2010 9:54 am

I prepared a version of the iCub Simulator without any external dependencies.
http://laral.istc.cnr.it/esm/icubsim_alone.tar.gz
The only library requested is QT4.
If you are going to compile under linux... check that the qmake correspond to version 4.x ("qmake --version").
For now there is no graphical interface for changing the joint angles... If you need it, I'll add tomorrow.
If you look at the source "primitiva.cpp" under icubsimulator directory there are these lines:

Code: Select all
   if ( first ) {
      MultiMotorController* mm = icub->rightArmController();
      mm->positionMove( 0, 90 );
      first = false;
   }

positionMove tells to the robot to move the corresponding joint to the angle. In the code pasted above, the joint "0" of the rightArm will be moved to 90 degree.
Joint 0 is the shoulder, and the 1, 2,... until 15 for all rigth arm joints. The problem is about the shoulder and elbow joints (0,1,2 and 3) that are too soft and I need a very stiff behaviour instead.
Sorry, the application is not user-friendly :-( I hope it will help anyway.

Thanks,
Gianluca
Gianluca
 
Posts: 53
Joined: Fri Nov 11, 2005 4:37 am
Location: Rome - Italy

Re: Very Rigid Hinge joint with custom joint API

Postby Julio Jerez » Mon Mar 15, 2010 9:58 am

before I download it, does it work on windows PC?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Very Rigid Hinge joint with custom joint API

Postby Gianluca » Mon Mar 15, 2010 11:34 am

I tryed a bit on window... and it compile and it run... but I didn't fully tested for bugs.
Gianluca
 
Posts: 53
Joined: Fri Nov 11, 2005 4:37 am
Location: Rome - Italy

Re: Very Rigid Hinge joint with custom joint API

Postby Julio Jerez » Mon Mar 15, 2010 1:38 pm

Oh cool I will tonight download is see what I can do.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Very Rigid Hinge joint with custom joint API

Postby Gianluca » Wed Mar 17, 2010 11:59 am

Sorry... I founded a sublte bug in the bindTexture of QT4 that slow down the application... and create big memory-leaks on the graphic cards.
IF you are going to use icubsim_alone on windows... wait until I fix the bug.
Gianluca
 
Posts: 53
Joined: Fri Nov 11, 2005 4:37 am
Location: Rome - Italy

Re: Very Rigid Hinge joint with custom joint API

Postby Julio Jerez » Wed Mar 17, 2010 12:07 pm

I was planning to do this this saturday, you have tiem to fix it.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests