Fixposition SDK 0.0.0-heads/main-0-gfaec355
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 - OpenSSL (libssl) (≥ 1.1.x, tested with 1.1.1, 3.0.2, 3.0.13, 3.0.15)
36 - nlohmann-json3 (≥ 3.7.3, tested with 3.7.3, 3.11.3)
37 - PROJ (*) (≥ 9.4.x, tested with 9.4.0, 9.4.1)
38 - ROS1 (*) (Noetic), or
39 - ROS2 (*) (Humble or Jazzy)
40
41 (*) Optional dependencies. Without these some functionality in the libraries and apps is unavailable (compiled out).
42
43 For development additionally:
44
45 - clang-format (≥ 17, tested with 17)
46 - Doxygen (≥ 1.11.0, tested with 1.11.0)
47 - GTest (≥ 1.12.0, tested with 1.12.1 and 1.13.0)
48
49 <!-- trick doxygen -->
50
51 @page FPSDK_BUILD_DOC
52
53 @section FPSDK_BUILD_BUILD Building
54
55 @subsection FPSDK_BUILD_BUILD_TLDR tl;dr
56
57 @code{sh}
58 ./docker/docker.sh pull noetic-dev # Or "docker.sh build noetic-dev" to build the image locally
59 ./docker/docker.sh run noetic-dev bash
60 # Now inside Docker do:
61 source /opt/ros/noetic/setup.bash
62 make install
63 ./fpsdk/bin/fpltool -h
64 @endcode
65
66 <!-- trick doxygen -->
67
68 @subsection FPSDK_BUILD_BUILD_DEVCONTAINER VSCode devcontainer
69
70 Open the fpsdk.code-workspace, change to one of the provided devcontainers, and in a terminal do:
71
72 @code{sh}
73 make install
74 ./fpsdk/bin/fpltool
75 @endcode
76
77 <!-- trick doxygen -->
78
79 @subsection FPSDK_BUILD_BUILD_DOCKER Docker container
80
81 Docker images are provided that include all the dependencies:
82
83 @code{sh}
84 ./docker/docker.sh pull noetic-dev # Or "docker.sh build noetic-dev" to build the image locally
85 ./docker/docker.sh run noetic-dev bash
86 source /opt/ros/noetic/setup.bash
87 make install
88 ./fpsdk/bin/fpltool
89 @endcode
90
91 Note that the "docker.sh" script does not give you a suitable ROS runtime (or development, playground, ...)
92 environment! Its only purpose is to run the CI for this repo and to demonstrate the building here. For a ROS
93 run-time environment please setup a docker *container* yourself elsewhere (perhaps using the docker *image* provided
94 here). See ROS and Docker documentation and the Internet for help.
95
96 <!-- trick doxygen -->
97
98 @subsection FPSDK_BUILD_BUILD_CI Run CI
99
100 @code{sh}
101 ./docker/docker.sh run noetic-ci ./docker/ci.sh
102 ./docker/docker.sh run humble-ci ./docker/ci.sh
103 ./docker/docker.sh run jazzy-ci ./docker/ci.sh
104 @endcode
105
106 <!-- trick doxygen -->
107
108 @subsection FPSDK_BUILD_BUILD_MANUAL Manual build
109
110 This details the manual setup of the dependencies and building the SDK on a ROS1 system (for example, Ubuntu 20.04
111 with ROS Noetic). It works similarly for ROS2 (for example, Ubuntu 22.04 with ROS Humble) or non-ROS (for example,
112 Debian Bookworm) based systems. Refer to the Docker configration files and scripts in the docker/ folder on
113 installing the required dependencies.
114
115 1. Setup build system, install dependencies
116
117 The exact steps required depend on your system. You'll need the dependencies mentioned above installed system
118 wide or otherwise tell CMake where to find them.
119
120 @code{sh}
121 sudo apt install libyaml-cpp-dev libboost-all-dev zlib1g-dev libeigen3-dev linux-libc-dev # For building
122 sudo apt install libgtest-dev clang-format doxygen pre-commit # For development
123 source /opt/ros/noetic/setup.bash # If you have ROS1
124 @endcode
125
126 3. Configure
127
128 @code{sh}
129 cmake -B build -DCMAKE_INSTALL_PREFIX=~/fpsdk
130 @endcode
131
132 Additional parameters include (see CMakeList.txt files of the projects for details):
133
134 - Build type: `-DCMAKE_BUILD_TYPE=Debug` or `-DCMAKE_BUILD_TYPE=Release` (default)
135 - Force ROS1 package path: `-DROS_PACKAGE_PATH=/path/to/ros` (default: auto-detect)
136 - Explicitly enable or disable testing: `-DBUILD_TESTING=OFF` or `-DBUILD_TESTING=ON`.
137 The default is to automatically enable testing if a suitable GTest library is found.
138 Note that the instead of the standard BUILD_TESTING variable the variable `FPSDK_BUILD_TESTING=...`
139 can be used.
140 - Explicitly enable or disable use of the PROJ library: `-DUSE_PROJ=ON` or `-DUSE_PROJ=OFF`.
141 The default is to automatically use the PROJ library if a suitable version is found
142
143 4. Build
144
145 @code{sh}
146 cmake --build build
147 @endcode
148
149 5. Install
150
151 @code{sh}
152 cmake --install build
153 @endcode
154
155 6. Enjoy!
156
157 For example:
158
159 @code{sh}
160 ~/fpsdk/bin/fpltool -h
161 @endcode
162
163 <!-- trick doxygen -->
164
165 @subsection FPSDK_BUILD_DOC_DOXYGEN Documentation
166
167 @code{sh}
168 make doc
169 @endcode
170
171
172 <!-- trick doxygen -->
173
174 @subsection FPSDK_BUILD_PACKAGE Individual packages
175
176 For example to build the fpsdk_common package (library):
177
178 @code{sh}
179 cmake -B build -S fpsdk_common -DCMAKE_INSTALL_PREFIX=~/fpsdk
180 cmake --build build
181 cmake --install build
182 @endcode
183
184
185 <!-- trick doxygen -->
186
187 @subsection FPSDK_BUILD_ROS ROS workspace
188
189 The packages build in a ROS workspace using catkin (ROS1) resp. colcon (ROS2). For example:
190
191 @code{sh}
192 catkin build fpsdk_common
193 @endcode
194
195 Note that if you clone this repository directly to your `ros_workspace/src` directory, you'll have to place
196 CATKIN_IGNORE resp. COLCON_IGNORE files in some places. For example:
197
198 @code{sh}
199 # ROS1 catkin workspace
200 touch src/fixposition-sdk/examples/CATKIN_IGNORE # Ignore all examples, or
201 touch src/fixposition-sdk/examples/ros1_fpsdk_demo/CATKIN_IGNORE # Ignore only this example
202 touch src/fixposition-sdk/fpsdk_ros2/CATKIN_IGNORE
203 @endcode
204
205 @code{sh}
206 # ROS2 colcon workspace
207 touch src/fixposition-sdk/examples/COLCON_IGNORE # Ignore all examples, or
208 touch src/fixposition-sdk/examples/ros2_fpsdk_demo/COLCON_IGNORE # Ignore only this example
209 touch src/fixposition-sdk/fpsdk_ros1/COLCON_IGNORE
210 @endcode
211
212 <!-- trick doxygen -->
213
214 @subsection FPSDK_BUILD_DETAILS Details
215
216 Refer to the various CMakeList.txt files, the CI workflow configuration (`.github/workflows/ci.yml`)
217 and the CI script (`docker/ci.sh`) for details on how things are done.
218
219
220
221*/
222
223// clang-format on
224/* ****************************************************************************************************************** */
225} // namespace fpsdk
226#endif // __FPSDK_BUILD_HPP__
Fixposition SDK.