Physics parameters for a rolling ball
Hey there,
I try to simulate a ball balancing on a plate. Now my problem is that for small plate angles <1° the ball is sliding (not rolling) alongside the plate. Any ideas how to set the gazeo urdf physics paramters to avoid sliding and always force the ball to roll directly and very sensitive?
Here is what I have:
<gazebo reference="ball_link">
<gravity>1</gravity>
<maxVEl>1000</maxVel>
<mu1>0.005</mu1>
<mu2>0.005</mu2>
<fdir1>0 0 0</fdir1>
<kp>1e+20</kp>
<kd>1.0</kd>
<maxContacts>1</maxContacts>
</gazebo>
Well setting maxContacts to only 1 was quite helpfull. But still my ball is sliding and not rolling....
1) Should I increase the mu1,mu2 to achieve that?
2) My plate should have the same mu1 and mu2 right?
3) Is fdir1 = 0 0 0 correct?
4) Can I set physics parameters during the gazebo simulation (like the mu1, mu2 parameters)
5) I tried to set the mu1 and mu2 high(100) and also the maxContacts to 100 but still the ball is sliding on the plate and not holding still..... -> maybe I need more weight?
Asked by markus on 2018-09-10 04:40:01 UTC
Answers
1) Should I increase the mu1,mu2 to achieve that?
Sure, try setting mu1, mu2 to 0.1-1 respectively (0.005 is really small)
2) My plate should have the same mu1 and mu2 right?
Not necessarily - but for this specific example it probably wouldn't hurt.
Generally I try to set friction properties from a table (like this: https://www.engineeringtoolbox.com/friction-coefficients-d_778.html) and then tune (maybe a lot) as needed to obtain desired behavior.
3) Is fdir1 = 0 0 0 correct?
I don't think so.
fdir1 should be a 3-tuple specifying direction of mu1 in the collision local reference frame.
Better to leave it blank and just accept the Gazebo default.
4) Can I set physics parameters during the gazebo simulation (like the mu1, mu2 parameters)
Yes, I think so. These linksmay be a good start:
http://gazebosim.org/tutorials?tut=preset_manager&cat=physics
http://answers.gazebosim.org/question/360/changing-contact-joint-parameters-during-simulation/?answer=1430#post-id-1430
5) I tried to set the mu1 and mu2 high(100) and also the maxContacts to 100 but still the ball is sliding on the plate and not holding still..... -> maybe I need more weight?
I recommend adding a small minDepth value, e.g. 0.001-0.005. It's possible that the "sliding" you are observing is just the ball bouncing up and down - losing contact every time. Maybe try reducing maxVel a bit too.
For example:
<gazebo reference="ball_link">
<gravity>1</gravity>
<minDepth>0.001</minDepth>
<maxVel>10</maxVel>
<mu1>1</mu1>
<mu2>1</mu2>
<kp>1e+10</kp>
<kd>1.0</kd>
<maxContacts>10</maxContacts>
</gazebo>
Asked by josephcoombe on 2018-09-11 17:09:21 UTC
Comments