Fixposition SDK 0.0.0-heads/main-0-g90a51ff
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
fpsdk_build.hpp
Go to the documentation of this file.
1/**
2 * \verbatim
3 * ___ ___
4 * \ \ / /
5 * \ \/ / Copyright (c) Fixposition AG (www.fixposition.com) and contributors
6 * / /\ \ License: see the LICENSE file
7 * /__/ \__\
8 * \endverbatim
9 *
10 * @file
11 * @brief Fixposition SDK: Documentation
12 */
13
14#ifndef __FPSDK_BUILD_HPP__
15#define __FPSDK_BUILD_HPP__
16
17namespace fpsdk {
18/* ****************************************************************************************************************** */
19// clang-format off
20
21/*!
22
23 @page FPSDK_BUILD_DOC Fixposition SDK: Build and installation
24
25 @section FPSDK_BUILD_DEPS Dependencies
26
27 For building the libraries and apps:
28
29 - **Linux**, GCC (C++-17), glibc, cmake, bash, etc. (tested with Ubuntu 20.04/22.04/24.04 and Debian Bookworm)
30 - boost (≥ 1.71.0, tested with 1.71.0, 1.74.1, 1.83.0)
31 - curl (≥ 7.68.0, tested with 7.68.0, 7.88.1, 8.5.0)
32 - Eigen3 (≥ 3.3.7, tested with 3.3.7, 3.4.0)
33 - yaml-cpp (≥ 0.6.2, tested with 0.6.2, 0.7.0, 0.8.0)
34 - zlib1g (≥ 1.2.11, tested with 1.2.11, 1.2.13, 1.3)
35 - PROJ (*) (≥ 9.4.x, tested with 9.4.0, 9.4.1)
36 - ROS1 (*) (Noetic), or
37 - ROS2 (*) (Humble or Jazzy)
38
39 (*) Optional dependencies. Without these some functionality in the libraries and apps is unavailable (compiled out).
40
41 For development additionally:
42
43 - clang-format (≥ 17, tested with 17)
44 - Doxygen (≥ 1.11.0, tested with 1.11.0)
45 - GTest (≥ 1.12.0, tested with 1.12.1 and 1.13.0)
46
47 <!-- trick doxygen -->
48
49 @page FPSDK_BUILD_DOC
50
51 @section FPSDK_BUILD_BUILD Building
52
53 @subsection FPSDK_BUILD_BUILD_TLDR tl;dr
54
55 @code{sh}
56 ./docker/docker.sh pull noetic-dev # Or "docker.sh build noetic-dev" to build the image locally
57 ./docker/docker.sh run noetic-dev bash
58 # Now inside Docker do:
59 make install
60 ./fpsdk/bin/fpltool -h
61 @endcode
62
63 <!-- trick doxygen -->
64
65 @subsection FPSDK_BUILD_BUILD_DEVCONTAINER VSCode devcontainer
66
67 Open the fpsdk.code-workspace, change to one of the provided devcontainers, and in a terminal do:
68
69 @code{sh}
70 make install
71 ./fpsdk/bin/fpltool
72 @endcode
73
74 <!-- trick doxygen -->
75
76 @subsection FPSDK_BUILD_BUILD_DOCKER Docker container
77
78 Docker images are provided that include all the dependencies:
79
80 @code{sh}
81 ./docker/docker.sh pull noetic-dev # Or "docker.sh build noetic-dev" to build the image locally
82 ./docker/docker.sh run noetic-dev bash
83 make install
84 ./fpsdk/bin/fpltool
85 @endcode
86
87 <!-- trick doxygen -->
88
89 @subsection FPSDK_BUILD_BUILD_CI Run CI
90
91 @code{sh}
92 ./docker/docker.sh run noetic-ci ./docker/ci.sh
93 ./docker/docker.sh run humble-ci ./docker/ci.sh
94 ./docker/docker.sh run jazzy-ci ./docker/ci.sh
95 @endcode
96
97 <!-- trick doxygen -->
98
99 @subsection FPSDK_BUILD_BUILD_MANUAL Manual build
100
101 This details the manual setup of the dependencies and building the SDK on a ROS1 system (for example, Ubuntu 20.04
102 with ROS Noetic). It works similarly for ROS2 (for example, Ubuntu 22.04 with ROS Humble) or non-ROS (for example,
103 Debian Bookworm) based systems. Refer to the Docker configration files and scripts in the docker/ folder on
104 installing the required dependencies.
105
106 1. Setup build system, install dependencies
107
108 The exact steps required depend on your system. You'll need the dependencies mentioned above installed system
109 wide or otherwise tell CMake where to find them.
110
111 @code{sh}
112 sudo apt install libyaml-cpp-dev libboost-all-dev zlib1g-dev libeigen3-dev linux-libc-dev # For building
113 sudo apt install libgtest-dev clang-format doxygen pre-commit # For development
114 source /opt/ros/noetic/setup.bash # If you have ROS1
115 @endcode
116
117 3. Configure
118
119 @code{sh}
120 cmake -B build -DCMAKE_INSTALL_PREFIX=~/fpsdk
121 @endcode
122
123 Additional parameters include (see CMakeList.txt files of the projects for details):
124
125 - Build type: `-DCMAKE_BUILD_TYPE=Debug` or `-DCMAKE_BUILD_TYPE=Release` (default)
126 - Force ROS1 package path: `-DROS_PACKAGE_PATH=/path/to/ros` (default: auto-detect)
127 - Explicitly enable or disable testing: `-DBUILD_TESTING=OFF` or `-DBUILD_TESTING=ON`.
128 The default is to automatically enable testing if a suitable GTest library is found.
129 - Explicitly enable or disable use of the PROJ library: `-DUSE_PROJ=ON` or `-DUSE_PROJ=OFF`.
130 The default is to automatically use the PROJ library if a suitable version is found
131
132 4. Build
133
134 @code{sh}
135 cmake --build build
136 @endcode
137
138 5. Install
139
140 @code{sh}
141 cmake --install build
142 @endcode
143
144 6. Enjoy!
145
146 For example:
147
148 @code{sh}
149 ~/fpsdk/bin/fpltool -h
150 @endcode
151
152 <!-- trick doxygen -->
153
154 @subsection FPSDK_BUILD_DOC_DOXYGEN Documentation
155
156 @code{sh}
157 make doc
158 @endcode
159
160
161 <!-- trick doxygen -->
162
163 @subsection FPSDK_BUILD_PACKAGE Individual packages
164
165 For example to build the fpsdk_common package (library):
166
167 @code{sh}
168 cmake -B build -S fpsdk_common -DCMAKE_INSTALL_PREFIX=~/fpsdk
169 cmake --build build
170 cmake --install build
171 @endcode
172
173
174 <!-- trick doxygen -->
175
176 @subsection FPSDK_BUILD_ROS ROS workspace
177
178 The packages build in a ROS workspace using catkin) (ROS1) resp. colcon (ROS2). For example:
179
180 @code{sh}
181 catkin build fpsdk_common
182 @endcode
183
184
185 <!-- trick doxygen -->
186
187 @subsection FPSDK_BUILD_DETAILS Details
188
189 Refer to the various CMakeList.txt files, the CI workflow configuration (`.github/workflows/ci.yml`)
190 and the CI script (`docker/ci.sh`) for details on how things are done.
191
192
193
194*/
195
196// clang-format on
197/* ****************************************************************************************************************** */
198} // namespace fpsdk
199#endif // __FPSDK_BUILD_HPP__
Fixposition SDK.