小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
在自定义服务环节出现了问题,求解决!
-
-
BorrowMoney.srv
String name uint32 money --- bool success uint32 money
-
cmake_minimum_required(VERSION 3.5)
project(village_interfaces)Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()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(sensor_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)uncomment the following section in order to fill in
further dependencies manually.
find_package(<dependency> REQUIRED)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)the following line skips the linter which checks for copyrights
uncomment the line when a copyright and license is not present in all source files
#set(ament_cmake_copyright_FOUND TRUE)
the following line skips cpplint (only works in a git repo)
uncomment the line when this package is not in a git repo
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()rosidl_generate_interfaces(${PROJECT_NAME}
"msg/Novel.msg"
"srv/BorrowMoney.srv"
DEPENDENCIES sensor_msgs
)ament_package()
-
<?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>village_interfaces</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ning@todo.todo">ning</maintainer>
<license>TODO: License declaration</license><buildtool_depend>ament_cmake</buildtool_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> -
@JerryNing 在 在自定义服务环节出现了问题,求解决! 中说:
BorrowMoney.srv
String name uint32 money --- bool success uint32 money
srtring name
String 小写的