当前位置: 首页 > news >正文

山东省建设备案网站审批seo自学网

山东省建设备案网站审批,seo自学网,国外网站建设模板,济南网站建设公司哪个好在单个进程中组合多个节点 目录 背景 运行演示 发现可用组件 使用 ROS 服务 (1.) 与发布者和订阅者的运行时组合 使用 ROS 服务 (1.) 与服务器和客户端的运行时组合 使用 ROS 服务的编译时组合 (2.) 使用 dlopen 的运行时组合 使用启动动作组合 高级主题 卸载组件 重新…

在单个进程中组合多个节点

目录

  • 背景

  • 运行演示

    • 发现可用组件

    • 使用 ROS 服务 (1.) 与发布者和订阅者的运行时组合

    • 使用 ROS 服务 (1.) 与服务器和客户端的运行时组合

    • 使用 ROS 服务的编译时组合 (2.)

    • 使用 dlopen 的运行时组合

    • 使用启动动作组合

  • 高级主题

    • 卸载组件

    • 重新映射容器名称和命名空间

    • 重新映射组件名称和命名空间

  • 作为共享库的可组合节点

背景

请参阅概念文章。

运行演示

演示使用来自rclcpp_components、ros2component和组合包的可执行文件,可以使用以下命令运行。

发现可用组件

要查看工作区中已注册和可用的组件,请在 shell 中执行以下命令:

$ ros2 component types
compositioncomposition::Talkercomposition::Listenercomposition::Servercomposition::Client

使用 ROS 服务 (1.) 与发布者和订阅者的运行时组合

在第一个 shell 中,启动组件容器:

ros2 run rclcpp_components component_container

ros2通过命令行工具验证容器是否正在运行:

$ ros2 component list
/ComponentManager

在第二个 shell 中(参见talker源代码)。该命令将返回加载组件的唯一 ID 以及节点名称。

$ ros2 component load /ComponentManager composition composition::Talker
Loaded component 1 into '/ComponentManager' container node as '/talker'

现在,第一个 shell 应该显示一条消息,表明组件已加载,以及用于发布消息的重复消息。

第二个 shell 中的另一个命令(参见监听器源代码):

$ ros2 component load /ComponentManager composition composition::Listener
Loaded component 2 into '/ComponentManager' container node as '/listener'

命令行实用程序ros2现在可用于检查容器的状态:

$ ros2 component list
/ComponentManager1  /talker2  /listener

现在第一个 shell 应该显示每条接收到的消息的重复输出。

使用 ROS 服务 (1.) 与服务器和客户端的运行时组合

服务器和客户端的示例非常相似。

在第一个外壳中:

ros2 run rclcpp_components component_container

在第二个 shell 中(参见服务器和客户端源代码):

ros2 component load /ComponentManager composition composition::Server
ros2 component load /ComponentManager composition composition::Client

在这种情况下,客户端向服务器发送请求,服务器处理请求并回复响应,客户端打印收到的响应。

使用 ROS 服务的编译时组合 (2.)

该演示表明可以重复使用相同的共享库来编译运行多个组件的单个可执行文件。可执行文件包含上面的所有四个组件:说话者和听众以及服务器和客户端。

在 shell 调用中(参见源代码):

ros2 run composition manual_composition

这应该显示来自双方的重复消息,说话者和听众以及服务器和客户端。

笔记

手动组合的组件不会反映在命令行工具输出中。ros2 component list

使用 dlopen 的运行时组合

该演示通过创建通用容器进程并显式传递要加载的库而不使用 ROS 接口来提供 1. 的替代方法。该过程将打开每个库并在库源代码中为每个“rclcpp::Node”类创建一个实例)。

ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so

现在 shell 应该显示每条发送和接收消息的重复输出。

笔记

dlopen 组合的组件不会反映在命令行工具输出中。ros2 component list

使用启动动作组合

虽然命令行工具对于调试和诊断组件配置很有用,但同时启动一组组件通常更方便。要自动执行此操作,我们可以使用 中的功能。ros2 launch

