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

Coulomb friction parameters not handled properly in dart #1000

Open
osrf-migration opened this issue Jan 10, 2014 · 9 comments
Open

Coulomb friction parameters not handled properly in dart #1000

osrf-migration opened this issue Jan 10, 2014 · 9 comments
Labels

Comments

@osrf-migration
Copy link

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


There are a bunch of sliding boxes with difference coefficients of friction in test_friction.world. In ODE and bullet, two of the boxes remain still while the other boxes start to slide at different rates (according to their friction coefficient). In dart, however, all the boxes slide at the same rate.
This could be a simple matter of parameters not being passed on correctly.

(Similar to #989 for simbody)

@jslee02 @karenliu

@osrf-migration
Copy link
Author

Original comment by Jeongseok Lee (Bitbucket: jlee02, GitHub: jslee02).


This is implemented by 7b787e6. It seems the behavior of the boxes are visually similar to ODE and Bullet. Here is a test video.

Is there a more specific unit test for this?

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


Cool, I'm testing it now. I'll submit a quick pull request with the ABI changes to gazebo5 since code freeze is very soon.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


It looks like it's working; I'm modifying the test to use dart now.

It looks like there's just a single friction coefficient, not a friction pyramid. Are there plans to implement a friction pyramid? If not, I would use a different data structure.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


diff -r 83b110d7f601be81ce0101a0a17a6711189fcf44 test/integration/physics_friction.cc
--- a/test/integration/physics_friction.cc	Fri Jan 16 10:52:48 2015 -0800
+++ b/test/integration/physics_friction.cc	Fri Jan 16 11:24:54 2015 -0800
@@ -26,6 +26,11 @@
 #include "gazebo/physics/bullet/BulletTypes.hh"
 #endif
 
+#ifdef HAVE_DART
+#include "gazebo/physics/dart/DARTSurfaceParams.hh"
+#include "gazebo/physics/dart/DARTTypes.hh"
+#endif
+
 #include "gazebo/transport/transport.hh"
 #include "ServerFixture.hh"
 #include "helper_physics_generator.hh"
@@ -80,6 +85,18 @@
                                   / 2.0;
                 }
 #endif
+#ifdef HAVE_DART
+                else if (physics->GetType() == "dart")
+                {
+                  physics::DARTSurfaceParamsPtr surface =
+                    boost::dynamic_pointer_cast<physics::DARTSurfaceParams>(
+                    (*iter)->GetSurface());
+                  // Average the mu1 and mu2 values
+                  this->friction = (surface->frictionPyramid.GetMuPrimary()
+                                  + surface->frictionPyramid.GetMuSecondary())
+                                  / 2.0;
+                }
+#endif
               }
             }
     public: ~FrictionDemoBox() {}
@@ -255,13 +272,6 @@
           << std::endl;
     return;
   }
-  if (_physicsEngine == "dart")
-  {
-    gzerr << "Aborting test since there's an issue with dart's friction"
-          << " parameters (#1000)"
-          << std::endl;
-    return;
-  }
 
   Load("worlds/friction_demo.world", true, _physicsEngine);
   physics::WorldPtr world = physics::get_world("default");

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


I just looked at the dart source code, and it looks like it is using a friction pyramid internally, so this is probably the right set of parameters.

@osrf-migration
Copy link
Author

Original comment by Jeongseok Lee (Bitbucket: jlee02, GitHub: jslee02).


Yes, it's using a friction pyramid internally but uses single friction coefficient for the two friction directions by taking the lower single friction coefficient of the colliding bodies.

Supporting two friction coefficient with custom friction direction will be implemented in the future.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


I pulled in @jslee02 's code in branch dart_coulomb_friction and added some API changes. The test passes right now.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


pull request #1386 provides support for setting a single friction coefficient, though custom friction directions with separate friction coefficients are not yet supported.

see the following upstream issues:

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • set version to "all"

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

1 participant