Skip to content

Commit

Permalink
Merge pull request ika-rwth-aachen#38 from ika-rwth-aachen/feature/cp…
Browse files Browse the repository at this point in the history
…m_utils

Adding CPM Access-Functions and RViz Plugin; and improve utils package for all message types
  • Loading branch information
jpbusch authored Oct 15, 2024
2 parents 55384e2 + bd43108 commit dde0e1b
Show file tree
Hide file tree
Showing 50 changed files with 3,373 additions and 1,376 deletions.
50 changes: 13 additions & 37 deletions etsi_its_msgs_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if(${ROS_VERSION} EQUAL 2)
find_package(etsi_its_msgs REQUIRED)
find_package(GeographicLib REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)

add_library(${PROJECT_NAME} INTERFACE)

Expand All @@ -25,10 +26,11 @@ if(${ROS_VERSION} EQUAL 2)
${etsi_its_msgs_TARGETS}
${GeographicLib_LIBRARIES}
${geometry_msgs_TARGETS}
${tf2_geometry_msgs_TARGETS}
)

ament_export_targets(${PROJECT_NAME}Targets HAS_LIBRARY_TARGET)
ament_export_dependencies(etsi_its_msgs geometry_msgs)
ament_export_dependencies(etsi_its_msgs geometry_msgs tf2_geometry_msgs)

