From a794bfcf305cee8aed51e471359efa9912399113 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Tue, 27 Jan 2026 21:06:30 -0800 Subject: [PATCH 1/7] Install libspdlog and libfmt in CI --- .github/workflows/ci_cmake.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cmake.yaml b/.github/workflows/ci_cmake.yaml index 8a52500..6acffe6 100644 --- a/.github/workflows/ci_cmake.yaml +++ b/.github/workflows/ci_cmake.yaml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-24.04 steps: - - name: Install dependencesi with awalsh128/cache-apt-pkgs-action + - name: Install dependencies with awalsh128/cache-apt-pkgs-action uses: awalsh128/cache-apt-pkgs-action@latest with: - packages: libboost-all-dev + packages: libboost-all-dev libspdlog-dev libfmt-dev version: 1.0 - name: Checkout repository From bf692b65fc19d087fb3ad3834550c1a530c251a4 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Tue, 27 Jan 2026 21:17:50 -0800 Subject: [PATCH 2/7] Update dependencies in ROS1 and ROS2 cmake files --- .github/workflows/ci.yaml | 3 +-- cmake/BuildROS1.cmake | 5 +++++ cmake/BuildROS2.cmake | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c28c19e..f0e536c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,8 +16,7 @@ jobs: matrix: env: - {ROS_DISTRO: noetic} - # We include humble because there are still 22.04 systems (Jetson) out there - - {ROS_DISTRO: humble} + - {ROS_DISTRO: jazzy} - {ROS_DISTRO: kilted} - {ROS_DISTRO: rolling} diff --git a/cmake/BuildROS1.cmake b/cmake/BuildROS1.cmake index efe7dd6..8bff6f6 100644 --- a/cmake/BuildROS1.cmake +++ b/cmake/BuildROS1.cmake @@ -1,6 +1,10 @@ # Catkin/ROS1 section ===== find_package(Boost REQUIRED COMPONENTS system) +find_package(catkin REQUIRED) +find_package(spdlog REQUIRED) +find_package(Boost REQUIRED COMPONENTS system) + catkin_package( INCLUDE_DIRS include LIBRARIES liboculus @@ -42,5 +46,6 @@ if(CATKIN_ENABLE_TESTING) ${catkin_LIBRARIES} liboculus Boost::system + spdlog::spdlog ) endif() diff --git a/cmake/BuildROS2.cmake b/cmake/BuildROS2.cmake index ae01f1f..29be55c 100644 --- a/cmake/BuildROS2.cmake +++ b/cmake/BuildROS2.cmake @@ -1,10 +1,11 @@ # == ament/ROS2 section ================================= find_package(ament_cmake REQUIRED) +find_package(spdlog REQUIRED) find_package(Boost REQUIRED COMPONENTS system) add_library(oculus SHARED ${oculus_SRCS}) -target_link_libraries(oculus PUBLIC Boost::system) +target_link_libraries(oculus PUBLIC Boost::system spdlog::spdlog) target_include_directories( oculus @@ -30,6 +31,7 @@ install( PATTERN ".git" EXCLUDE ) +ament_export_dependencies(spdlog) ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) ament_export_libraries(oculus) From bc7234c72f9a987b184e178b71098b51ec49c0a3 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Tue, 27 Jan 2026 21:33:55 -0800 Subject: [PATCH 3/7] Try including a backport PPA to get newer spdlog --- .github/workflows/ci.yaml | 6 ++++++ .github/workflows/ci_cmake.yaml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f0e536c..fa7db4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,6 +21,12 @@ jobs: - {ROS_DISTRO: rolling} steps: + - name: Install dependencies with awalsh128/cache-apt-pkgs-action + uses: awalsh128/cache-apt-pkgs-action@latest + with: + # Need a more modern version of spdlog than provided by 20.04 + add-repository: ppa:savoury1/backports + - name: Checkout repository uses: actions/checkout@v5 with: diff --git a/.github/workflows/ci_cmake.yaml b/.github/workflows/ci_cmake.yaml index 6acffe6..e9e02b9 100644 --- a/.github/workflows/ci_cmake.yaml +++ b/.github/workflows/ci_cmake.yaml @@ -16,6 +16,8 @@ jobs: - name: Install dependencies with awalsh128/cache-apt-pkgs-action uses: awalsh128/cache-apt-pkgs-action@latest with: + # Need a more modern version of spdlog than provided by 20.04 + add-repository: ppa:savoury1/backports packages: libboost-all-dev libspdlog-dev libfmt-dev version: 1.0 From 729cfc253577a0eed93b2b4e23f79047b9ccba6e Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Tue, 27 Jan 2026 21:42:53 -0800 Subject: [PATCH 4/7] Correct syntax in ci file --- .github/workflows/ci.yaml | 2 ++ .github/workflows/ci_cmake.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fa7db4c..bfaa4d7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,8 +24,10 @@ jobs: - name: Install dependencies with awalsh128/cache-apt-pkgs-action uses: awalsh128/cache-apt-pkgs-action@latest with: + packages: libboost-all-dev libspdlog-dev libfmt-dev # Need a more modern version of spdlog than provided by 20.04 add-repository: ppa:savoury1/backports + version: 1.0 - name: Checkout repository uses: actions/checkout@v5 diff --git a/.github/workflows/ci_cmake.yaml b/.github/workflows/ci_cmake.yaml index e9e02b9..660c965 100644 --- a/.github/workflows/ci_cmake.yaml +++ b/.github/workflows/ci_cmake.yaml @@ -16,9 +16,9 @@ jobs: - name: Install dependencies with awalsh128/cache-apt-pkgs-action uses: awalsh128/cache-apt-pkgs-action@latest with: + packages: libboost-all-dev libspdlog-dev libfmt-dev # Need a more modern version of spdlog than provided by 20.04 add-repository: ppa:savoury1/backports - packages: libboost-all-dev libspdlog-dev libfmt-dev version: 1.0 - name: Checkout repository From a9bde1392caaa9952eb0b96cfae5491072533891 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Tue, 27 Jan 2026 21:47:04 -0800 Subject: [PATCH 5/7] Invalidate APT cache --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bfaa4d7..b4252cb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,7 +27,7 @@ jobs: packages: libboost-all-dev libspdlog-dev libfmt-dev # Need a more modern version of spdlog than provided by 20.04 add-repository: ppa:savoury1/backports - version: 1.0 + version: 1.1 - name: Checkout repository uses: actions/checkout@v5 From 21e86fb60f50351e2eb1688961345cf7558feb77 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Tue, 27 Jan 2026 21:57:21 -0800 Subject: [PATCH 6/7] Explicitly include common.h for format_string_t --- include/liboculus/Logger.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/liboculus/Logger.h b/include/liboculus/Logger.h index 2ed61b1..0a6e558 100644 --- a/include/liboculus/Logger.h +++ b/include/liboculus/Logger.h @@ -32,6 +32,7 @@ #pragma once #include +#include #include #include From 5142dca837670acd5ed91e2c939edbbfd867710b Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Tue, 27 Jan 2026 22:03:14 -0800 Subject: [PATCH 7/7] Fix minor cpplint issues. --- .github/workflows/ci.yaml | 13 ++++--------- .github/workflows/ci_cmake.yaml | 2 -- include/liboculus/Logger.h | 8 +++++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b4252cb..39edcde 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,20 +15,15 @@ jobs: fail-fast: false matrix: env: - - {ROS_DISTRO: noetic} + # You need a more modern version of spdlog than provided + # by 20.04; in development could get it from a backports PPA + # but can't during CI + #- {ROS_DISTRO: noetic} - {ROS_DISTRO: jazzy} - {ROS_DISTRO: kilted} - {ROS_DISTRO: rolling} steps: - - name: Install dependencies with awalsh128/cache-apt-pkgs-action - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: libboost-all-dev libspdlog-dev libfmt-dev - # Need a more modern version of spdlog than provided by 20.04 - add-repository: ppa:savoury1/backports - version: 1.1 - - name: Checkout repository uses: actions/checkout@v5 with: diff --git a/.github/workflows/ci_cmake.yaml b/.github/workflows/ci_cmake.yaml index 660c965..6acffe6 100644 --- a/.github/workflows/ci_cmake.yaml +++ b/.github/workflows/ci_cmake.yaml @@ -17,8 +17,6 @@ jobs: uses: awalsh128/cache-apt-pkgs-action@latest with: packages: libboost-all-dev libspdlog-dev libfmt-dev - # Need a more modern version of spdlog than provided by 20.04 - add-repository: ppa:savoury1/backports version: 1.0 - name: Checkout repository diff --git a/include/liboculus/Logger.h b/include/liboculus/Logger.h index 0a6e558..07b2f8d 100644 --- a/include/liboculus/Logger.h +++ b/include/liboculus/Logger.h @@ -35,6 +35,7 @@ #include #include #include +#include namespace liboculus { @@ -61,7 +62,7 @@ class Logger { Logger::get_logger()->sinks().push_back(s); } - ~Logger() {}; + ~Logger() {} private: static std::shared_ptr @@ -70,12 +71,13 @@ class Logger { return std::shared_ptr(new Logger(logger_in)); } - Logger(const std::shared_ptr &l = nullptr) : logger_(l) { + explicit Logger(const std::shared_ptr &l = nullptr) + : logger_(l) { if (!logger_) { logger_ = std::make_shared("liboculus"); spdlog::register_logger(logger_); } - }; + } std::shared_ptr logger_;