【FastDDS】安装与入门使用 | 您所在的位置:网站首页 › omg地址 › 【FastDDS】安装与入门使用 |
文章目录
1. FastDDS介绍2. 环境安装3. 测试4. 卸载
1. FastDDS介绍
官方地址:https://www.eprosima.com/index.php/company-all/news/146-fast-rtps-is-now-fast-dds API地址:https://fast-dds.docs.eprosima.com/en/latest/ FsatDDS的前身是Fast-RTPS,实现了许多 DDS 规范。它是一种高性能的实时发布订阅框架。 2. 环境安装FastDDS有bin、source、docker image三种安装方式。 这里采用bin安装,版本2.8.1。 下载地址:https://www.eprosima.com/index.php/component/ars/repository/eprosima-fast-dds/eprosima-fast-dds-2-8-1 安装包里,install.sh会自动安装各种依赖,然后进入src目录下,分别构建以下库: foonathan_memory_vendor,一个 STL 兼容的 C++ 内存分配器 库。fastcdr,一个根据 CDR 标准进行数据序列化的 C++ 库。fastrtps,eProsima Fast DDS库的核心库。fastddsgen,一个使用 IDL 文件中定义的数据类型生成源代码的 Java 应用程序。执行install.h需要cmake 3.11以上的版本,因此需要先升级cmake:http://t.csdn.cn/LezV9 wget https://cmake.org/files/v3.22/cmake-3.22.1.tar.gz sudo tar -xvzf cmake-3.22.1.tar.gz -C /usr/share cd /usr/share/cmake-3.22.1 sudo chmod 777 ./configure sudo ./configure sudo make sudo make install sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force cmake --version执行安装: sudo ./install.sh 安装了:git、build-essential、cmake、libssl-dev、libasio-dev、libtinyxml2-dev、openjdk-8-jre-headless、foonathan_memory_vendor、fastcdr、fastrtps(Fast DDS)、fastddsgen。 如果要测试FastDDS中的examples,需要在install.sh脚本脚本中打开该选项,默认为OFF。 3. 测试IDL文件生成接口文件: git clone https://ghproxy.com/https://github.com/wanghuohuo0716/fastdds_helloworld.git cd fastdds_helloworld mkdir -p include/idl_generate/ cd idl/ fastddsgen -d ../include/idl_generate/ HelloWorld.idl # -d选项指示生成的头文件保存目录编译FastDDS程序: 根据IDL文件生成接口文件后,同一个终端内接着编译FastDDS程序。 cd .. mkdir build && cd build cmake .. make运行Publisher和Subscriber节点: cd build/ ./DDSHelloWorldPublisher ./DDSHelloWorldSubscriber 4. 卸载安装包也提供了./uninstall.sh脚本,可随时卸载。 参考:https://www.jianshu.com/p/b9eb5dd9559f 以上。 |
CopyRight 2018-2019 实验室设备网 版权所有 |