7.5.3rosidl_generate_interfaces报错
-
构建空间报错代码:
tingbo@DESKTOP-NHH5E05:~/chapt7/chapt7_ws$ colcon build Starting >>> autopatrol_interfaces Starting >>> autopatrol_robot Starting >>> fishbot_application Starting >>> fishbot_description Starting >>> fishbot_navigation2 Finished <<< fishbot_description [0.53s] Finished <<< fishbot_navigation2 [0.53s] Finished <<< fishbot_application [1.02s] Finished <<< autopatrol_robot [1.04s] --- stderr: autopatrol_interfaces CMake Error at CMakeLists.txt:10 (find_package): By not providing "Findrosidl_generate_interfaces.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "rosidl_generate_interfaces", but CMake did not find one. Could not find a package configuration file provided by "rosidl_generate_interfaces" with any of the following names: rosidl_generate_interfacesConfig.cmake rosidl_generate_interfaces-config.cmake Add the installation prefix of "rosidl_generate_interfaces" to CMAKE_PREFIX_PATH or set "rosidl_generate_interfaces_DIR" to a directory containing one of the above files. If "rosidl_generate_interfaces" provides a separate development package or SDK, be sure it has been installed. --- Failed <<< autopatrol_interfaces [1.40s, exited with code 1] Summary: 4 packages finished [1.65s] 1 package failed: autopatrol_interfaces 1 package had stderr output: autopatrol_interfaces
SpeachText.srv代码:
string text --- bool result
CmakeLists.txt代码:
cmake_minimum_required(VERSION 3.8) project(autopatrol_interfaces) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) find_package(rosidl_generate_interfaces REQUIRED) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) # the following line skips the linter which checks for copyrights # comment the line when a copyright and license is added to all source files set(ament_cmake_copyright_FOUND TRUE) # the following line skips cpplint (only works in a git repo) # comment the line when this package is in a git repo and when # a copyright and license is added to all source files set(ament_cmake_cpplint_FOUND TRUE) ament_lint_auto_find_test_dependencies() endif() rosidl_generate_interfaces(${PROJECT_NAME} "srv/SpeachText.srv" ) ament_package()
package.xml代码:
<?xml version="1.0"?> <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> <package format="3"> <name>autopatrol_interfaces</name> <version>0.0.0</version> <description>TODO: Package description</description> <maintainer email="tingbo01@qq.com">tingbo</maintainer> <license>Apache-2.0</license> <buildtool_depend>ament_cmake</buildtool_depend> <depend>rosidl_generate_interfaces</depend> <member_of_group>rosidl_interface_packages</member_of_group> <test_depend>ament_lint_auto</test_depend> <test_depend>ament_lint_common</test_depend> <export> <build_type>ament_cmake</build_type> </export> </package>