Skip to content

One capsule per link is a coarse robot #8

Description

@Onwcan

What is missing

The collision model currently carries a single capsule per link.

For a six-link arm, that means six capsules are expected to approximate the geometry of the complete robot.

This is intentionally conservative, but it can significantly over-approximate real link geometry.

As a result, the collision checker can refuse poses that the physical robot could safely hold.

ADR-0015 already records this limitation and identifies the natural improvement: allow more capsules.

Why it matters

The failure mode is conservative, so it is safe.

But excessive conservatism creates another practical problem: it can make the collision checker unusable.

For example, if an oversized capsule prevents the wrist from folding near the forearm even though the real geometry permits it, an operator eventually learns that the collision model frequently rejects valid poses.

A safety mechanism that is routinely too conservative risks being ignored or disabled.

Proposed scope

Allow multiple capsules per link while preserving fixed-size storage.

Use a small compile-time cap in the same style as kMaxObstacles = 32.

Each capsule should have its own local transform.

Allowed-collision representation

The existing allowed-collision set uses a uint64_t bitmask over link pairs.

With multiple capsules per link, decide whether this remains:

  • per-link, or
  • becomes per-capsule

Per-link is likely the better representation because adjacency and intentionally allowed contact are properties of links rather than individual geometric primitives.

If that decision is kept, document why.

Moving to per-capsule permissions would provide finer control but would also require more than the current 64-bit representation.

Acceptance criteria

  • Allow more than one capsule per link.
  • Keep a small fixed maximum rather than introducing dynamic allocation.
  • Give each capsule its own local transform.
  • Decide whether allowed collisions remain link-based or become capsule-based.
  • Document the reason for that decision.
  • Add a test where a pose is rejected by a single coarse capsule.
  • Model the same link using two capsules and show that the pose becomes valid.
  • Report the clearance values for both models in the test.
  • Re-measure collision-checking cost.
  • Publish the new benchmark rather than assuming the additional capsule pairs remain negligible.

The current reference is 27 capsule-distance calculations in approximately 432 ns.

The new cost grows with the product of the per-link capsule counts.

References

docs/adr/0015-collision-checking-in-capsules.md, Consequences bullet 3.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions