Skip to content

Continuous-Collision-Detection/CCD-Wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Continuous Collision Detection Wrapper and Benchmark

Build status Benchmark Nightly

A wrapper and benchmark for various continuous collision detection algorithms.

Build

To build the library and executable benchmark on Linux or macOS run:

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4

Dependencies

The system level dependencies vary depending on which methods are enabled. To compile all methods and the benchmark, the following are required:

  • Boost: for interval arithmetic (when interval-based methods are enabled)
  • GMP: for rational numbers arithmetic (used when loading benchmark data)

Eigen and other dependencies will be downloaded through CMake.

Add CCD-Wrapper to your CMake Project

The easiest way to add the CCD-Wrapper to an existing CMake project is to download it through CMake. CMake provides functionality for doing this called FetchContent (requires CMake ≥ 3.14). We use this same process to download all external dependencies. For example,

include(FetchContent)
FetchContent_Declare(
    ccd_wrapper
    GIT_REPOSITORY https://github.com/Continuous-Collision-Detection/CCD-Wrapper
    GIT_TAG ${CCD_WRAPPER_GIT_TAG}
    GIT_SHALLOW FALSE
)
FetchContent_MakeAvailable(ccd_wrapper)

where CCD_WRAPPER_GIT_TAG is set to the version of the wrapper you want to use. This will download and add the CCD wrapper to CMake. The CCD wrapper library can then be linked against using

# Link against the CCD Wrapper
target_link_libraries(${MY_LIB_NAME} PUBLIC ccd_wrapper::ccd_wrapper)

where MY_LIB_NAME is the name of your library (or executable).

Running the Benchmark

To run the benchmark run ccd_benchmark.

For a complete list of benchmark options run ccd_benchmark --help.

By default the benchmark runs on a small subset of CCD queries automatically downloaded to sample-ccd-queries. The full dataset can be found here. Use ccd_benchmark --data </path/to/data> to tell the benchmark where to find the root directory of the dataset. Currently, the dataset directories are hardcoded (e.g., chain, cow-heads, golf-ball, and mat-twist for the simulation dataset).

Visualize Benchmark Queries

We provide a visualization tool in visualization/visualCCD.py for CCD dataset of the paper "A Large Scale Benchmark and an Inclusion-Based Algorithm for Continuous Collision Detection" (https://archive.nyu.edu/handle/2451/61518).

See visualization/readme.txt for more information.

More Methods?

Do you know of a CCD method we are missing? We would love to add it to our wrapper and benchmark. Please submit an issue on GitHub to let us know.