How woolfrey/software_robot_library works
Project Type and Purpose
• RobotLibrary is a modular C++ library (not a networked application) that provides building blocks for robotic modeling, trajectory generation, and control.
File Structure Analysis
• Top-level: CMakeLists.txt, Config.cmake.in, LICENSE, README.md
• Subdirectories Control/, Math/, Model/, Trajectory/, each containing:
• CMakeLists.txt (build configuration)
• README.md (purpose, interfaces)
• /… (public headers under Control/, Math/, etc.)
• src/… (implementation .cpp files)
• External dependency: Eigen3 (for linear algebra) and tinyxml2 within Model for URDF parsing.
Insights from README
• Control builds on Model (kinematic tree) and Math (splines, polynomials).
• Model uses Math for numeric routines.
• Trajectory uses Math for smooth path generation.
• The library is consumed by client executables (examples or ROS2 packages) that link against RobotLibrary and Eigen.
a. Main Components
• Build System (CMake): orchestrates compilation of each module into a single RobotLibrary target.
• Math Module: low-level functions and data structures (polynomials, skew symmetric matrices, splines).
• Model Module: rigid-body and joint representations, kinematic tree, URDF parsing (tinyxml2).
• Trajectory Module: trajectory base class, polynomial splines, Cartesian splines, trapezoidal velocity profiles.
• Control Module: base controller class (SerialLinkBase), concrete velocity control (SerialKinematicControl).
• External Libraries:
• Eigen3 (linear algebra)
• (Embedded) tinyxml2 in Model
• Consumers: example executables, ROS2 action servers (external to this codebase).
b. Relationships and Data Flow
• Math module sits at the bottom layer.
• Trajectory is orthogonal but can be used by Control (not enforced by build, but possible at runtime).
• Build System coordinates all sub-modules into one library artifact.
• Clients (examples, ROS2 nodes) link RobotLibrary::RobotLibrary and Eigen3::Eigen.
c. Architectural Patterns
• Layered architecture: core utilities (Math) → domain model (Model) → application logic (Trajectory, Control).
• Modular design: each sub-library compiles independently with its own public include directory.
• Inheritance/Polymorphism: TrajectoryBase, SerialLinkBase provide extension points.
d. Key Technologies
• C++17 (language standard)
• CMake (build configuration, find_package for Eigen3 and RobotLibrary)
• eigen3-dev (external linear algebra)
• tinyxml2 (embedded in Model for URDF)
Detail
• That CMakeLists.txt at the root includes subdirectories for each module and installs a single RobotLibrary target.