1.3.1. Linux installation from sources using colcon¶
colcon is a command line tool based on CMake aimed at building sets of software packages in a tidy and easy way. The instructions for installing the AML-IP using colcon application from sources and its required dependencies are provided in this page.
1.3.1.1. Installation¶
Follow the instructions below to build eProsima AML-IP, after making sure all required dependencies are installed in your system (Dependencies).
1.3.1.1.1. Download eProsima dependencies¶
Create a
AML-IP
directory and download the.repos
file that will be used to install AML-IP and its dependencies:mkdir -p ~/AML-IP/src cd ~/AML-IP wget https://raw.githubusercontent.com/eProsima/AML-IP/main/amlip.repos vcs import src < amlip.repos
Note
In case there are already some eProsima libraries installed in the system, it is not required to download and build every dependency in the
.repos
file, but just those projects that are not already in the system. Refer to section eProsima dependencies in order to check how to source those libraries.
1.3.1.1.2. Build packages¶
Build the packages:
colcon build --packages-up-to-regex amlip
Note
Not all the sub-packages of all the dependencies are required.
In order to build only the packages required, use the colcon option --packages-up-to <package-to-build>
.
e.g. the AML-IP C++ library is completely built using --packages-up-to amlip_cpp
For more details about the colcon available arguments, please refer to packages selection
page of the colcon manual.
Note
Being based on CMake, it is possible to pass the CMake configuration options to the colcon build
command. For more information on the specific syntax, please refer to the
CMake specific arguments
page of the colcon manual.
For more details about the available CMake options, please refer to the CMake options section.
1.3.1.1.3. Run Tests¶
Tests are not automatically built within the AML-IP project. Use CMake option BUILD_TESTS when building the project in order to activate tests. This could also be done by a colcon.meta file to only activate tests in the desired packages.
Build the packages with tests:
colcon build --packages-select-regex amlip --cmake-args "-DBUILD_TESTS=ON"
Run tests. Use
--packages-select <package-name>
to only execute tests of a specific package:colcon test --event-handlers=console_direct+ --packages-select amlip_cpp
1.3.1.2. Source installation¶
To source the installation of the previously built AML-IP (in order to use its tools or link against it), use the following command:
source install/setup.bash
1.3.1.3. Build demos¶
There is a demo sub-package that can be installed along with the project. In order to install this package use one of these 2 commands:
# To build all sub-packages
colcon build
# To only build demo packages and its dependencies
colcon build --packages-up-to \
amlip_collaborative_learning_demo \
amlip_tensorflow_inference_demo \
amlip_tensorflow_inference_rosbot2r_demo \
amlip_tensorflow_inference_rosbot2r_demo