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

Updated parsing of hydroelastic properties #12491

Merged

Conversation

SeanCurtis-TRI
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI commented Dec 16, 2019

PR #12464 merged with asan errors. This PR contains the original approved PR (as the first commit) and the fixes for the problem in the second commit.


This change is Reviewable

@SeanCurtis-TRI
Copy link
Contributor Author

@drake-jenkins-bot linux-bionic-clang-bazel-experimental-address-sanitizer please

@SeanCurtis-TRI
Copy link
Contributor Author

@drake-jenkins-bot linux-bionic-clang-bazel-experimental-address-sanitizer please

@SeanCurtis-TRI SeanCurtis-TRI force-pushed the PR_parse_hydroelastic branch 3 times, most recently from a0a93a7 to e804ea4 Compare December 16, 2019 22:40
@SeanCurtis-TRI
Copy link
Contributor Author

@drake-jenkins-bot linux-bionic-clang-bazel-experimental-address-sanitizer please

@SeanCurtis-TRI SeanCurtis-TRI added the status: single reviewer ok https://drake.mit.edu/reviewable.html label Dec 17, 2019
Copy link
Contributor Author

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+@ggould-tri +(status: single reviewer ok)

Could I get a single check from you. This is the PR you reviewed last week and approved. However, it had an asan failure and we simply reverted it. The first revision in this PR is that PR, verbatim. The subsequent revisions show the changes to address the asan failures (just a few lines). You'll note I've explicitly called one of the failing tests to confirm happiness.

Thanks

Reviewable status: LGTM missing from assignee ggould-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @ggould-tri)

@jwnimmer-tri
Copy link
Collaborator

The TODO mentions #12455, but that PR is already merged.

This introduces a new XML sub-tree that is largely common between both SDF
and URDF.

SDF version:

  <drake:proximity_properties>
    <drake:mesh_resolution_hint>1.3</drake:hydroelastic_resolution_hint>
    <drake:elastic_modulus>1e8</drake:elastic_modulus>
    <drake:hunt_crossley_dissipation>0.25</drake:hunt_crossley_dissipation>
    <drake:mu_dynamic>0.7</drake:mu_dynamic>
    <drake:mu_static>0.7</drake:mu_static>
  </drake:proximity_properties>

URDF version:

  <drake:proximity_properties>
    <drake:mesh_resolution_hint value="1.3" />
    <drake:elastic_modulus value="1e8" />
    <drake:hunt_crossley_dissipation value="0.25" />
    <drake:mu_dynamic value="0.7" />
    <drake:mu_static value="0.7" />
  </drake:proximity_properties>

(URDF differs because URDF has a style that uses attributes whereas SDF
eschews them.)

 - Parsing collision geometry now creates a populated ProximityProperties
   and stores the parsed properties there.
 - There is some code that provides legacy compatibility with old
   mechanisms for specifying coefficients of friction so that existing
   files will still work (albeit with warnings).
 - MBP API has been extended to accept proximity properties compatible with
   this parsing logic. The old API needs to be deprecated (in a follow up
   commit).

We still need to add "soft" deprecation for when we use the legacy
functionality. It can't be compile-time, so it'll have to be warnings with
a time stamp.
`coulomb_friction` accessed a reference into the input properties. Those
properties get *moved* into SceneGraph. However, there is one case where
the moved properties are *discarded* -- when the shape is a mesh. In this
case the captured reference was destroyed leading to referencing freed
memory. This mitigates the immediate symptom.
Copy link
Contributor Author

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO removed. I restored the reference and started writing a note about a potential danger when I decided it's not worth it. Copying a small struct at initialization time is a perfectly satisfactory, safe move to make.

Reviewable status: LGTM missing from assignee ggould-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @ggould-tri)

Copy link
Contributor

@ggould-tri ggould-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Reviewable status: commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @ggould-tri)

@SeanCurtis-TRI
Copy link
Contributor Author

@drake-jenkins-bot linux-bionic-clang-bazel-experimental-address-sanitizer please
@drake-jenkins-bot linux-bionic-clang-bazel-experimental-address-sanitizer please

@SeanCurtis-TRI
Copy link
Contributor Author

@drake-jenkins-bot linux-bionic-clang-bazel-experimental-address-sanitizer please

@SeanCurtis-TRI SeanCurtis-TRI added the status: squashing now https://drake.mit.edu/reviewable.html#curated-commits label Dec 17, 2019
Copy link
Contributor Author

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+(status: squashing now)

(This time without making the CI gods angry...)

Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee ggould-tri(platform) (waiting on @ggould-tri)

@SeanCurtis-TRI SeanCurtis-TRI merged commit f09a56e into RobotLocomotion:master Dec 17, 2019
@SeanCurtis-TRI SeanCurtis-TRI deleted the PR_parse_hydroelastic branch December 17, 2019 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: single reviewer ok https://drake.mit.edu/reviewable.html status: squashing now https://drake.mit.edu/reviewable.html#curated-commits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants