Home | Tutorials | Wiki | Issues
Ask Your Question
2

changing contact joint parameters during simulation

asked 2012-12-04 09:29:55 -0600

AndreiHaidu gravatar image

Hi,

I am trying to change the contact joint parameters of a model / link after it is loaded in Gazebo, from a plugin.

The idea is that I am spawning a model with a lot of sphere links, which act like a fluid. After a while I want to change the contact joint parameters values so that the links act like a rigid body.

The contact joint parameters are something like this at the beginning:

<contact>
  <ode soft_cfm='100.0' soft_erp='100.0' kp='1000000.0' kd='1000000.0' max_vel='100.0' min_depth='0.001'/>
</contact>

So, is there a way to modify them from a plugin? (I have the plugin made, I can access everything in the world). I know that these joints are created only when contacts occur between links. That is why I suppose I cannot access them with something like:

this->my_model->getJoint(..);

Any suggestions?

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-02-16 17:03:18 -0600

Hi @AndreiHaidu, I create a plugin that modifies the properties at runtime. I don't know if is the best approach but I think that will help you.

plugin.h

plugin.cpp

Test.world

After compile you and run the gazebo world you should see a box that will be pushed from left to right by a small speed. There is some friction between box and ground plane, so the box starts to inclinate. About five seconds before the simulation is started, the mu (friction) coefficients are changed by plugin (decreasing) and the box will slip. Five seconds later the mu coefficients are changed by plugin (increasing) and the box starts to inclinate again, and so on...

I hope that it helps you.

edit flag offensive delete link more

Comments

Hi, thanks for the answer, the plugin you wrote looks promising, in my case I will have to change the cfm and erp values, but looking over the API it looks like it is possible.

AndreiHaidu gravatar imageAndreiHaidu ( 2013-02-16 18:03:15 -0600 )edit
Daniel Vaz gravatar imageDaniel Vaz ( 2013-02-16 18:25:52 -0600 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-12-04 09:29:55 -0600

Seen: 198 times

Last updated: Feb 16 '13