FastRTPS 安装
eProsima Fast RTPS 是 RTPS(实时发布订阅者)协议的 C++ 实现,它在不可靠的传输(如 UDP)上提供发布者-订阅者通信,由对象管理组(OMG)定义和维护社区。 RTPS 也是为数据分发服务(DDS)标准定义的有线互操作性协议,也是由 OMG 定义的。
PX4 使用 FastRTPS,使 RTPS 接口能够与板外组件(包括机器人和模拟器工具)共享 PX4 uORB 主题。 RTPS 是 DDS 的基本协议,是 OMG(对象管理组)提供实时发布/订阅中间件的标准,广泛应用于航空航天、国防和物联网应用。 它也被用作 ROS2 机器人工具包的中间件。 有关详细信息,请参阅:RTPS/ROS2 接口:PX4-FastRTPS Bridge。
For Ubuntu, at time of writing, you will need to install Fast-RTPS 1.8.2 from source.
This topic is derived from the official eProsima Fast RTPS documentation. For more information see:
Requirements
eProsima Fast RTPS requires the following packages to work.
依赖
Java
Java is required to use our built-in code generation tool - fastrtpsgen. Java JDK 8 is recommended.
Windows 7 32位和64位
Visual C++ 2013 or 2015 Redistributable Package
eProsima Fast RTPS requires the Visual C++ Redistributable packages for the Visual Studio version you chose during the installation or compilation. The installer gives you the option of downloading and installing them.
Installation from Sources
Fast-RTPS
Clone the project from Github:
$ git clone --recursive https://github.com/eProsima/Fast-RTPS.git -b 1.8.x ~/FastRTPS-1.8.2
$ cd ~/FastRTPS-1.8.2
$ mkdir build && cd build
You may need to install Gradle to build the source (e.g. this is true on vanilla Fedora Linux). A build warning will be displayed if this is the case.
If you are on Linux, execute:
$ cmake -DTHIRDPARTY=ON -DSECURITY=ON ..
$ make
$ sudo make install
This will install Fast RTPS to /usr/local
, with secure communications support. You can use -DCMAKE_INSTALL_PREFIX=<path>
to install to a custom location.
If you are on Windows, choose your version of Visual Studio:
> cmake -G "Visual Studio 14 2015 Win64" -DTHIRDPARTY=ON -DSECURITY=ON ..
> cmake --build . --target install
Compile options
If you want to compile the examples, you will need to add the argument -DCOMPILE_EXAMPLES=ON
when calling CMake.
If you want to compile the performance tests, you will need to add the argument -DPERFORMANCE_TESTS=ON
when calling CMake.
Fast-RTPS-Gen
Fast-RTPS-Gen is the Fast RTPS IDL code generator tool. It should be installed after Fast RTPS and made sure the fastrtpsgen
application is in your PATH
. You can check with which fastrtpsgen
.
Then install Fast-RTPS-Gen 1.0.4 (Gradle is required for this):
git clone --recursive https://github.com/eProsima/Fast-RTPS-Gen.git -b v1.0.4 ~/Fast-RTPS-Gen \
&& cd ~/Fast-RTPS-Gen \
&& gradle assemble \
&& gradle install
You might require
sudo
permissions on the "install" step
Installation from Binaries
Although the binaries are available, we recommend to build and install the code from source, given that the binaries may not come with required components and dependencies in place.
You can always download the latest binary release of eProsima Fast RTPS from the company website.
Documentation on how to do this can be found here: Installation from Binaries (eProsima Fast RTPS official documentation)
Windows 7 32-bit and 64-bit
Execute the installer and follow the instructions, choosing your preferred Visual Studio version and architecture when prompted.
Environmental Variables
eProsima Fast RTPS requires the following environmental variable setup in order to function properly
FASTRTPSHOME
: Root folder where eProsima Fast RTPS is installed.FASTRTPSGEN_DIR
: Root folder where eProsima FastRTPSGen is installed.- Additions to the
PATH
: the /bin folder and the subfolder for your Visual Studio version of choice should be appended to the PATH.
These variables are set automatically by checking the corresponding box during the installation process.
Linux
Extract the contents of the package. It will contain both eProsima Fast RTPS and its required package eProsima Fast CDR. You will have follow the same procedure for both packages, starting with Fast CDR.
Configure the compilation:
$ ./configure --libdir=/usr/lib
If you want to compile with debug symbols (which also enables verbose mode):
$ ./configure CXXFLAGS="-g -D__DEBUG" --libdir=/usr/lib
After configuring the project compile and install the library:
$ sudo make install
Environmental Variables
FASTRTPSGEN_DIR
: Root folder where eProsima FastRTPSGen is installed, usually set to/usr/local
, which is the default installation directory. If the user sets a different install directory in thegradle install
step, it must set it here as well.