Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused ROS1 code from carma-utils #234

Merged
merged 6 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions .sonarqube/sonar-scanner.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,24 @@ sonar.scm.enabled=true
sonar.scm.provider=git

# Modules
sonar.modules= cav_driver_utils, \
socketcan_bridge, \
socketcan_interface, \
carma_utils, \
sonar.modules= carma_utils, \
wgs84_utils, \
motion_predict, \
uncertainty_tools
motion_predict

cav_driver_utils.sonar.projectBaseDir=/opt/carma/src/carma-utils/cav_driver_utils
socketcan_bridge.sonar.projectBaseDir=/opt/carma/src/carma-utils/socketcan_bridge
socketcan_interface.sonar.projectBaseDir=/opt/carma/src/carma-utils/socketcan_interface
carma_utils.sonar.projectBaseDir=/opt/carma/src/carma-utils/carma_utils
wgs84_utils.sonar.projectBaseDir=/opt/carma/src/carma-utils/wgs84_utils
motion_predict.sonar.projectBaseDir=/opt/carma/src/carma-utils/motion_predict
uncertainty_tools.sonar.projectBaseDir=/opt/carma/src/carma-utils/uncertainty_tools

# C++ Package differences
# Sources
cav_driver_utils.sonar.sources = src
cav_driver_utils.sonar.exclusions=test/**
socketcan_bridge.sonar.sources = src
socketcan_bridge.sonar.exclusions=test/**
socketcan_interface.sonar.sources = src
socketcan_interface.sonar.exclusions=test/**
carma_utils.sonar.sources = src
carma_utils.sonar.exclusions=test/**
wgs84_utils.sonar.sources = src
wgs84_utils.sonar.exclusions=test/**
motion_predict.sonar.sources = src
motion_predict.sonar.exclusions=test/**
uncertainty_tools.sonar.sources = src
uncertainty_tools.sonar.exclusions=test/**

# Tests
sonar.cfamily.gcov.reportsPath=/opt/carma/coverage_reports/gcov
socketcan_bridge.sonar.tests=test
socketcan_interface.sonar.tests=test
carma_utils.sonar.tests=test
motion_predict.sonar.tests=test
uncertainty_tools.sonar.tests=test
107 changes: 22 additions & 85 deletions bsm_helper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,104 +16,41 @@ cmake_minimum_required(VERSION 3.5)
project(bsm_helper)

find_package(carma_cmake_common REQUIRED)
carma_package()
MishkaMN marked this conversation as resolved.
Show resolved Hide resolved
carma_check_ros_version(2)

find_package(ros_environment REQUIRED)
set(ROS_VERSION $ENV{ROS_VERSION})
find_package(ament_cmake_auto REQUIRED)
find_package(ament_cmake_python REQUIRED)
ament_auto_find_build_dependencies()

if(${ROS_VERSION} EQUAL 1) # ROS 1

## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS

roscpp
)
## System dependencies are found with CMake's conventions
find_package(Eigen3 REQUIRED)

## The catkin_package macro generates cmake config files for your package
catkin_package(
INCLUDE_DIRS include
LIBRARIES bsm_helper
CATKIN_DEPENDS roscpp
DEPENDS EIGEN3 # Eigen is a special case where is needs to be in caps here but not in find_package
)

## Specify additional locations of header files
include_directories(
# Includes
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
)

## Declare a C++ library
add_library(bsm_helper
src/bsm_helper.cpp
)

## Add cmake target dependencies of the library
add_dependencies(bsm_helper ${catkin_EXPORTED_TARGETS})

)

## Specify libraries to link a library or executable target against
target_link_libraries(bsm_helper ${catkin_LIBRARIES})
# Build
ament_auto_add_library(bsm_helper SHARED
src/bsm_helper.cpp
)

ament_export_include_directories(include)
ament_export_libraries(bsm_helper)

## Mark executables for installation
install(TARGETS bsm_helper
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

if(BUILD_TESTING)

## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()

## Testing
catkin_add_gmock(${PROJECT_NAME}-test
test/main.cpp
ament_add_gtest(${PROJECT_NAME}-test
test/main.cpp
test/test_bsm_helper.cpp
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test # Add test directory as working directory for unit tests
)
target_link_libraries(${PROJECT_NAME}-test bsm_helper ${catkin_LIBRARIES})

else() # ROS 2

find_package(ament_cmake_auto REQUIRED)
find_package(ament_cmake_python REQUIRED)
ament_auto_find_build_dependencies()


# Includes
include_directories(
include
)

# Build
ament_auto_add_library(bsm_helper
src/bsm_helper.cpp
)

if(BUILD_TESTING)

find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()

ament_add_gtest(${PROJECT_NAME}-test
test/main.cpp
test/test_bsm_helper.cpp
)

ament_target_dependencies(${PROJECT_NAME}-test ${${PROJECT_NAME}_FOUND_TEST_DEPENDS})

target_link_libraries(${PROJECT_NAME}-test bsm_helper)

endif()
ament_target_dependencies(${PROJECT_NAME}-test ${${PROJECT_NAME}_FOUND_TEST_DEPENDS})

ament_auto_package()
target_link_libraries(${PROJECT_NAME}-test bsm_helper)

endif()

# Install
ament_auto_package()
15 changes: 6 additions & 9 deletions bsm_helper/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
<description>The bsm_helper package</description>
<maintainer email="[email protected]">carma</maintainer>
<license>Apache2</license>
<buildtool_depend condition="$ROS_VERSION == 1">catkin</buildtool_depend>
<buildtool_depend condition="$ROS_VERSION == 2">ament_cmake_auto</buildtool_depend>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<build_depend>carma_cmake_common</build_depend>

<depend condition="$ROS_VERSION == 1">roscpp</depend>
<depend condition="$ROS_VERSION == 2">rclcpp</depend>

<test_depend condition="$ROS_VERSION == 2">ament_lint_auto</test_depend>
<test_depend condition="$ROS_VERSION == 2">ament_cmake_gtest</test_depend>
<depend>rclcpp</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_cmake_gtest</test_depend>

<export>
<build_type condition="$ROS_VERSION == 2">ament_cmake</build_type>
<build_type>ament_cmake</build_type>
</export>
</package>
126 changes: 0 additions & 126 deletions cav_driver_utils/CMakeLists.txt

This file was deleted.

Loading
Loading