Convert sas_core to a thin wrapper around sas_cpp (.deb) + sas_py (PyPI) - #12
Conversation
…PyPI) The C++ implementation (src/*.cpp), the pybind11 bindings and the pybind11 submodule no longer live in this package. Instead: - C++: depends on the libmarinholab-sas-core .deb (source: MarinhoLab/sas_cpp), which provides libmarinholab_sas_core, the headers and the CMake package config (find_package(marinholab_sas_core)). include/sas_core/*.hpp are now one-line compatibility shims that forward to include/marinholab/sas/core/*.hpp and re-alias the legacy namespace sas, and the ament target 'sas_core' forwards to marinholab::sas::core so downstream ament_target_dependencies(...) keeps working. - Python: sas_core/__init__.py is a pure-Python shim re-exporting Clock/Statistics/RobotDriver/ShutdownSignaler from the PyPI package marinholab-sas-core (MarinhoLab/sas_py), so 'from sas_core import Clock' keeps working. - docker/: the environment now installs marinholab-sas-core from PyPI and, until the .deb is published to an apt repository, builds the libmarinholab-sas-core .deb from MarinhoLab/sas_cpp (tag 26.09) inside the image and installs it. dqrobotics (C++ and Python) is already in the base image, so no PPA step is needed. - docker/compose.yml + docker/smoke_test.sh + scripts/sas_core_smoke_test.py verify the whole chain: colcon build, the Python shim, a CMake consumer probe (find_package + link + run) and a consumer of the legacy C++ include path/namespace. Verified end-to-end in the docker environment (arm64 base image).
|
CI note (external blocker): the The fix + required republish (new version) are documented at MarinhoLab/sas_py#4. Once the complete wheel set is on PyPI, re-run the |
What this does
Converts
sas_corefrom a self-contained package (C++ sources + pybind11 bindings inlined) into a thin wrapper around the two packages that now own the core:libmarinholab-sas-core.deb(targetmarinholab::sas::core)marinholab-sas-coreon PyPI (marinholab.sas.core)Changes
Removed:
src/*.cpp(core + examples),src/*_py.cpp(pybind11 bindings), thepybind11submodule,cmake/cpplib.cmake+cmake/pythonlib.cmake,.gitmodules.C++ compatibility shims —
include/sas_core/*.hppare now one-line forwards:So downstream code keeps working unchanged:
#include <sas_core/sas_object.hpp>,namespace sas, andament_target_dependencies(<pkg> sas_core ...)(the ament targetsas_coreis an INTERFACE forwarding tomarinholab::sas::core+Eigen3::Eigen, with both exported viaament_export_dependencies).Python compatibility shim —
sas_core/__init__.pyre-exportsClock, Statistics, RobotDriver, ShutdownSignalerfrommarinholab.sas.core, sofrom sas_core import Clock(used e.g. bysas_datalogger) keeps working.docker environment (per the agreed plan):
pip install marinholab-sas-core(PyPI bindings).debis published to an apt repo: clonesMarinhoLab/sas_cppat tag26.09and runsdpkg-buildpackage+dpkg -iinside the image (architecture-agnostic;dqroboticsC++/Python is already in the base image, so no PPA step) — a marked comment shows the one-line replacement for the end stateapt-get remove ros-jazzy-sas-coreso the legacy package in the base image doesn't shadow the wrapperVerification —
docker/compose.ymlnow runsdocker/smoke_test.sh:colcon buildof the wrapperscripts/sas_core_smoke_test.py: Python shim identity + a runningClock, and a CMake consumer probe (real project:find_package(marinholab_sas_core)→ link → run)#include <sas_core/sas_clock.hpp>+namespace sasagainst the installed libraryVerified end-to-end
Ran
docker compose build && docker compose upin the docker environment (arm64 base imagemurilomarinho/sas:jazzy) — all three checks pass, container exits 0. The repo's existing CI (.github/workflows/build.ymlalready runsdocker compose build+docker compose up) re-verifies this on amd64.Follow-ups (out of scope here)
.debis published to an apt repository (the separate.debtask), replace the in-image build block indocker/Dockerfilewithapt-get install -y libmarinholab-sas-core(marked in a comment).MarinhoLab/sas_cpp(-DMARINHO_LAB_SAS_CORE_BUILD_EXAMPLES=ON); Python examples remain inscripts/.This pull request was created by an AI agent (OpenHands) on behalf of the repository owner.