重要提示
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
未解决 服务接口报错
-
CMake Error at /opt/ros/humble/share/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake:77 (message):
ament_target_dependencies() the passed package name 'test_serivce_rclcpp'
was not found before
Call Stack (most recent call first):
CMakeLists.txt:22 (ament_target_dependencies)
CMakeLists.txt文件如下配置:
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(test_serivce_rclcpp REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}
"srv/CheckFloat.srv"
)add_executable(check_float_client src/check_float_client.cpp)
target_include_directories(check_float_client PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_compile_features(check_float_client PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
ament_target_dependencies(
check_float_client
"rclcpp"
"test_serivce_rclcpp"
)install(TARGETS check_float_client
DESTINATION lib/${PROJECT_NAME})add_executable(check_float_server src/check_float_server.cpp)
target_include_directories(check_float_server PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_compile_features(check_float_server PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17ament_target_dependencies(
check_float_server
"rclcpp"
"test_serivce_rclcpp"
)install(TARGETS check_float_server
DESTINATION lib/${PROJECT_NAME})
package.xml如下:<buildtool_depend>ament_cmake</buildtool_depend>
<depend>rclcpp</depend>
<depend>example_ros2_interfaces</depend><test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend><export>
<build_type>ament_cmake</build_type>
</export>
报错
-
@3279725327 这个我遇到过好像是你的接口驱动的问题
-
@3279725327 尝试更新下电脑上板子的驱动程序
-
@867975819 怎么更新呢
-
@867975819 解决好久一直没找到解决方法