Skip to content

Commit

Permalink
Remove unused ROS1 code from carma-utils (#234)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description
This PR removes unused ROS1 code as most of the code is migrated to ROS2
foxy.
<!--- Describe your changes in detail -->
**Kept:**
**carma_utils** is used by carma_record
**driver_shutdown** is needed for ROS1 driver launch files

**Removed:**
**cav_driver_utils** is used by ros1 drivers, but all of them are
deprecated except the ssc driver. Therefore it was also moved to[ ssc
wrapper
repo](usdot-fhwa-stol/carma-ssc-interface-wrapper#161)
along with socketcan_bridge
**socketcan_bridge** and **socketcan_interface** is used by pacifica's
dbw controller, so factored into that[ repo
here](usdot-fhwa-stol/carma-ssc-interface-wrapper#161).
**wgs84_utils_ros1** is removed because ROS2 exists.
**bsm_helper** is ROS1 and ROS2 of which ROS1 can be removed. 
**uncertainty_tools** is ROS1/ROS2 of which ROS1 can be removed. NOTE:
[novatel_gps_driver](https://github.com/usdot-fhwa-stol/novatel_gps_driver)
depends on this as ROS1. However, the repo is no longer used and should
probably be archived.
**sigpack:** NOTE: it is dependency for carma-vehicle-model-framework,
but that repo has not been updated for 3 years, is not used anywhere
yet, and no plans to develop for it in the future. We can add it back if
needed. Tracking the issue on:
usdot-fhwa-stol/carma-platform#2433
**trajectory_utils.** trajectory_utils_ros2 should be renamed to just
trajectory_utils in a different PR.


## Related GitHub Issue
usdot-fhwa-stol/carma-platform#2079
<!--- This project only accepts pull requests related to open GitHub
issues or Jira Keys -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please DO NOT name partially fixed issues, instead open an issue
specific to this fix -->
<!--- Please link to the issue here: -->

## Related Jira Key
[ARC-146](https://usdot-carma.atlassian.net/browse/ARC-146)
<!-- e.g. CAR-123 -->

## Motivation and Context
Migration to Foxy
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
Built carma-platform on local VM
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Defect fix (non-breaking change that fixes an issue)
- [X] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [X] I have added any new packages to the sonar-scanner.properties file
- [X] My change requires a change to the documentation.
- [X] I have updated the documentation accordingly.
- [X] I have read the
[**CONTRIBUTING**](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)
document.
- [X] I have added tests to cover my changes.
- [X] All new and existing tests passed.


[CAR-146]:
https://usdot-carma.atlassian.net/browse/CAR-146?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

[ARC-146]:
https://usdot-carma.atlassian.net/browse/ARC-146?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
MishkaMN authored Sep 11, 2024
1 parent e4ccd6f commit e84506b
Show file tree
Hide file tree
Showing 142 changed files with 51 additions and 19,736 deletions.
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
106 changes: 22 additions & 84 deletions bsm_helper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,104 +16,42 @@ cmake_minimum_required(VERSION 3.5)
project(bsm_helper)

find_package(carma_cmake_common REQUIRED)
carma_check_ros_version(2)
carma_package()

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="carma@dot.gov">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

0 comments on commit e84506b

Please sign in to comment.