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

Update self-collision barrier unit test #129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stephane-caron
Copy link
Owner

@stephane-caron stephane-caron commented Apr 11, 2025

This PR investigates #130.

Failing unit test

The test considers the following collision pair:

        self.colliding_objects_pair_id = 24  # Between second and third bodies

Indeed, pair 24 is between bodies iiwa_link_2_0 and iiwa_link_3_1 of the iiwa14 description:

In [12]: first = self.configuration.collision_model.collisionPairs[24].first

In [13]: second = self.configuration.collision_model.collisionPairs[24].second

In [14]: self.configuration.collision_model.geometryObjects[first].name
Out[14]: 'iiwa_link_2_0'

In [15]: self.configuration.collision_model.geometryObjects[second].name
Out[15]: 'iiwa_link_3_1'

However, the test checks h[self.colliding_objects_pair_id], where the ordering of the barrier vector h depends on sorted distances:

        closest_pairs_idxs = np.argpartition(-distances, -self.dim)[
            -self.dim :
        ]

        return distances[closest_pairs_idxs]

If this analysis is correct, h[self.colliding_objects_pair_id] may not correspond to the distance for pair 24 after sorting, so it will not necessarily be negative 🤔

Proposed update

This PR updates the test to:

  1. Put the robot in the following configuration:

image

  1. Check that the lowest value in h is negative (as there is a self-collision)

@stephane-caron stephane-caron changed the title WIP: CICD: Move coverage from tox to conda Investigate self-collision barrier unit test error Apr 11, 2025
stephane-caron added a commit that referenced this pull request Apr 11, 2025
stephane-caron added a commit that referenced this pull request Apr 11, 2025
stephane-caron added a commit that referenced this pull request Apr 11, 2025
stephane-caron added a commit that referenced this pull request Apr 11, 2025
@stephane-caron stephane-caron linked an issue Apr 11, 2025 that may be closed by this pull request
@stephane-caron
Copy link
Owner Author

@domrachev03 Do you agree that this update tests what we want to test here?

@stephane-caron stephane-caron marked this pull request as ready for review April 11, 2025 16:00
@stephane-caron stephane-caron changed the title Investigate self-collision barrier unit test error Update self-collision barrier unit test Apr 14, 2025
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.

Failing self-collision barrier unit test
1 participant