【Fast RTPS】Ubuntu下源文件安装

参考原文链接

依赖dependencies

Asio和TingXML2库

sudo apt-get install libasio-dev libtinyxml2-dev

Colcon 安装

Colcon是用来编译软件包的命令行工具。使用colcon将很容易编译Fast-RTPS和其依赖。
首先安装ROS2开发工具(colcon 和 vcstool):

pip install -U colcon-common-extensions vcstool

下载Fast-RTPS和其依赖:

$ wget https://raw.githubusercontent.com/eProsima/Fast-RTPS/master/fastrtps.repos
$ mkdir src
$ vcs import src < fastrtps.repos

最终,使用colcon编译所有软件

$ colcon build

手动安装

在手动编译Fast RTPS之前,你需要下载下述依赖,并用cmake编译。

Fast CDR

$ git clone https://github.com/eProsima/Fast-CDR.git
$ mkdir Fast-CDR/build && cd Fast-CDR/build
$ cmake ..
$ cmake --build . --target install

Foonathan memory

$ git clone https://github.com/foonathan/memory.git
$ cd memory
$ git submodule update --init --recursive
$ mkdir build && cd build
$ cmake ..
$ cmake --build . --target install

待所有依赖安装之后,编译并安装Fast RTPS:

$ git clone https://github.com/eProsima/Fast-RTPS.git
$ mkdir Fast-RTPS/build && cd Fast-RTPS/build
$ cmake ..
$ cmake --build . --target install

如果需要编译fastrtpsgen JAVA应用,需要在使用CMAKE时增加参数:-DBUILD_JAVA=ON
如果需要编译例程,需要在使用CMAKE时增加参数:-DCOMPILE_EXAMPLES=ON
如果需要编译高性能测试,需要在使用CMAKE时增加参数:-DPERFORMANCE_TESTS=ON

安全

默认情况下,Fast RTPS不编译安全通信支持。你可以通过在CMAKE配置阶段增加参数-DSECURITY=ON激活安全通信支持。
关于安全通信详细描述
安全通信需要依赖:

sudo apt install libssl-dev
发布了44 篇原创文章 · 获赞 8 · 访问量 6734

猜你喜欢

转载自blog.csdn.net/zhaodeming000/article/details/99582152