ROS2 LD19 Lidar problem with spdlog

I’m having problems with the LD19 and ROS2 SDK running on ARM-based CPU, however, it works on Intel Ubuntu 22.04

unfortunately, i’m not an expert on C++ and web searches didn’t reveal ROS2 fixes. the spdlog package is installed.

Is this something you can help me with?


CMake Error at /opt/ros/humble/share/rcl_logging_spdlog/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package):
  By not providing "Findspdlog.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "spdlog", but
  CMake did not find one.

  Could not find a package configuration file provided by "spdlog" with any
  of the following names:

    spdlogConfig.cmake
    spdlog-config.cmake

  Add the installation prefix of "spdlog" to CMAKE_PREFIX_PATH or set
  "spdlog_DIR" to a directory containing one of the above files.  If "spdlog"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  /opt/ros/humble/share/rcl_logging_spdlog/cmake/rcl_logging_spdlogConfig.cmake:41 (include)
  /opt/ros/humble/share/rcl/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/humble/share/rcl/cmake/rclConfig.cmake:41 (include)
  /opt/ros/humble/share/libstatistics_collector/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/humble/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)
  /opt/ros/humble/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/humble/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
  CMakeLists.txt:20 (find_package)

From the error message you provided, CMake cannot find the configuration file for the spdlog package, even though you’ve already installed the spdlog package. Here are several methods that might help you solve this problem:

1. Confirm the spdlog installation path

Make sure that spdlog is installed correctly and its installation path is added to CMAKE_PREFIX_PATH. You can follow these steps:

Find the spdlog installation path

Use the following command to find the installation location of spdlog:

find / -name "spdlogConfig.cmake" 2>/dev/null

If you find the spdlogConfig.cmake file, record the directory where it is located.

Set CMAKE_PREFIX_PATH

Add the installation path of spdlog to CMAKE_PREFIX_PATH and then re - run CMake:

export CMAKE_PREFIX_PATH=/path/to/spdlog:$CMAKE_PREFIX_PATH

Replace /path/to/spdlog with the directory where you found the spdlogConfig.cmake file. Then run CMake again:

cmake ..

2. Use the spdlog_DIR variable

You can also directly set the spdlog_DIR variable to let CMake know where to find the spdlog configuration file:

cmake -Dspdlog_DIR=/path/to/spdlog ..

Similarly, replace /path/to/spdlog with the directory where the spdlogConfig.cmake file is located.

3. Re - install spdlog

If the above methods don’t work, you can try to reinstall spdlog:

Install using the package manager

If you’re using a Debian or Ubuntu - based system, you can use the following command to install spdlog:

sudo apt-get install libspdlog-dev

Install from source code

You can also download the source code from the spdlog GitHub repository and then compile and install it:

git clone https://github.com/gabime/spdlog.git
cd spdlog
mkdir build
cd build
cmake ..
sudo make install

4. Check the ROS2 environment

Ensure that your ROS2 environment is configured correctly and all dependencies are installed. You can update the ROS2 dependencies with the following commands:

sudo apt-get update
sudo apt-get install ros-humble-desktop

By following the above steps, you should be able to solve the problem of CMake not finding the spdlog configuration file. If the problem still persists, please provide more error information and system environment details for further troubleshooting.