Skip to content

Fix flex contact filtering compaction#3298

Open
fallintoplace wants to merge 1 commit into
google-deepmind:mainfrom
fallintoplace:fix/filter-flex-contacts
Open

Fix flex contact filtering compaction#3298
fallintoplace wants to merge 1 commit into
google-deepmind:mainfrom
fallintoplace:fix/filter-flex-contacts

Conversation

@fallintoplace
Copy link
Copy Markdown

Fixes #3297.

This changes the flex contact filtering pass so it no longer reorders contacts[] while the farthest-point sampling loop is still using index-based selection state.

Before this change, mj_filterFlexContacts could keep a different set of contacts than the one the selector actually picked. In the bad cases, the retained prefix after filtering could drop or replace the final selected contact.

What changed:

  • keep the contacts selected by FPS in a temporary buffer
  • compact the filtered prefix once at the end of the loop
  • add a regression test that compares the helper against a small reference FPS implementation

Validation:

  • ran ../build/bin/engine_collision_driver_test from test/

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.

filterFlexContacts can keep the wrong final contact after FPS compaction

1 participant