-
Notifications
You must be signed in to change notification settings - Fork 33
Compiling
This page assumes that you have already completed the steps on the Prerequisites page.
First, we need to check out FreeRTPS from Github. Let's assume that you would like it to be in ~/freertps
:
cd ~
git clone https://github.com/ros2/freertps
cd freertps
Next, let's start compiling FreeRTPS. A top-level invocation of make
will compile FreeRTPS for all target systems:
make
Hooray! That's it.
However, you probably want more than that. A top-level make
without having a ROS2 installation in the environment will only generate the standalone string-based talker
and listener
programs. We want to use the ROS2 messages for serialization in order to create most of the demos. So, assuming that you have a ROS2 installation checked out and compiled in ~/ros2_ws
, let's make sure it's loaded into your shell's environment and re-compile FreeRTPS:
source ~/ros2_ws/install/setup.bash
make clean
make
Note that FreeRTPS has a bit of an unusual toolchain: since CMake only allows one compiler per build tree, a top-level make
invocation in the FreeRTPS code tree will create a separate build tree for each target system, invokes CMake once per build tree for configuration, and finally invoke make
once per build tree.
With the ROS2 environment variables loaded, FreeRTPS will generate message implementations for every ROS2 message that it finds, and compile those for each of the target systems.
You're now ready to run some demos of FreeRTPS.