Robotics StackExchange | Archived questions

apply torque to joint without accumulation

Hi,

when applying force to a joint at every time step with setForce(), it adds the force to previous existing force without refreshing, i looked for a function that do not accumulate but i didn't found how can i solve this problem!

thanks in advance

Asked by djou07 on 2016-05-10 11:00:33 UTC

Comments

I don't think torques are accumulated via Joint::SetForce. Can you please share how you arrived at that conclusion? Thanks. Ref example for ode: https://bitbucket.org/osrf/gazebo/src/76f21ee32c3db6edeb5a7213e00c4ed223e4b815/gazebo/physics/ode/ODEHingeJoint.cc?at=default&fileviewer=file-view-default#ODEHingeJoint.cc-153

Asked by hsu on 2016-05-15 04:07:09 UTC

Answers

You can try calling Link::SetForce and Link::SetTorque on each link connected to your joint.

Asked by nkoenig on 2016-05-10 11:11:24 UTC

Comments

Thank you! I tried this but it dont give me a realistic simulation... by the way, Link::SetTorque and Link::AddTorque give the same behaviour, probably one of them dont work...

Asked by djou07 on 2016-05-15 03:52:55 UTC

as demonstrated in this test Join::SetForce is not cumulative, the moment you stop calling it the joint becomes passive.

Asked by hsu on 2016-05-16 17:14:43 UTC

Comments

thanks for your reply! I dont know really how it works, but according to this video I made https://www.youtube.com/watch?v=ktEEYCesbkA when I apply at each time step 0.08 Nm to a wheel joint it go realy fast so I thought maybe it is the accumulation.

Asked by djou07 on 2016-05-17 09:45:03 UTC

0.08 is the troque that I caclulated with this equation: torque=length*force

Asked by djou07 on 2016-05-17 10:23:27 UTC