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

Address Contact Issues #980

Merged
merged 18 commits into from
Oct 24, 2024
Merged

Address Contact Issues #980

merged 18 commits into from
Oct 24, 2024

Conversation

hang-yin
Copy link
Contributor

@hang-yin hang-yin commented Oct 15, 2024

Motivation

  1. Small/light objects may fall asleep during motion after teleporting
  2. RigidContactAPI does not give valid impulse/contact data even when two objects are clearly touching and awake

Fix

  1. Lower sleep threshold from 0.001 to 0.00005
  2. Lower contact threshold to 0.0; Use contact sensor instead for transition rules TouchingAnyCondition

Implications

  1. We have three ways of checking contact in OG:
  • RigidContactAPI:
    • This works when contacting objects are both awake, but not when they are asleep
    • We will use this when objects are guaranteed to be awake when we do the contact check
      • Assisted Grasping: robot fingers need to be moving and touching the object
      • ToggleOn: robot fingers need to be moving and touching the toggle button
      • SlicerActive: slicer need to be moving and touching the sliceable
  • Simulator _on_contact callback:
    • This triggers whenever there's contact; currently only used for attachment
  • Contact sensor:
    • This works regardless if an object is awake or asleep, presumably because of some internal contact caching mechanism
    • We will use this when motion/objects being awake is not guaranteed:
      • Transition Rules TouchingAnyCondition
      • ContactBodies
      • Touching
  1. In general, contact sensor query is slower than batched RigidContactAPI query. Going forward, we will try to use RigidContactAPI whenever possible, and use contact sensor as a fallback.

Copy link
Contributor

@cremebrule cremebrule left a comment

Choose a reason for hiding this comment

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

just a few comments! thanks for looking into this!!

btw, forcing objects awake doesn't make RigidContactAPI work? And if so, why is that?????

@hang-yin
Copy link
Contributor Author

comments! thanks for looking into this!!

btw, forcing objects awake doesn't make RigidContactAPI

I guess the point is that if objects need explicit waking before generic contact checking, this check would generally be slow. We could potentially benchmark contact sensor call against waking+RigidContactAPI

@hang-yin hang-yin added this to the v1.2.0 milestone Oct 17, 2024
Copy link
Contributor

@cgokmen cgokmen left a comment

Choose a reason for hiding this comment

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

LGTM, but are we undoing the transition rule thing?

@cgokmen cgokmen merged commit c932eae into og-develop Oct 24, 2024
20 of 21 checks passed
@cgokmen cgokmen deleted the fix/contact-checking branch October 24, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants