Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Friction not working #5

Open
daydin opened this issue Jan 9, 2014 · 3 comments
Open

Friction not working #5

daydin opened this issue Jan 9, 2014 · 3 comments
Labels

Comments

@daydin
Copy link

daydin commented Jan 9, 2014

Hello!

I am currently trying to incorporate some friction into the world to simulate realistic robot-wall collisions. In order to I do this, I simply set the dryFrictionCoefficient to 1 for all wall objects and the e-puck. However, this doesn't seem to impede the robot dragging along the wall so far as I can see.

I also thought to make the collisions perfectly inelastic (collisionElasticity = 0) such that the robot gets stuck on the wall if it collides with it. Again, I had no luck observing a real inelastic collision.

I was just curious if there is something I am missing. Any advice on how to overcome this problem is much welcome.

@stephanemagnenat
Copy link
Collaborator

The problem in the collision between a robot and the wall is that two "wrong" models have a very bad interference:

  • contrary to a free floating object, a robot with wheel has an infinite friction with the ground
  • when two objects interpenetrate, they are "deinterlaced" regardless of friction
    As you can imagine, when a robot moves into the wall, the wall does not move (it is fixed) and the robot moves firmly into the wall, because of the infinite friction of its wheels. Finally, it gets deinterlaced.

A solution would be to have a finite friction between the robot's wheels and the ground, but that is probably not trivial to implement right.

@daydin
Copy link
Author

daydin commented Jan 10, 2014

Dear Stéphane,

Where is the part of code that determines this infinite friction between
the wheel and the floor?

I was looking at collideWithStaticObject in PhysicalEngine.cpp and the
collision code (also repeated in line 573-589 of the same file) is said to
be borrowed from http://www.myphysicslab.com/collision.html. I don't quite
understand some of the expressions there. It seems that there is no
equivalent of the "Thrust force vector" and "rubber band force vector" in
there, is that correct?
Do you mind explaining this method (collideWithStaticObject)? I don't see
how the equations there are related to the ones on the website...

Insights are much welcome!

Deniz

@stephanemagnenat
Copy link
Collaborator

Dear Deniz,

For "bare" PhysicalObjects, collisions results in changes in speed and angSpeed, which are then affected by friction in PhysicalObject::applyForces() and finally used to integrate the position in PhysicalObject::initPhysicsInteractions(). However, robots inherits from DifferentialWheeled, which overwrites applyForces() and forces the speed to the command from the robot, effectively implementing a model of infinite friction between the ground and the robot. The only way other objects can affect a DifferentialWheeled is through de-interlacing.

The model in PhysicalObject::collideWithStaticObject() implements the collision part of the referred page, especially a simplified version of equation (11) when one object is static (i.e. has infinite mass and moment of inertia).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants