ROS学习笔记(9)进一步深入了解ROS第三步

0.前提

1. (C++)Why did you include the header file of the message file instead of the message file itself?(为包含消息的头文件而不是消息本身?)

回答:msg文件是描述ROS消息字段的文本文件,用于生成不同语言消息的源代码。按官方给的描述,我理解为在编译时要将文本文件转换成源代码,在将他包含进rospy或者roscpp,而直接包含消息本身就无法转换成源代码。

本题答案来源官方文档:ROS/Tutorials/CreatingMsgAndSrv - ROS中文Wiki

2. (Python & C++)In the documentation of the LaserScan message there was also a data type called Header header. What is that? Can you also include it in your message file? What information does it provide? Include Header in your message file too.(在LaserScan消息描述里面有包含叫Header header的消息类型,这是啥?能将他包含进自己的消息文件吗?将他包含进自己的消息文件的话有什么效果?)

1.In the documentation of the LaserScan message there was also a data type called Header header. What is that?(在LaserScan消息描述里面有包含叫Header header的消息类型,这是啥?)

回答:官方文档给出的解释ROS提供了特殊的Header类型,提供了通用机制,在std_msgs/msg/Header.msg(以#include “std_msgs/Header.h”被调用)中被定义。

在这里有别人给出的挺好的定义:ROS中自定义带有header的消息文件_ros header-CSDN博客

2.Can you also include it in your message file?(能将他包含进自己的消息文件吗?)

回答:能,类似于这样:

这里转载自:ros 导入自定义msg文件 配置_怎么把自定义的msg放入rosmsg中-CSDN博客

3.What information does it provide? Include Header in your message file too.(将他包含进自己的消息文件的话有什么效果?)

回答:msg文件包含嘛。

3.答案来源

本题答案来源官方文档:msg - ROS Wiki

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值