当前位置:网站首页>ROS learning notes (5) -- Exploration of customized messages

ROS learning notes (5) -- Exploration of customized messages

2022-06-26 08:38:00 Yu Getou

This blog is mainly used for pit drainage

1. The data type defined by the message

Be sure to add the number of data digits when defining , Such as float type Should be written as float32

2. The same message can be used in multiple function packs , There's no need to redefine

example : stay A Function package call B Messages in the Feature Pack
1. modify A The feature pack package.xml

# Add the following statement
<build_depend>b_package</build_depend>
<build_export_depend>b_package</build_export_depend>
<exec_depend>b_package</exec_depend>

2. modify A The feature pack CmakeList.txt

# modify find_packge
find_package(catkin REQUIRED … b_package)
# Uncomment the following statement
include_directories(
include
${catkin_INCLUDE_DIRS}
)

3. compile B Function pack

catkin_make -DCATKIN_WHITELIST_PACKAGES='b_package'

4. Global compilation

catkin_make -DCATKIN_WHITELIST_PACKAGES=''

After the above steps , You can go to A The corresponding message file is introduced into the function package

#include "b_package/xxx.msg"
原网站

版权声明
本文为[Yu Getou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170556033051.html