Conversation
Add a comprehensive collision detection system for BB robots: - Add capsule geometry type to DSL (cylinder with hemispherical caps) - Implement collision primitives: sphere-sphere, capsule-capsule, sphere-capsule, sphere-box, capsule-box, box-box (OBB with SAT) - Add broad phase AABB culling for fast collision pair elimination - Add STL mesh parsing with bounding geometry computation and caching - Implement self-collision detection with adjacent link exclusion - Implement environment collision detection with obstacle API Public API: - `BB.Collision.self_collision?/3` - check for self-collision - `BB.Collision.detect_self_collisions/3` - get collision details - `BB.Collision.collides_with?/4` - check against obstacles - `BB.Collision.detect_collisions/4` - get obstacle collision details - `BB.Collision.obstacle/3,4` - create sphere/capsule/box obstacles All functions support an optional margin parameter for safety buffers.
- Fix alias ordering to be alphabetical in collision modules - Add explicit alias for `BB.Collision.Mesh` instead of inline references - Replace `length/1` assertions with pattern matching in tests - Extract helper functions to reduce cyclomatic complexity in `closest_points_segments` - Extract `check_box_axis/7` to reduce nesting depth in `box_box` - Update formatter config and documentation
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a two-phase collision detection system for BB robots:
BB.Collision.BroadPhase): Fast AABB overlap tests to eliminate non-colliding pairsBB.Collision.Primitives): Precise primitive intersection tests (sphere, capsule, box)BB.Collision.Mesh): STL file loading with automatic bounding sphere/AABB computationFeatures
capsuleDSL entity for collision volumesAPI
Test plan
mix check --no-retry)