Development Guide
Guide for contributing to EmbodiK and developing with the source code.
Development Setup
Clone Repository
Install in Development Mode
This installs: - EmbodiK in editable mode - Development dependencies (pytest, black, isort, etc.)
Build from Source
Project Structure
embodik/
├── cpp_core/ # C++ core library
│ ├── include/ # Header files
│ └── src/ # Source files
├── python/ # Python package
│ └── embodik/ # Package source
├── python_bindings/ # Nanobind bindings
│ └── src/ # Binding code
├── examples/ # Example scripts
├── test/ # Test suite
├── docs/ # Documentation
└── CMakeLists.txt # CMake configuration
Building
Using CMake (Direct)
Using pip (Recommended)
Testing
Run the test suite:
# Run all tests
pytest
# Run specific test file
pytest test/test_robot_model.py
# Hardware-style seed recovery (joint limits + self-collision)
pytest test/test_hardware_seed_recovery.py
# Run with coverage
pytest --cov=embodik --cov-report=html
See Recovery robustness for how joint-limit recovery, collision constraints, and the stall handler interact when q comes from hardware.
Code Style
EmbodiK follows PEP 8 for Python code:
Documentation
Building Documentation
# Install docs dependencies
pip install mkdocs-material mkdocstrings[python]
# Serve locally
mkdocs serve
# Build static site
mkdocs build
Writing Documentation
- API documentation is auto-generated from docstrings
- Add docstrings to all public functions and classes
- Use NumPy-style docstrings for consistency
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Add tests for new functionality
- Ensure all tests pass:
pytest - Format code:
black . && isort . - Submit a pull request
Release Process
- Update version in
pyproject.toml - Update
CHANGELOG.md - Create git tag:
git tag v0.1.0 - Push tag:
git push origin v0.1.0 - GitHub Actions will build and publish to PyPI
Debugging
C++ Extension Issues
If the C++ extension fails to load:
CMake Debugging
Enable verbose CMake output:
Questions?
- Open an issue on GitHub
- Check existing documentation
- Review example code in
examples/