OpenDDS安装与开发
OpenDDS安裝與開發(fā)
文章目錄
- OpenDDS安裝與開發(fā)
- 1. OpenDDS介紹
- 2. 環(huán)境搭建
- 3. OpenDDS測(cè)試
- 4. 名詞解釋
- 5. OpenDDS應(yīng)用開發(fā)步驟
- 參考鏈接
1. OpenDDS介紹
官網(wǎng):https://opendds.org/
是個(gè)開源的數(shù)據(jù)分發(fā)中間件,有三層:TAO+ACE+DDS
-
TAO負(fù)責(zé)封裝數(shù)據(jù),讓OpenDDS支持跨平臺(tái);
-
ACE負(fù)責(zé)數(shù)據(jù)通信;
-
DDS負(fù)責(zé)數(shù)據(jù)的分發(fā)交互。
2. 環(huán)境搭建
主要包括三部分:
- Perl:用于運(yùn)行OpenDDS的用例和一些環(huán)境配置
- OpenDDS:V3.20
- ACE+TAO:V7.0.6
具體的安裝步驟可以參考博客:https://blog.csdn.net/babypphappy/article/details/123228108 ,經(jīng)過驗(yàn)證可以安裝成功。
注:在編譯TAO的過程中編譯出錯(cuò),錯(cuò)誤如下:
…/orbsvcs\orbsvcs/Security.idl(7): fatal error C1083: 無法打開包括文件: “orb.idl”: No such file or directory [D:\DDS\ACE_wrappers\TAO\orbsvcs\orbsvcs\Security_vs2019.vcxproj]
…/orbsvcs\orbsvcs/Security.idl(7): fatal error C1083: 無法打開包括文件: “orb.idl”: No such file or directory [D:\DDS\ACE_wrappers\TAO\orbsvcs\orbsvcs\Security_vs2019.vcxproj]
參照博客ACE+TAO環(huán)境搭建 windows平臺(tái),需要先編譯一下TAO\TAO_IDL文件夾里的TAO_IDL_ACE_vs2019.sln,另外需要保證已經(jīng)通過Visual Studio Installer安裝了通用Windows平臺(tái)開發(fā)這一組件,另外注意ace\config.h配置中只有一行代碼
#include "ace/config-win32.h"
3. OpenDDS測(cè)試
OpenDDS在配置完成,并將生成的解決方案.sln編譯完成后,就可以通過perl run_test.pl命令進(jìn)行測(cè)試,測(cè)試過程中報(bào)錯(cuò)如下:
D:\DDS\OpenDDS-3.20\examples\DCPS\Messenger_Imr>perl run_test.pl Can't locate Win32/Process.pm in @INC (you may need to install the Win32::Process module) (@INC contains: D:\DDS\ACE_wrappers/bin D:\DDS\OpenDDS-3.20/bin D:\DDS\OpenDDS-3.20\bin\PerlDDS c:/Users/SN-539/AppData/Local/activestate/cache/922e561e/site/lib c:/Users/SN-539/AppData/Local/activestate/cache/922e561e/lib) at D:\DDS\ACE_wrappers/bin/PerlACE/Process_Win32.pm line 8.提示找不到Win32/Process.pm,這個(gè)是Perl的模塊缺失問題,可以直接在ActiveState命令行中通過state install Win32-Process安裝對(duì)應(yīng)的模塊包:
[minglwang1115/Perl-5.34.0-Windows] C:\Users\SN-539\Perl-5.34.0-Windows>state install Win32-Process安裝完畢后,再運(yùn)行命令perl run_test.pl,又出現(xiàn)新的錯(cuò)誤:
.\.\publisher.EXE -DCPSConfigFile pub.ini -orbendpoint iiop://:23204 ERROR: Cannot Spawn: <.\.\publisher.EXE> not found .\.\subscriber.EXE -DCPSConfigFile sub.ini ERROR: Cannot Spawn: <.\.\subscriber.EXE> not found cP is not of type Win32::Process at D:\DDS\ACE_wrappers/bin/PerlACE/Process_Win32.pm line 458. ERROR: <D:\DDS\ACE_wrappers\TAO/orbsvcs/ImplRepo_Service/tao_imr_activator> still running upon object destruction ERROR: <D:\DDS\ACE_wrappers\TAO/orbsvcs/ImplRepo_Service/tao_imr_locator> still running upon object destruction缺少publisher和subscriber,可能是由于目前使用的OpenDDS最新版本中示例文件就沒有帶這倆文件,不過通過文件全局搜索,發(fā)現(xiàn)在OpenDDS-3.20\DevGuideExamples\DCPS\Messenger目錄下有上一步sln編譯生成好的publisher.exe和subscriber.exe文件,拷貝到OpenDDS-3.20\examples\DCPS\Messenger_Imr目錄后,再運(yùn)行perl run_test.pl發(fā)現(xiàn)測(cè)試成功。
SampleInfo.instance_state = NOT_ALIVE_DISPOSED_INSTANCE_STATE >>> D:\DDS\ACE_wrappers\bin\tao_imr.EXE -ORBInitRef ImplRepoService=file://imr.ior shutdown InfoRepo Successfully shut down server <InfoRepo> test PASSED.4. 名詞解釋
ACE is an open-source framework that provides many components and patterns for developing high-performance, distributed real-time and embedded systems. ACE provides powerful, yet efficient abstractions for sockets, demultiplexing loops, threads, synchronization primitives.TAO (The ACE ORB) is an open-source implementation of a CORBA Object Request Broker (ORB) built using components and patterns in the ACE framework.ACE是一個(gè)開源的函數(shù)庫,一種框架。TAO是基于ACE的對(duì)CORBA的一種實(shí)現(xiàn)。CORBA(Common Object Request Broker Architecture,公共對(duì)象請(qǐng)求代理體系結(jié)構(gòu),通用對(duì)象請(qǐng)求代理體系結(jié)構(gòu))是由OMG組織制訂的一種標(biāo)準(zhǔn)的面向?qū)ο髴?yīng)用程序體系規(guī)范。IDL:Interface description language的縮寫,指接口描述語言,是CORBA規(guī)范的一部分,是跨平臺(tái)開發(fā)的基礎(chǔ)。RPC(Remote Procedure Call)—遠(yuǎn)程過程調(diào)用,CORBA的底層實(shí)現(xiàn)OpenDDS is an open-source C++ implementation of the Object Management Group's specification "Data Distribution Service for Real-time Systems" (DDS), as well as some other related specifications. OpenDDS is built on the ACE abstraction layer to provide platform portability. OpenDDS also leverages capabilities of TAO, such as its IDL compiler and as the basis of the OpenDDS DCPS Information Repository (DCPSInfoRepo).OpenDDS: 是對(duì)OMG組織的DDS協(xié)議的C++開源實(shí)現(xiàn),它建立在ACE抽象層之上來保證平臺(tái)間的可移植性,OpenDDS同樣依賴了TAO的一些特性。5. OpenDDS應(yīng)用開發(fā)步驟
原文鏈接: OPenDDS程序 的 實(shí)現(xiàn)+運(yùn)行
基于Windows10的OpenDDS測(cè)試、https://github.com/WeiKangJian/OpenDDSapplication
參考鏈接
- OpenDDS環(huán)境搭建-Windows 10
- Windows環(huán)境下OpenDDS的安裝
- OpenDDS的學(xué)習(xí)和使用
- OpenDDS開發(fā)示例
- 通訊協(xié)議篇(底層TCP/UDP;上層MQTT、HTTP、CoAP、DDS、AMQP、JMS;實(shí)現(xiàn)層RabbitMQ、ActiveMQ、Kafka)
總結(jié)
以上是生活随笔為你收集整理的OpenDDS安装与开发的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: bat文件注册为Windows服务与依赖
- 下一篇: 且看且学Gradle--(1)Gradl