Fixposition SDK 0.0.0-heads/main-0-gd0a6ce2
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 - Explicitly enable or disable use of the PROJ library: `-DUSE_PROJ=ON` or `-DUSE_PROJ=OFF`.
139 The default is to automatically use the PROJ library if a suitable version is found
140
141 4. Build
142
143 @code{sh}
144 cmake --build build
145 @endcode
146
147 5. Install
148
149 @code{sh}
150 cmake --install build
151 @endcode
152
153 6. Enjoy!
154
155 For example:
156
157 @code{sh}
158 ~/fpsdk/bin/fpltool -h
159 @endcode
160
161 <!-- trick doxygen -->
162
163 @subsection FPSDK_BUILD_DOC_DOXYGEN Documentation
164
165 @code{sh}
166 make doc
167 @endcode
168
169
170 <!-- trick doxygen -->
171
172 @subsection FPSDK_BUILD_PACKAGE Individual packages
173
174 For example to build the fpsdk_common package (library):
175
176 @code{sh}
177 cmake -B build -S fpsdk_common -DCMAKE_INSTALL_PREFIX=~/fpsdk
178 cmake --build build
179 cmake --install build
180 @endcode
181
182
183 <!-- trick doxygen -->
184
185 @subsection FPSDK_BUILD_ROS ROS workspace
186
187 The packages build in a ROS workspace using catkin (ROS1) resp. colcon (ROS2). For example:
188
189 @code{sh}
190 catkin build fpsdk_common
191 @endcode
192
193 Note that if you clone this repository directly to your `ros_workspace/src` directory, you'll have to place
194 CATKIN_IGNORE resp. COLCON_IGNORE files in some places. For example:
195
196 @code{sh}
197 # ROS1 catkin workspace
198 touch src/fixposition-sdk/examples/CATKIN_IGNORE # Ignore all examples, or
199 touch src/fixposition-sdk/examples/ros1_fpsdk_demo/CATKIN_IGNORE # Ignore only this example
200 touch src/fixposition-sdk/fpsdk_ros2/CATKIN_IGNORE
201 @endcode
202
203 @code{sh}
204 # ROS2 colcon workspace
205 touch src/fixposition-sdk/examples/COLCON_IGNORE # Ignore all examples, or
206 touch src/fixposition-sdk/examples/ros2_fpsdk_demo/COLCON_IGNORE # Ignore only this example
207 touch src/fixposition-sdk/fpsdk_ros1/COLCON_IGNORE
208 @endcode
209
210 <!-- trick doxygen -->
211
212 @subsection FPSDK_BUILD_DETAILS Details
213
214 Refer to the various CMakeList.txt files, the CI workflow configuration (`.github/workflows/ci.yml`)
215 and the CI script (`docker/ci.sh`) for details on how things are done.
216
217
218
219*/
220
221// clang-format on
222/* ****************************************************************************************************************** */
223} // namespace fpsdk
224#endif // __FPSDK_BUILD_HPP__
Fixposition SDK.