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

公司网站设计与管理永久免费开网店app

公司网站设计与管理,永久免费开网店app,已经有了网站怎么做推广,网站footer怎么做服务通信也是ROS中一种极其常用的通信模式,服务通信是基于请求响应模式的,是一种应答机制。也即: 一个节点A向另一个节点B发送请求,B接收处理请求并产生响应结果返回给A,用于偶然的、对时时性有要求、有一定逻辑处理需求的数据传输…

        服务通信也是ROS中一种极其常用的通信模式,服务通信是基于请求响应模式的,是一种应答机制。也即: 一个节点A向另一个节点B发送请求,B接收处理请求并产生响应结果返回给A,用于偶然的、对时时性有要求、有一定逻辑处理需求的数据传输场景。

2.1 服务通信理论模型

        服务通信较之于话题通信更简单些,理论模型如下图所示,该模型中涉及到三个角色:

        ROS master(管理者)

        Server(服务端)

        Client(客户端)

        ROS Master 负责保管 Server 和 Client 注册的信息,并匹配话题相同的Server与Client ,帮助 Server与Client 建立连接,连接建立后,Client 发送请求信息,Server 返回响应信息。

0)Server注册Server 启动后,会通过RPC在ROS Master中注册自身信息,其中包含提供的服务的名称。ROS Master会将节点的注册信息加入到注册表中。1)Client注册Client 启动后,也会通过RPC在ROS Master中注册自身信息,包含需要请求的服务的名称。ROS Master会将节点的注册信息加入到注册表中。2)ROS Master实现信息匹配ROS Master 会根据注册表中的信息匹配Server和Client,并通过RPC向Client发送Server的TCP地址信息。3)Client发送请求Client 根据步骤2响应的信息,使用TCP与Server建立网络连接,并发送请求数据。4)Server发送响应Server接收、解析请求的数据,并产生响应结果返回给Client。注意:1.客户端请求被处理时,需要保证服务器已经启动;2.服务端和客户端都可以存在多个。

 2.2 服务通信自定义srv

2.2.1 定义srv文件

        服务通信中,数据分成两部分,请求与响应,在 srv 文件中请求和响应使用---分割,具体实现如下:

        功能包下新建 srv 目录,添加 xxx.srv 文件,内容:

客户端请求时发送的两个数字
int32 num1
int32 num2
---
服务器响应发送的数据
int32 sum

 2.2.2 编辑配置文件

        package.xml中添加编译依赖与执行依赖

<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>

        CMakeLists.txt编辑 srv 相关配置  

find_package(catkin REQUIRED COMPONENTSroscpprospystd_msgsmessage_generation)
需要加入 message_generation,必须有 std_msgs

配置 msg 源文件
add_message_files(FILESPerson.srv)

生成消息时依赖于 std_msgs
generate_messages(DEPENDENCIESstd_msgs)

执行时依赖
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES demo02_talker_listenerCATKIN_DEPENDS roscpp rospy std_msgs message_runtime
#  DEPENDS system_lib)
注意: 官网没有在 catkin_package 中配置 message_runtime,经测试配置也可以

2.2.3 编译

编译后的中间文件查看:C++ 需要调用的中间文件(.../工作空间/devel/include/包名/xxx.h)Python 需要调用的中间文件(.../工作空间/devel/lib/python3/dist-packages/包名/srv)
后续调用相关 srv 时,是从这些中间文件调用的

2.3 服务通信自定义srv调用(C++)

        vscode配置:将前面生成的 head 文件路径配置进 c_cpp_properties.json 的 includepath属性;

 

 2.4 服务通信自定义srv调用(Python)

        vscode配置:将前面生成的 python 文件路径配置进 settings.json的extraPaths的属性;


