StoglRobotics / ros_team_workspace

RosTeamWorkspace is a framework for boosting collaboration in teams when developing software for robots using Robot Operating System (ROS1 and ROS2).
https://rtw.stoglrobotics.de
Apache License 2.0
79 stars 17 forks source link

CMake Error: Cannot find package ament_gmock #194

Open MoonBite666 opened 3 months ago

MoonBite666 commented 3 months ago

After setting up the robot controller using the rtw command: ros2_control_setup-hardware-interface-package dofbot_hardware DofHW and inputing some information, the colcon build gives a CMake Error:

CMake Error at CMakeLists.txt:10 (find_package):
  By not providing "Findament_gmock.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_gmock", but CMake did not find one.

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

    ament_gmockConfig.cmake
    ament_gmock-config.cmake

  Add the installation prefix of "ament_gmock" to CMAKE_PREFIX_PATH or set
  "ament_gmock_DIR" to a directory containing one of the above files.  If
  "ament_gmock" provides a separate development package or SDK, be sure it
  has been installed.

the apt shows that I have downloaded ros gmock.

ros-humble-ament-cmake-gmock/jammy,now 1.3.8-1jammy.20240217.024747 amd64 [已安装,自动]
  The ability to add Google mock-based tests in the ament buildsystem in CMake.

ros-humble-gmock-vendor/jammy,now 1.10.9004-4jammy.20240217.024718 amd64 [已安装,自动]
  The package provides GoogleMock.

Is there any missing packages?

mamueluth commented 2 months ago

its probably not in the package.xml have to check the generation scripts

eholandcmu commented 2 months ago

I have the same issue. A temporary fix was to comment out the if(BUILD_TESTING) section/ in CMakeLists.txt. This allows the package to build, but I imagine it is not an ideal solution as you lose that functionality.