Skip to content

Nonlinear CCD - #72

Merged
zfergus merged 13 commits into
mainfrom
nonlinear-ccd
Oct 23, 2023
Merged

Nonlinear CCD#72
zfergus merged 13 commits into
mainfrom
nonlinear-ccd

Conversation

@zfergus

@zfergus zfergus commented Oct 21, 2023

Copy link
Copy Markdown
Member

Description

This PR adds a generic implementation of the nonlinear CCD (of linear geometry) algorithm from [Ferguson et al. 2021].

Generic nonlinear trajectories are specified through a NonlinearTrajectory virtual class. By default the maximum distance between the trajectory and a linearized version is computed using interval arithmetic. That is

$$ \max_{t \in [0, 1]} \Vert p(\mathrm{lerp}(t_0, t_1, t)) - \mathrm{lerp}(p(t_0), p(t_1), t) \Vert_2 \leq \sup(\Vert p([t_0, t_1]) - \mathrm{lerp}(p(t_0), p(t_1), [0, 1]) \Vert_2) $$

where $p$ is the point's position over time, $\mathrm{lerp}(a, b, t) := (b - a) t + a$ and $\sup([a,b]):=b$. Because this can be an overly conservative approximation, users can override the NonlinearTrajectory::max_distance_from_linear function to compute the max directly in closed form if known.

We perform interval arithmetic using filib which has been shown to be "the only library that is correct, consistent, portable, and efficient" [Tang et al. 2022].

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

New unit tests checking for rotational trajectories.

Test Configuration:

  • OS and version: macOS 14.0
  • Compile and version: Apple clang version 15.0.0

Checklist:

  • I have followed the project style guide
  • My code follows the clang-format style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@zfergus zfergus added the enhancement New feature or request label Oct 21, 2023
@zfergus zfergus changed the title Nonlinear ccd Nonlinear CCD Oct 21, 2023
@codecov

codecov Bot commented Oct 21, 2023

Copy link
Copy Markdown

Codecov Report

Merging #72 (3fa224e) into main (7d04a5f) will increase coverage by 0.01%.
The diff coverage is 96.49%.

@@            Coverage Diff             @@
##             main      #72      +/-   ##
==========================================
+ Coverage   95.11%   95.13%   +0.01%     
==========================================
  Files          82       87       +5     
  Lines        7105     7251     +146     
==========================================
+ Hits         6758     6898     +140     
- Misses        347      353       +6     
Files Coverage Δ
src/ipc/broad_phase/voxel_size_heuristic.cpp 95.58% <100.00%> (-0.13%) ⬇️
src/ipc/ccd/ccd.cpp 95.53% <100.00%> (-0.16%) ⬇️
src/ipc/ccd/nonlinear_ccd.hpp 100.00% <100.00%> (ø)
src/ipc/ccd/point_static_plane.cpp 86.48% <100.00%> (-0.36%) ⬇️
...c/ipc/collisions/collision_constraints_builder.cpp 94.30% <ø> (-0.02%) ⬇️
src/ipc/utils/eigen_ext.hpp 100.00% <100.00%> (ø)
src/ipc/utils/interval.cpp 100.00% <100.00%> (ø)
src/ipc/utils/interval.hpp 100.00% <100.00%> (ø)
src/ipc/ccd/nonlinear_ccd.cpp 95.31% <95.31%> (ø)

@zfergus
zfergus merged commit 5370866 into main Oct 23, 2023
@zfergus
zfergus deleted the nonlinear-ccd branch October 23, 2023 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant