- C++ Library: High-performance, header-only implementation of Cosserat rod equations for TDCRs, including physics-based modeling and a shooting method for solving boundary value problems (BVP).
- Python Bindings: Lightweight
pybind11
interface for using the C++ library in Python with native performance. - PyTorch Implementation: Differentiable physics-based model built in PyTorch, featuring RK4-based shooting and Newton-Raphson optimization for BVPs. Includes NumPy wrappers for use with SciPy’s BVP solver.
First clone the repository
Required for C++ Library:
- CMake ≥ 3.30
- C++17 compatible compiler (e.g.,
g++
,clang++
) - Blaze Library – Header-only linear algebra
- LAPACK – Linear Algebra Package
- openBLAS – Basic Linear Algebra Subprograms
cd repo-name
mkdir build && cd build
cmake .. -DBUILD_PYBIND=OFF
make -j
cd repo-name
mkdir build && cd build
cmake .. -DBUILD_PYBIND=ON
make -j
sudo make install
This builds tdcr_physics.so
, which can be imported into Python.
python3 -m venv venv
source venv/bin/activate
pip install -e .
TDCR_Cosserat_Rod_Model/
├── CMakeLists.txt # Build configuration
├── lib_tdcr/ # C++ core library
├── pybindings/ # pybind11 bindings
├── python/ # PyTorch implementation
├── examples/ # Example use cases
├── setup.py # Python package setup script
└── README.md
- Rucker, D. Caleb, and Robert J. Webster III. "Statics and dynamics of continuum robots with general tendon routing and external loading." IEEE Transactions on Robotics 27.6 (2011): 1033-1044.
- Till, John, Vincent Aloi, and Caleb Rucker. "Real-time dynamics of soft and continuum robots based on Cosserat rod models." The International Journal of Robotics Research 38.6 (2019): 723-746.
- Adapted in part from Filipe Pedrosa’s original codebase.