-
Notifications
You must be signed in to change notification settings - Fork 5
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
mjcf->sdformat sliding friction #86
Conversation
Add friction to plane in test_mujoco.xml for unit test and test default friction with tennis_ball.xml Signed-off-by: Steve Peters <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #86 +/- ##
=======================================
Coverage 95.15% 95.16%
=======================================
Files 24 24
Lines 1177 1179 +2
=======================================
+ Hits 1120 1122 +2
Misses 57 57
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just need to handle missing attributes.
if geom.friction is not None: | ||
col.surface().friction().ode().set_mu(geom.friction[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the friction is None, we should set to the default value of 1.
if geom.friction is not None: | |
col.surface().friction().ode().set_mu(geom.friction[0]) | |
friction = su.get_value_or_default(geom.friction, [1, 0.005, 0.0001]) | |
col.surface().friction().ode().set_mu(friction[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdformat_mjcf/tests/mjcf_to_sdformat/test_add_mjcf_geometry_to_sdf.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
sdformat_mjcf/src/sdformat_mjcf/mjcf_to_sdformat/converters/geometry.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Steve Peters <[email protected]> Co-authored-by: Addisu Z. Taddese <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just linter issues.
self.assertEqual(sdf.GeometryType.PLANE, | ||
sdf_plane_collision.geom().type()) | ||
self.assertEqual(0.9, | ||
sdf_plane_collision.surface().friction().ode().mu()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.assertEqual(sdf.GeometryType.PLANE, | |
sdf_plane_collision.geom().type()) | |
self.assertEqual(0.9, | |
sdf_plane_collision.surface().friction().ode().mu()) | |
self.assertEqual(sdf.GeometryType.PLANE, | |
sdf_plane_collision.geom().type()) | |
self.assertEqual(0.9, | |
sdf_plane_collision.surface().friction().ode().mu()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.assertEqual(sdf.GeometryType.CAPSULE, | ||
sdf_rail1_collision.geom().type()) | ||
self.assertEqual(1.0, | ||
sdf_rail1_collision.surface().friction().ode().mu()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.assertEqual(sdf.GeometryType.CAPSULE, | |
sdf_rail1_collision.geom().type()) | |
self.assertEqual(1.0, | |
sdf_rail1_collision.surface().friction().ode().mu()) | |
self.assertEqual(sdf.GeometryType.CAPSULE, | |
sdf_rail1_collision.geom().type()) | |
self.assertEqual(1.0, | |
sdf_rail1_collision.surface().friction().ode().mu()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Addisu Z. Taddese <[email protected]>
Fixed test error in 359552a |
🎉 New feature
Follow-up to #70
Summary
This supports translation of sliding friction parameters from MJCF to SDFormat, the reverse of #70. It requires gazebosim/sdformat#1049 and will remain in draft state until that is merged.
Test it
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.