// Versions of advertise()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* \brief Advertise a topic, simple version
*
* This call connects to the master to publicize that the node will be
* publishing messages on the given topic. This method returns a Publisher that allows you to
* publish a message on this topic.
*
* This version of advertise is a templated convenience function, and can be used like so
*
* ros::Publisher pub = handle.advertise<std_msgs::Empty>("my_topic", 1);
*
* \param topic Topic to advertise on
*
* \param queue_size Maximum number of outgoing messages to be
* queued for delivery to subscribers
*
* \param latch (optional) If true, the last message published on
* this topic will be saved and sent to new subscribers when they
* connect
*
* \return On su
gmapping 代码
最新推荐文章于 2023-11-30 23:48:34 发布
本文详细介绍了ROS中用于发布话题的广告函数`advertise`的不同版本,包括简单的广告方式和带有订阅者状态回调的高级选项。这些函数用于连接到主节点,宣布节点将在给定主题上发布消息,并返回一个Publisher对象,允许发布消息。文章提到了模板便利函数和使用场景示例,以及如何设置连接和断开连接的回调函数。

最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