install(DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
Expand All @@ -44,39 +46,16 @@ if(${ROS_VERSION} EQUAL 2)

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest(${PROJECT_NAME}-cam_test test/test_cam_access.ros2.cpp)
target_include_directories(${PROJECT_NAME}-cam_test PUBLIC
ament_add_gtest(${PROJECT_NAME}-test test/test_access.ros2.cpp)
target_include_directories(${PROJECT_NAME}-test PUBLIC test
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(${PROJECT_NAME}-cam_test PUBLIC test)
ament_target_dependencies(${PROJECT_NAME}-cam_test
etsi_its_msgs
GeographicLib
geometry_msgs
)
find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest(${PROJECT_NAME}-cam_ts_test test/test_cam_ts_access.ros2.cpp)
target_include_directories(${PROJECT_NAME}-cam_ts_test PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(${PROJECT_NAME}-cam_ts_test PUBLIC test)
ament_target_dependencies(${PROJECT_NAME}-cam_ts_test
etsi_its_msgs
GeographicLib
geometry_msgs
)
ament_add_gtest(${PROJECT_NAME}-denm_test test/test_denm_access.ros2.cpp)
target_include_directories(${PROJECT_NAME}-denm_test PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(${PROJECT_NAME}-denm_test PUBLIC test)
ament_target_dependencies(${PROJECT_NAME}-denm_test
ament_target_dependencies(${PROJECT_NAME}-test
etsi_its_msgs
GeographicLib
geometry_msgs
tf2_geometry_msgs
)
endif()

Expand All @@ -90,6 +69,7 @@ elseif(${ROS_VERSION} EQUAL 1)
find_package(catkin REQUIRED COMPONENTS
etsi_its_msgs
geometry_msgs
tf2_geometry_msgs
)

find_package(GeographicLib REQUIRED)
Expand All @@ -100,6 +80,7 @@ elseif(${ROS_VERSION} EQUAL 1)
CATKIN_DEPENDS
etsi_its_msgs
geometry_msgs
tf2_geometry_msgs
)

include_directories(
Expand All @@ -113,15 +94,10 @@ elseif(${ROS_VERSION} EQUAL 1)
)

if(CATKIN_ENABLE_TESTING)
catkin_add_gtest(${PROJECT_NAME}-cam_test test/test_cam_access.cpp)
catkin_add_gtest(${PROJECT_NAME}-denm_test test/test_denm_access.cpp)
if(TARGET ${PROJECT_NAME}-cam_test)
target_include_directories(${PROJECT_NAME}-cam_test PUBLIC test)
target_link_libraries(${PROJECT_NAME}-cam_test ${GeographicLib_LIBRARIES} ${catkin_LIBRARIES})
endif()
if(TARGET ${PROJECT_NAME}-denm_test)
target_include_directories(${PROJECT_NAME}-denm_test PUBLIC test)
target_link_libraries(${PROJECT_NAME}-denm_test ${GeographicLib_LIBRARIES} ${catkin_LIBRARIES})
catkin_add_gtest(${PROJECT_NAME}-test test/test_access.cpp)
if(TARGET ${PROJECT_NAME}-test)
target_include_directories(${PROJECT_NAME}-test PUBLIC test)
target_link_libraries(${PROJECT_NAME}-test ${GeographicLib_LIBRARIES} ${catkin_LIBRARIES})
endif()
endif()

Expand Down
48 changes: 48 additions & 0 deletions etsi_its_msgs_utils/include/etsi_its_msgs_utils/cpm_ts_access.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
=============================================================================
MIT License
Copyright (c) 2023-2024 Institute for Automotive Engineering (ika), RWTH Aachen University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=============================================================================
*/

/**
* @file cpm_ts_access.h
* @brief Main CPM access header to include in ROS 1 projects
*/

#pragma once

// Messages
#include <etsi_its_cpm_ts_msgs/CollectivePerceptionMessage.h>
#include <geometry_msgs/PointStamped.h>
#include <geometry_msgs/Pose.h>
#include <geometry_msgs/PoseWithCovariance.h>
#include <geometry_msgs/Quaternion.h>
#include <geometry_msgs/Vector3.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>

namespace etsi_its_cpm_ts_msgs {
namespace gm = geometry_msgs;
}

// Implementation
#include <etsi_its_msgs_utils/impl/cpm/cpm_ts_access.h>
49 changes: 49 additions & 0 deletions etsi_its_msgs_utils/include/etsi_its_msgs_utils/cpm_ts_access.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
=============================================================================
MIT License
Copyright (c) 2023-2024 Institute for Automotive Engineering (ika), RWTH Aachen University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=============================================================================
*/

/**
* @file cpm_ts_access.hpp
* @brief Main CPM access header to include in ROS 2 projects
*/

#pragma once

// Messages
#include <etsi_its_cpm_ts_msgs/msg/collective_perception_message.hpp>
#include <geometry_msgs/msg/point_stamped.hpp>
#include <geometry_msgs/msg/pose.hpp>
#include <geometry_msgs/msg/pose_with_covariance.hpp>
#include <geometry_msgs/msg/quaternion.hpp>
#include <geometry_msgs/msg/vector3.hpp>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>

namespace etsi_its_cpm_ts_msgs {
using namespace msg;
namespace gm = geometry_msgs::msg;
} // namespace etsi_its_cpm_ts_msgs

// Implementation
#include <etsi_its_msgs_utils/impl/cpm/cpm_ts_access.h>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ SOFTWARE.
* @brief Main CAM access implementation header
*/

#undef ETSI_ITS_MSGS_UTILS_IMPL_CAM_CAM_GETTERS_COMMON_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CAM_CAM_SETTERS_COMMON_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CAM_CAM_UTILS_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_CHECKS_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_GETTERS_COMMON_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_SETTERS_COMMON_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V1_3_1_GETTERS_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V1_3_1_SETTERS_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V2_1_1_GETTERS_H
#undef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V2_1_1_SETTERS_H

#pragma once

#include <cstring>
Expand All @@ -42,4 +53,4 @@ SOFTWARE.

namespace etsi_its_cam_msgs::access {
#include <etsi_its_msgs_utils/impl/cam/cam_utils.h>
} // namespace etsi_its_cam_msgs::access
} // namespace etsi_its_cam_msgs::access
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ SOFTWARE.

namespace etsi_its_cam_msgs::access {
#include <etsi_its_msgs_utils/impl/cdd/cdd_v1-3-1_getters.h>

#include <etsi_its_msgs_utils/impl/cam/cam_getters_common.h>
} // namespace etsi_its_cam_msgs::access
} // namespace etsi_its_cam_msgs::access
Loading

0 comments on commit dde0e1b

Please sign in to comment.