当前位置:网站首页>ROS knowledge points - definition and use of topic messages
ROS knowledge points - definition and use of topic messages
2022-06-28 15:11:00 【Jerry_ Sea】
Reference resources :https://www.guyuehome.com/34659
One 、 Mr Into person.h The header file (1 Definition msg file ;2 stay package.xml Add Feature Pack dependencies to ;3 stay CMakeLists.txt Add compile options ;4 Compile and generate language related files )
Two 、 Then configure the header file (1 establish publisher and subscriber;2CMakeLists.txt Add dependency... To .)
bug1:package.xml
Compile dependencies , Dependent dynamic generation message Function pack message_generation
<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>
stay package.xml The above compile and run dependencies must be written in , Otherwise, the following error will be reported :
catkin_package() DEPENDS on the catkin package ‘message_runtime’ which must therefore be listed as a run dependency in the package.xml
bug2:CMakeLists.txt
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_generation
)
Add compilation dependent function packs message_generation
add_message_files(FILES Person.msg)
generate_messages(DEPENDENCIES std_msgs)
It's a .msg File is compiled into configuration items of different program files ( There is no such sentence ,catkin_make when , stay devel/include The following will not generate .h file ,Person.h)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES learning_msg
CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
# DEPENDS system_lib
)
stay catkin_package() Create run dependencies inside
bug3:catkin_make
msg The first letter of the document should be capitalized ,Person.msg
catkin_make Then it will be under this path devel/include/ Function pack Generate Person.h
bug4:add_dependencies()
add_dependencies(person_publisher ${PROJECT_NAME}_generate_messages_cpp)
Because some code is generated dynamically , So we need to make the executable file and the dynamically generated program have dependencies , This sentence is used to follow the passage just now .msg File generated header file (person.h) To make links . This sentence must be added to link to a custom message .
bug5: Again catkin_make Report errors
This is because the header file function package referenced in the directly copied code is named learning_topic, So change two cpp The content is as follows :
#include "learning_msg/Person.h"
And it corresponds to learning_topic:: It should also be changed to learning_msg::
边栏推荐
- 一文教你快速生成MySQL数据库关系图
- Express template engine
- Setsql function and risk of using lamdbaupdatewrapper
- Vector explanation + topic
- 老板嘱咐了三遍:低调、低调、低调
- QQ被盗号后群发黄图,大批用户“社死”
- ROS知识点——话题消息的定义与使用
- 324. swinging sort II: not a simple construction problem
- 成龙和快品牌,谁才是快手的救星?
- R language ggplot2 visualization: use the patchwork package (directly use the plus sign +) to horizontally combine the two ggplot2 visualization results to form a single visualization result graph
猜你喜欢

坐拥1200亿,她又要IPO敲钟了

New offline retail stores take off against the trend, and consumption enthusiasm under the dark cloud of inflation

Steve Jobs of the United States, died; China jobs, sold

S2b2c system website solution for kitchen and bathroom electrical appliance industry: create s2b2c platform Omni channel commercial system

Cross cluster deployment of helm applications using karmada

The boss told me three times: low key, low key, low key

MIPS汇编语言学习-03-循环

Express template engine

猫狗图像数据集上的深度学习模型性能对比

QQ被盗号后群发黄图,大批用户“社死”
随机推荐
不要使用短路逻辑编写 stl sorter 多条件比较
ORACLE中dbms_output.put_line输出问题的解决过程
信创操作系统--麒麟Kylin桌面操作系统 (项目十 安全中心)
spacy教程(持续更新ing...)
【算法篇】刷了两道大厂面试题,含泪 ”重学数组“
[C language] nextday problem
Web worker poll request
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和一个plot函数可视化结果横向组合起来形成最终结果图、将两个可视的组合结果对齐
验证回文串
Oracle11g数据库使用expdp每周进行数据备份并上传到备份服务器
spark sql 生成 json
Innovation and upgrading of supply chain system driven management mode in petrochemical industry and strengthening internal management of enterprises
Li Kou today's question -522 Longest special sequence
C语言学习-19-全排列
GBASE南大通用亮相第六届世界智能大会
High "green premium" of environmental protection products? How far is the low-carbon lifestyle from people
Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform
S2b2c system website solution for kitchen and bathroom electrical appliance industry: create s2b2c platform Omni channel commercial system
With a return of 5000 times, the South African newspaper invested in Tencent to make a province
论文解读(GCC)《Efficient Graph Convolution for Joint Node RepresentationLearning and Clustering》