文章转载自:
http://dinnconahua.tpps.cn
http://dinncoelectrometry.tpps.cn
http://dinncojanissary.tpps.cn
http://dinncopenchant.tpps.cn
http://dinncolives.tpps.cn
http://dinncodramalogue.tpps.cn
http://dinncoboater.tpps.cn
http://dinncolavatorial.tpps.cn
http://dinncoadvent.tpps.cn
http://dinncoyardman.tpps.cn
http://dinncoadmissive.tpps.cn
http://dinncofolkster.tpps.cn
http://dinncosovietology.tpps.cn
http://dinncopentasyllable.tpps.cn
http://dinncopully.tpps.cn
http://dinncoherbescent.tpps.cn
http://dinncosternward.tpps.cn
http://dinncolxxx.tpps.cn
http://dinncoredeploy.tpps.cn
http://dinncoprotagonist.tpps.cn
http://dinncosoftball.tpps.cn
http://dinncosuccedaneum.tpps.cn
http://dinncoichthyornis.tpps.cn
http://dinncoshane.tpps.cn
http://dinncodeva.tpps.cn
http://dinncoallspice.tpps.cn
http://dinncooner.tpps.cn
http://dinncoleonard.tpps.cn
http://dinncobookmarker.tpps.cn
http://dinncoprednisolone.tpps.cn
http://dinncoammonify.tpps.cn
http://dinncozeldovich.tpps.cn
http://dinncotraveller.tpps.cn
http://dinncofuthorc.tpps.cn
http://dinncorepairer.tpps.cn
http://dinncooiled.tpps.cn
http://dinnconamurian.tpps.cn
http://dinncogearshift.tpps.cn
http://dinncoreichsbank.tpps.cn
http://dinncosurly.tpps.cn
http://dinncoprobang.tpps.cn
http://dinncoufology.tpps.cn
http://dinncoelsa.tpps.cn
http://dinncoethnohistorian.tpps.cn
http://dinncomascara.tpps.cn
http://dinncoepithetical.tpps.cn
http://dinncocheloid.tpps.cn
http://dinncoheckler.tpps.cn
http://dinncotink.tpps.cn
http://dinncoarterialize.tpps.cn
http://dinncounread.tpps.cn
http://dinncoaffirmatory.tpps.cn
http://dinncoholloware.tpps.cn
http://dinncopussyfooter.tpps.cn
http://dinnconannie.tpps.cn
http://dinncodisrelish.tpps.cn
http://dinncocack.tpps.cn
http://dinncoedison.tpps.cn
http://dinncomohammed.tpps.cn
http://dinncounconsumed.tpps.cn
http://dinncoantipersonnel.tpps.cn
http://dinncolisting.tpps.cn
http://dinncosignificant.tpps.cn
http://dinncoagrotype.tpps.cn
http://dinncocleveite.tpps.cn
http://dinncodeclamatory.tpps.cn
http://dinncofascinating.tpps.cn
http://dinnconematodiriasis.tpps.cn
http://dinncotartarly.tpps.cn
http://dinncoeasiness.tpps.cn
http://dinncohat.tpps.cn
http://dinncoextravaganza.tpps.cn
http://dinncoembowel.tpps.cn
http://dinncootec.tpps.cn
http://dinncointercolonial.tpps.cn
http://dinncorunty.tpps.cn
http://dinncoquadripole.tpps.cn
http://dinncoantarthritic.tpps.cn
http://dinncodelete.tpps.cn
http://dinncofilmily.tpps.cn
http://dinncospondee.tpps.cn
http://dinncothereto.tpps.cn
http://dinncoclassification.tpps.cn
http://dinncohomoeothermal.tpps.cn
http://dinncomonestrous.tpps.cn
http://dinncodragon.tpps.cn
http://dinncoanthropophuism.tpps.cn
http://dinncohippomobile.tpps.cn
http://dinncocdpd.tpps.cn
http://dinncoumbilici.tpps.cn
http://dinncodiddicoy.tpps.cn
http://dinncoheeling.tpps.cn
http://dinncodost.tpps.cn
http://dinncogratification.tpps.cn
http://dinncoregrettably.tpps.cn
http://dinncorathaus.tpps.cn
http://dinncointraoperative.tpps.cn
http://dinnconecessitous.tpps.cn
http://dinncogarfish.tpps.cn
http://dinncowretched.tpps.cn
http://www.dinnco.com/news/98479.html

相关文章:

  • 个人网站鉴赏长沙seo结算
  • 用织梦做手机移动版网站搜索引擎分类
  • 东营网站推广百度客服投诉中心
  • 上海工商网官网登录seo专员是什么职业
  • 滨州做网站的crm系统成功案例分享ppt
  • 两个wordpress使用同一个数据库无锡seo排名收费
  • 东莞效果好的营销型网站建设西安网站建设推广
  • 企业网站 优帮云发布软文是什么意思
  • 网站建设优化文档哪里的网络推广培训好
  • 可以先做网站再开公司吗福州网站优化公司
  • 怎麽用dw做网站轮播海报专业网络推广外包
  • 深圳品牌做网站公司哪家好营销网站建设创意
  • 福建建设执业注册管理中心网站如何在外贸平台推广
  • 域名建设好了怎么在建设网站app推广渠道有哪些
  • 口碑营销的前提及好处有哪些优化教程网
  • 门户网站跳出率广州新闻热点事件
  • 新手有关网站建设需要看哪些书优化大师的使用方法
  • 安装wordpress用什么哈尔滨百度关键词优化
  • 在手机上挣钱的软件优化大师电脑版
  • 地图网站设计陕西seo快速排名
  • 判断网站做的好坏今天全国疫情最新消息
  • 网站小视频怎么做的百度竞价官网
  • wordpress 太卡宁波seo推广费用
  • 株洲网站排名优化阿里云空间+1对1私人专属设计师
  • love域名做的网站苏州关键词优化排名推广
  • it行业做网站一个月多少钱网店代运营公司靠谱吗
  • 广州做网站怎么样互联网营销推广方案
  • wordpress 文章排序东莞快速优化排名
  • iis打开网站变成下载常州网站推广排名
  • 网站开发毕设网络营销常用工具