Skip to content

Commit 7e2a9e7

Browse files
authored
split utils ros packages (#28)
* split utils ros packages * moved scripts folder to parent
1 parent f9627f5 commit 7e2a9e7

36 files changed

Lines changed: 288 additions & 98 deletions

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,36 @@
44
[![codecov](https://codecov.io/github/vortexntnu/vortex-utils/graph/badge.svg?token=d6D7d5xNdf)](https://codecov.io/github/vortexntnu/vortex-utils)
55

66
This package contains common definitions and often-used utility functions in C++ and Python.
7+
It consist of the packages `vortex_utils`, `vortex_utils_ros` and `vortex_utils_ros_tf`
78

89
# Usage
910

11+
CMake:
12+
13+
```CMake
14+
find_package(vortex_utils REQUIRED)
15+
16+
# For ROS utils
17+
find_package(vortex_utils_ros REQUIRED)
18+
find_package(vortex_utils_ros_tf REQUIRED)
19+
```
20+
For cpp packages link against the target:
21+
```CMake
22+
target_link_libraries(my_target vortex_utils)
23+
24+
# ROS libraries
25+
target_link_libraries(my_target vortex_utils_ros)
26+
# ROS tf2 transform library
27+
target_link_libraries(my_target vortex_utils_ros_tf)
28+
29+
```
1030
In Python, import your desired function/dataclass like for example:
1131
```python
1232
from vortex_utils.python_utils import ssa
1333
```
34+
To import from `vortex_utils_ros`
1435
```python
15-
from vortex_utils.qos_profiles import sensor_data_profile, reliable_profile
36+
from vortex_utils_ros.qos_profiles import sensor_data_profile, reliable_profile
1637
```
1738

1839
In C++, include
@@ -21,10 +42,10 @@ In C++, include
2142
```
2243
for mathematical functions,
2344
```C++
24-
#include <vortex/utils/qos_profiles.hpp>
25-
```
26-
for common QoS profile definitions, and
27-
```C++
2845
#include <vortex/utils/types.hpp>
2946
```
3047
for common structs like 6DOF `PoseEuler`, `Pose` and `Twist`.
48+
```C++
49+
#include <vortex/utils/ros/qos_profiles.hpp>
50+
```
51+
for common QoS profile definitions from from `vortex_utils_ros`

cpp_test/test_main.cpp

Lines changed: 0 additions & 6 deletions
This file was deleted.

CMakeLists.txt renamed to vortex_utils/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,8 @@ set(CMAKE_CXX_STANDARD 20)
55
add_compile_options(-Wall -Wextra -Wpedantic)
66

77
find_package(ament_cmake REQUIRED)
8-
find_package(rclcpp REQUIRED)
98
find_package(ament_cmake_python REQUIRED)
109
find_package(Eigen3 REQUIRED)
11-
find_package(tf2 REQUIRED)
12-
find_package(tf2_ros REQUIRED)
13-
find_package(tf2_geometry_msgs REQUIRED)
14-
find_package(geometry_msgs REQUIRED)
15-
16-
include_directories(include)
1710

1811
add_library(${PROJECT_NAME} SHARED
1912
src/math.cpp)
@@ -23,12 +16,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
2316
$<INSTALL_INTERFACE:include>)
2417

2518
ament_target_dependencies(${PROJECT_NAME} PUBLIC
26-
rclcpp
2719
Eigen3
28-
tf2
29-
tf2_ros
30-
tf2_geometry_msgs
31-
geometry_msgs
3220
)
3321

3422
ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 3.8)
22

33
find_package(GTest REQUIRED)
4+
find_package(Eigen3 REQUIRED)
45
include(GoogleTest)
56

67
set(TEST_BINARY_NAME ${PROJECT_NAME}_test)
@@ -9,7 +10,6 @@ add_executable(
910
test_math.cpp
1011
test_types.cpp
1112
test_concepts.cpp
12-
test_ros_conversions.cpp
1313
)
1414

1515
target_link_libraries(
@@ -23,26 +23,3 @@ target_link_libraries(
2323
ament_target_dependencies(${TEST_BINARY_NAME} PUBLIC Eigen3)
2424

2525
gtest_discover_tests(${TEST_BINARY_NAME})
26-
27-
set(TEST_BINARY_ROS_NAME ${PROJECT_NAME}_ros_test)
28-
29-
add_executable(
30-
${TEST_BINARY_ROS_NAME}
31-
test_ros_transforms.cpp
32-
)
33-
34-
target_link_libraries(
35-
${TEST_BINARY_ROS_NAME}
36-
${PROJECT_NAME}
37-
GTest::GTest
38-
)
39-
40-
ament_target_dependencies(
41-
${TEST_BINARY_ROS_NAME}
42-
rclcpp
43-
tf2
44-
tf2_ros
45-
tf2_geometry_msgs
46-
)
47-
48-
gtest_discover_tests(${TEST_BINARY_ROS_NAME})
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)