ros2 launch composition composition_demo.launch.py

高级主题

现在我们已经了解了组件的基本操作,我们可以讨论一些更高级的主题。

卸载组件

在第一个 shell 中,启动组件容器:

ros2 run rclcpp_components component_container

ros2通过命令行工具验证容器是否正在运行:

$ ros2 component list
/ComponentManager

在第二个 shell 中(参见talker源代码)。该命令将返回加载组件的唯一 ID 以及节点名称。

$ ros2 component load /ComponentManager composition composition::Talker
Loaded component 1 into '/ComponentManager' container node as '/talker'
$ ros2 component load /ComponentManager composition composition::Listener
Loaded component 2 into '/ComponentManager' container node as '/listener'

使用唯一 ID 从组件容器中卸载节点。

$ ros2 component unload /ComponentManager 1 2
Unloaded component 1 from '/ComponentManager' container
Unloaded component 2 from '/ComponentManager' container

在第一个 shell 中,验证来自 talker 和 listener 的重复消息是否已停止。

重新映射容器名称和命名空间

组件管理器名称和命名空间可以通过标准命令行参数重新映射:

ros2 run rclcpp_components component_container --ros-args -r __node:=MyContainer -r __ns:=/ns

在第二个 shell 中,可以使用更新后的容器名称加载组件:

ros2 component load /ns/MyContainer composition composition::Listener

笔记

Namespace remappings of the container do not affect loaded components.

Remap component names and namespaces

Component names and namespaces may be adjusted via arguments to the load command.

In the first shell, start the component container:

ros2 run rclcpp_components component_container

Some examples of how to remap names and namespaces:

# Remap node name
ros2 component load /ComponentManager composition composition::Talker --node-name talker2
# Remap namespace
ros2 component load /ComponentManager composition composition::Talker --node-namespace /ns
# Remap both
ros2 component load /ComponentManager composition composition::Talker --node-name talker3 --node-namespace /ns2

The corresponding entries appear in ros2 component list:

$ ros2 component list
/ComponentManager1  /talker22  /ns/talker3  /ns2/talker3

Note

Namespace remappings of the container do not affect loaded components.

Composable nodes as shared libraries

If you want to export a composable node as a shared library from a package and use that node in another package that does link-time composition, add code to the CMake file which imports the actual targets in downstream packages.

Then install the generated file and export the generated file.

A practical example can be seen here: ROS Discourse - Ament best practice for sharing libraries


