File tree Expand file tree Collapse file tree 4 files changed +68
-0
lines changed
Expand file tree Collapse file tree 4 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.8)
2+ project (vortex_utils)
3+
4+ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
5+ add_compile_options (-Wall -Wextra -Wpedantic)
6+ endif ()
7+
8+ find_package (ament_cmake REQUIRED)
9+
10+ include_directories (include )
11+
12+ add_library (${PROJECT_NAME} src/cpp_utils.cpp)
13+
14+ ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
15+
16+ install (
17+ DIRECTORY include /
18+ DESTINATION include
19+ )
20+
21+ install (
22+ TARGETS ${PROJECT_NAME}
23+ EXPORT ${PROJECT_NAME}
24+ ARCHIVE DESTINATION lib
25+ LIBRARY DESTINATION lib
26+ RUNTIME DESTINATION bin
27+ INCLUDES DESTINATION include
28+ )
29+
30+ ament_export_dependencies()
31+ ament_export_include_directories(include )
32+ ament_export_libraries(${PROJECT_NAME} )
33+
34+ ament_package()
Original file line number Diff line number Diff line change 1+ #ifndef VORTEX_UTILS_HPP
2+ #define VORTEX_UTILS_HPP
3+
4+ #include < cmath>
5+
6+ namespace vortex_utils
7+ {
8+ // @brief Function to calculate the smallest signed angle between two angles
9+ double ssa (const double angle);
10+ } // namespace vortex_utils
11+
12+ #endif // VORTEX_UTILS_HPP
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <?xml-model href =" http://download.ros.org/schema/package_format3.xsd" schematypens =" http://www.w3.org/2001/XMLSchema" ?>
3+ <package format =" 3" >
4+ <name >vortex_utils</name >
5+ <version >0.0.0</version >
6+ <description >Package containing utility functions and data structures.</description >
7+ <maintainer email =" andeshog@stud.ntnu.no" >andeshog</maintainer >
8+ <license >MIT</license >
9+
10+ <buildtool_depend >ament_cmake</buildtool_depend >
11+
12+ <export >
13+ <build_type >ament_cmake</build_type >
14+ </export >
15+ </package >
Original file line number Diff line number Diff line change 1+ #include " vortex_utils/cpp_utils.hpp"
2+
3+ double vortex_utils::ssa (const double angle)
4+ {
5+ double angle_ssa = fmod (angle + M_PI, 2 * M_PI) - M_PI;
6+ return angle_ssa;
7+ }
You can’t perform that action at this time.
0 commit comments