How orocos/orocos_kinematics_dynamics works
Project type and purpose
• This is a domain-specific library project, not a client/server or full-stack app.
• The core is a RealTime-capable C++ kinematics and dynamics library (orocos_kdl), complemented by Python bindings (python_orocos_kdl).
• It targets robotics applications (ROS/catkin integration), providing forward/inverse kinematic solvers, motion representations, trajectory planning, and utilities.
File structure
• Top level:
• .github/, CI and Dependabot configs
• CHANGELOG.md, README.md
• orocos_kdl/: C++ core library
• python_orocos_kdl/: Python bindings via Pybind11
• orocos_kdl:
• CMakeLists.txt + cmake/ modules → build configuration, dependency checks (Eigen3, PkgConfig)
• src/ → core namespaces, modules for chains, frames, jacobians, solvers, trajectories, utilities
• models/, examples/ → demonstration code
• doc/ → Doxygen and LaTeX user manual
• tests/ → unit tests group by functionality
• debian/, packaging manifests → Debian and ROS packaging
• python_orocos_kdl:
• CMakeLists.txt, pybind11/ → binding configuration
• PyKDL/ → C++ wrapper code mapping core API to Python
• doc/, tests/ → Sphinx docs and pytest suites
• package.xml, rosdoc.yaml → ROS integration
Key README insights
• Emphasizes the importance of matching C++ and Python versions
• Recommends ROS/catkin installation
• Clarifies there will be no ROS Noetic release
Main components
a. C++ Core Library (orocos_kdl)
• Modules: Chain/Multi-body structures, Solvers (FK, IK, dynamics), Path & Trajectory, Frames & Transforms, Utilities (SVD, inertia)
• Build system: CMake + custom cmake/Find*.cmake scripts
• Packaging targets: Debian, ROS/catkin
b. Python Bindings (python_orocos_kdl)
• Pybind11 layer (pybind11/)
• Wrapper code (PyKDL/)
• Sphinx documentation
• Python test harness
c. External dependencies
• Eigen3 linear algebra, STL
• PkgConfig
• (Optional) ROS/catkin
d. Supporting artifacts
• Examples & Models (C++, MATLAB)
• Documentation (Doxygen, LaTeX, Sphinx)
• CI & Release (GitHub Actions, Dependabot)
Relationships and interactions
• The build pipeline (CMake) pulls in external libs (Eigen, PkgConfig), configures/compiles the core.
• The Python build invokes CMake, uses Pybind11 to wrap C++ symbols.
• At runtime: Python user calls functions → PyKDL layer → C++ core API → internal modules compute kinematics/dynamics → results flow back up.
• Examples link directly against the C++ core; ROS nodes or catkin packages may consume both libraries.
• Tests validate each module in isolation (unit tests) and cross-language integration (Python tests).
Architectural patterns and design principles
• Modular monolith: clear separation by functionality (chains, solvers, paths, utilities).
• Layered abstraction:
• Low-level math/utility → core algorithms → user APIs → Python wrapper/ROS interface → end applications.
• Build-time dependency injection using CMake and pkg‐config.
• Extensibility via well-defined C++ headers and namespace organization.