[Question] Missing Contact because of bouncing #5153
Replies: 5 comments
-
|
Thank you for posting this. Here is a summary to review that may be of help, still under review, though. You are missing some contacts because your contact-time check does not line up with the actual sensor update timing and contact duration at high impact speeds.1 Why contacts are missed
How to fix it
# dt here should match your RL/control step (e.g. 1/60 or decimation * 1/60)
in_contact = self._contact_sensor.compute_in_contact(dt=self.step_dt)
# or for edges:
first_contact = self._contact_sensor.compute_first_contact(dt=self.step_dt)
first_air = self._contact_sensor.compute_first_air(dt=self.step_dt)Then use: contact_flag = in_contact.squeeze(1) > 0
contact_now = self._contact_sensor.data.current_contact_time.squeeze(1) > 0.0If you really want a duration threshold, make it < dt (i.e., “has been in contact for less than one step”), or use the helper methods which already implement that robustly.1
Minimal practical changeFor your current setup, the simplest robust solution is: # Assume RL step = decimation * sim dt
self.rl_dt = self.decimation * (1.0 / 60.0)
# At each RL step:
in_contact = self._contact_sensor.compute_in_contact(dt=self.rl_dt)
contact_flag = in_contact.squeeze(1).any(dim=-1) # per-env flagFootnotes
|
Beta Was this translation helpful? Give feedback.
-
|
Hi @RandomOakForest, Thank you for that very detailed answer, it makes a lot of sense. I tried to implement the
I had a look in the links you provided and think that maybe I implemented my Contact Sensor differently. I get the contact sensor from I will try to implement it from IsaacSim not IsaacLab and see if this is able to solve my issue. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, I'm reviewing the methods and will be updating the post as time permits. I hope the idea posted can get you unblocked. Thank you for your interest in Isaac Lab. |
Beta Was this translation helpful? Give feedback.
-
|
i create the sensor with
yet I receive the error
<class 'ValueError'> /World/envs/env_.*/Robot/MainBody/Contact_Sensor is not a valid path Which I believe is because of the |
Beta Was this translation helpful? Give feedback.
-
|
I will move this to our Discussions section for follow up. Let us know if you need further help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I have a contact sensor set up between two Convex Decomposition meshes, with a dt 1/60s and decimation of 6, and the contact sensor defined as
I check for contact with
contact = self._contact_sensor.data.current_contact_time.squeeze(1) > 0.1.Yet when i have a collision at around 5m/s sometimes it misses the contact and will not flip the flag on the contact variable. How should I go about fixing this to capture all contacts?
Beta Was this translation helpful? Give feedback.
All reactions