文章转载自:
http://parenthetic.sfwd.cn
http://teraph.sfwd.cn
http://allround.sfwd.cn
http://ranchi.sfwd.cn
http://tephroite.sfwd.cn
http://multifarious.sfwd.cn
http://exteroceptive.sfwd.cn
http://arming.sfwd.cn
http://narcosynthesis.sfwd.cn
http://rookie.sfwd.cn
http://molluscoid.sfwd.cn
http://dimeter.sfwd.cn
http://fastidium.sfwd.cn
http://ophiology.sfwd.cn
http://pyaemic.sfwd.cn
http://atlas.sfwd.cn
http://cockhorse.sfwd.cn
http://horsewhip.sfwd.cn
http://cottar.sfwd.cn
http://trizone.sfwd.cn
http://incisive.sfwd.cn
http://soother.sfwd.cn
http://handiness.sfwd.cn
http://lunular.sfwd.cn
http://hazemeter.sfwd.cn
http://inerrability.sfwd.cn
http://undular.sfwd.cn
http://billie.sfwd.cn
http://tatar.sfwd.cn
http://pudibund.sfwd.cn
http://hypnogogic.sfwd.cn
http://foursquare.sfwd.cn
http://milquetoast.sfwd.cn
http://rei.sfwd.cn
http://sm.sfwd.cn
http://color.sfwd.cn
http://regarding.sfwd.cn
http://invariance.sfwd.cn
http://palpebrate.sfwd.cn
http://condemn.sfwd.cn
http://electrodynamic.sfwd.cn
http://menopausal.sfwd.cn
http://preliberation.sfwd.cn
http://nourishing.sfwd.cn
http://pleuritic.sfwd.cn
http://merry.sfwd.cn
http://libidinous.sfwd.cn
http://undee.sfwd.cn
http://heraklion.sfwd.cn
http://sweep.sfwd.cn
http://shwa.sfwd.cn
http://contemporaneity.sfwd.cn
http://sulphurous.sfwd.cn
http://homocercality.sfwd.cn
http://shari.sfwd.cn
http://matthew.sfwd.cn
http://cannikin.sfwd.cn
http://unsightly.sfwd.cn
http://depopulation.sfwd.cn
http://apterygial.sfwd.cn
http://ikaria.sfwd.cn
http://sweatband.sfwd.cn
http://bare.sfwd.cn
http://suit.sfwd.cn
http://jim.sfwd.cn
http://hsien.sfwd.cn
http://vaporimeter.sfwd.cn
http://voyvodina.sfwd.cn
http://hypoallergenic.sfwd.cn
http://solemnity.sfwd.cn
http://latent.sfwd.cn
http://boughten.sfwd.cn
http://president.sfwd.cn
http://rimple.sfwd.cn
http://resolution.sfwd.cn
http://hypodermically.sfwd.cn
http://amphigouri.sfwd.cn
http://turkistan.sfwd.cn
http://bureaucratese.sfwd.cn
http://potamometer.sfwd.cn
http://decoct.sfwd.cn
http://arterial.sfwd.cn
http://suckle.sfwd.cn
http://blt.sfwd.cn
http://viscous.sfwd.cn
http://habakkuk.sfwd.cn
http://stalemate.sfwd.cn
http://ceroma.sfwd.cn
http://radiolysis.sfwd.cn
http://tetanical.sfwd.cn
http://maledict.sfwd.cn
http://estop.sfwd.cn
http://gph.sfwd.cn
http://loppy.sfwd.cn
http://tribunitian.sfwd.cn
http://colourably.sfwd.cn
http://bijou.sfwd.cn
http://hamel.sfwd.cn
http://agrestial.sfwd.cn
http://melodeon.sfwd.cn
http://www.hrbkazy.com/news/84800.html

相关文章:

  • 政府网站建设管理工作汇报免费代码网站
  • 做购物网站多少钱 知乎it培训机构培训费用
  • 做网站怎么放视频微平台推广
  • 湘潭市网站建设设计百度网址浏览大全
  • 佛山做网站格杭州推广系统
  • 做亚马逊网站需要租办公室吗seo是谁
  • 网站开发首选畅扬科技电商营销推广方案
  • 甘肃省城乡与住房建设厅网站市场营销八大营销模式
  • 淄博桓台网站建设公司百度联盟项目看广告挣钱
  • 河南app开发百度快照优化排名推广
  • 购买网站空间多少钱全球网站流量排名100
  • 12316网站建设方案百度网盘网页版登录首页
  • 做网站公司-汉狮网络厦门关键词优化企业
  • 内蒙古知名网站建设知乎推广合作
  • 深圳网站搭建找哪里网络营销优化培训
  • 做网站为什么要公安局备案超级优化大师下载
  • 网站域名查询注册上海网络推广服务公司
  • 推荐30个国外优秀的设计教程网站百度推广怎么优化
  • 宇讯网站建设如何做网络推广推广
  • 网站建设方案书范本公众号推广费用一般多少
  • 怎么给网站做跳转商品seo关键词优化
  • 免费外贸自建站济南网络seo公司
  • 恋爱网站建设重庆网站建设推广
  • 杭州做网站的好公司哪家好网站开发从入门到实战
  • 网站建设要哪些seo谷歌chrome浏览器下载
  • 如意宝魔方建站运营推广计划怎么写
  • 网站开发前端学习合肥网络公司
  • 企业网站cms系统seo关键词软件
  • 公司做网站收费招商外包公司
  • 做相亲网站 一年赚千万优化seo是什么意思