Skip to content

Gpmp2 self collision - #434

Open
kshaji3 wants to merge 8 commits into
masterfrom
gpmp2-self-collision
Open

Gpmp2 self collision#434
kshaji3 wants to merge 8 commits into
masterfrom
gpmp2-self-collision

Conversation

@kshaji3

@kshaji3 kshaji3 commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

This PR adds selfCollisionFactor and selfCollisionFactorGP. This PR has contents that were tested on an 18DOF manipulator setup.

  • selfCollisionFactor checks at nodes, while selfCollisionFactorGP ensures that the interpolated trajectory is collision-free. Thi

This uses selfCollisionFactor from: https://arxiv.org/pdf/2011.07171, while adding in a custom GP-implementation of it.

Builds on the obstacle avoidance layer to add self collision: a hinge
loss cost between pairs of query points (own file, split out of
ObstacleCost since it needs no field), a unary factor over a set of
query point pairs with per-point sphere radii, and a GP-interpolated
variant checking collisions between support states without adding
trajectory variables for them. Validates against same-link and
duplicate-point pairs and falls back to a finite direction at
coincident points instead of a NaN Jacobian.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kshaji3
kshaji3 requested a review from dellaert July 25, 2026 22:13
@dellaert
dellaert changed the base branch from master to gpmp2-obstacles July 26, 2026 10:35
@dellaert

Copy link
Copy Markdown
Member

Also changed the base.

@dellaert

Copy link
Copy Markdown
Member

With 5.6 Sol:

I have one performance concern about this factor. Every evaluation computes world positions—and, during linearization, full joint Jacobians—for every query point in RobotQueryPoints, even though the collision factor may reference only a small subset of those points in pairs_. For a detailed whole-robot collision model with sparse collision pairs, this means repeatedly doing transforms and allocating 3 × dof Jacobians that are never used.

The easiest fix may be to compute the unique set of point indices referenced by pairs_ once in the constructor, then evaluate only those points. That likely requires a RobotQueryPoints API that accepts a list of requested point indices, or a collision-specific model containing only the relevant query points. The former is more flexible; the latter is simpler if callers naturally construct one dedicated model per collision factor.

The good news is that the expensive tree discovery and joint-column mapping are already precomputed, and the robot model is shared rather than copied into each factor. The remaining optimization is therefore fairly targeted: replay only the portion of the kinematics needed to produce the referenced points, and avoid building Jacobians for unused points. This becomes increasingly important for many collision spheres, high-DOF robots, GP-interpolated checks, and trajectories with many support intervals.

Base automatically changed from gpmp2-obstacles to master July 27, 2026 10:45
@dellaert

Copy link
Copy Markdown
Member

This now targets master already, so you should be able to just implement the performance comments above, If they're correct.

@kshaji3

kshaji3 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

Pardon my spelling on the commits, but I believe this should have the necessary edits for your performance request.

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.

2 participants