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

网页网站设计公司排行榜做电子商务网站的公司

网页网站设计公司排行榜,做电子商务网站的公司,天眼查询个人,wordpress h1美化在单个进程中组合多个节点 目录 背景 运行演示 发现可用组件 使用 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://www.yayakq.cn/news/661203/

相关文章:

  • 阿里logo设计平台北京网站优化企业
  • 网站的建设哪家好信阳网站建设汉狮报价
  • 包头网站建设哪家好上海建设检测网上登记网站
  • 美食网站的设计与实现自己做软件的网站
  • 联合加工网昆明市网络优化案例
  • 哈尔滨门户网站设计报价中药网站模板
  • 莱州网站建设效果南宁网络公司有哪些
  • 无线网站制作做网站用哪个eclipse
  • 旅游门户网站系统网站开发合同缺陷
  • 网站开发报价 福州免费销售管理系统软件
  • 国内网站做国外服务器app开发公司选择指南及误区
  • 打不开wordpress网址自动app优化官网
  • 网络优化师自学网站深圳做app网站的公司哪家好
  • 网站推广自己可以做吗wordpress 建站主题
  • 第一站长网中国住房与城乡建设厅网站
  • 友情链接的网站企业信用报告网上查询
  • 上海做网站的公司联系方式网站设计风格大全
  • 如何创建网站教程视频aso应用商店优化
  • 如何用自己的域名做网站帝国cms 商城网站视频教程
  • asp保险网站源码如何做企业组织架构图
  • 站酷网官网网址济南网站建设丨 首选搜点网络
  • 企业网站上线wordpress博客
  • 做网站所需技术云南网页设计制作
  • 有做敦煌网站的吗大连市城乡建设局网站
  • 济南网站建设vashine连锁店进销存软件
  • 个人网站免费域名企业品牌宣传型网站
  • 网站外链查询wordpress线上安装
  • jsp网站开发实例重庆秀山网站建设报价
  • 聊城商城网站建设南通市网站建设我的完
  • 开发一个网站做公司内部用wordpress 站点维护