diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3db7ac94d6..fead192996 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld -DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'Debug' || 'Release'}} - -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS${{ matrix.env.CCOV && ' --coverage -O2 -fno-omit-frame-pointer' || ''}}" + -DCMAKE_CXX_FLAGS="-Werror -Wno-error=deprecated-declarations $CXXFLAGS${{ matrix.env.CCOV && ' --coverage -O2 -fno-omit-frame-pointer' || ''}}" UPSTREAM_CMAKE_ARGS: "-DCMAKE_CXX_FLAGS=''" DOWNSTREAM_CMAKE_ARGS: -DCMAKE_CXX_FLAGS="-Wall -Wextra" CCACHE_DIR: ${{ github.workspace }}/.ccache diff --git a/moveit_core/utils/src/robot_model_test_utils.cpp b/moveit_core/utils/src/robot_model_test_utils.cpp index eea311fbec..b9442d830e 100644 --- a/moveit_core/utils/src/robot_model_test_utils.cpp +++ b/moveit_core/utils/src/robot_model_test_utils.cpp @@ -34,7 +34,14 @@ /* Author: Bryce Willey */ +#include + +// For Rolling, L-turtle, and newer +#if RCLCPP_VERSION_GTE(30, 0, 0) +#include +#else #include +#endif #include #include #include @@ -64,10 +71,8 @@ moveit::core::RobotModelPtr loadTestingRobotModel(const std::string& package_nam const std::string& urdf_relative_path, const std::string& srdf_relative_path) { - const auto urdf_path = - std::filesystem::path(ament_index_cpp::get_package_share_directory(package_name)) / urdf_relative_path; - const auto srdf_path = - std::filesystem::path(ament_index_cpp::get_package_share_directory(package_name)) / srdf_relative_path; + const auto urdf_path = ament_index_cpp::get_package_share_path(package_name) / urdf_relative_path; + const auto srdf_path = ament_index_cpp::get_package_share_path(package_name) / srdf_relative_path; urdf::ModelInterfaceSharedPtr urdf_model = urdf::parseURDFFile(urdf_path.string()); if (urdf_model == nullptr) @@ -95,7 +100,7 @@ moveit::core::RobotModelPtr loadTestingRobotModel(const std::string& robot_name) urdf::ModelInterfaceSharedPtr loadModelInterface(const std::string& robot_name) { const std::string package_name = "moveit_resources_" + robot_name + "_description"; - std::filesystem::path res_path(ament_index_cpp::get_package_share_directory(package_name)); + std::filesystem::path res_path = ament_index_cpp::get_package_share_path(package_name); std::string urdf_path; if (robot_name == "pr2") { @@ -123,13 +128,13 @@ srdf::ModelSharedPtr loadSRDFModel(const std::string& robot_name) if (robot_name == "pr2") { const std::string package_name = "moveit_resources_" + robot_name + "_description"; - std::filesystem::path res_path(ament_index_cpp::get_package_share_directory(package_name)); + std::filesystem::path res_path = ament_index_cpp::get_package_share_path(package_name); srdf_path = (res_path / "srdf/robot.xml").string(); } else { const std::string package_name = "moveit_resources_" + robot_name + "_moveit_config"; - std::filesystem::path res_path(ament_index_cpp::get_package_share_directory(package_name)); + std::filesystem::path res_path = ament_index_cpp::get_package_share_path(package_name); srdf_path = (res_path / "config" / (robot_name + ".srdf")).string(); } srdf_model->initFile(*urdf_model, srdf_path); diff --git a/moveit_ros/planning/rdf_loader/src/rdf_loader.cpp b/moveit_ros/planning/rdf_loader/src/rdf_loader.cpp index de43e05744..82fad4ac8e 100644 --- a/moveit_ros/planning/rdf_loader/src/rdf_loader.cpp +++ b/moveit_ros/planning/rdf_loader/src/rdf_loader.cpp @@ -34,11 +34,18 @@ /* Author: Ioan Sucan, Mathias Lüdtke, Dave Coleman */ +#include + // MoveIt #include #include #include +// For Rolling, L-turtle, and newer +#if RCLCPP_VERSION_GTE(30, 0, 0) +#include +#else #include +#endif #include #include @@ -217,10 +224,10 @@ bool RDFLoader::loadXmlFileToString(std::string& buffer, const std::string& path bool RDFLoader::loadPkgFileToString(std::string& buffer, const std::string& package_name, const std::string& relative_path, const std::vector& xacro_args) { - std::string package_path; + std::filesystem::path path; try { - package_path = ament_index_cpp::get_package_share_directory(package_name); + path = ament_index_cpp::get_package_share_path(package_name); } catch (const ament_index_cpp::PackageNotFoundError& e) { @@ -228,7 +235,6 @@ bool RDFLoader::loadPkgFileToString(std::string& buffer, const std::string& pack return false; } - std::filesystem::path path(package_path); path = path / relative_path; return loadXmlFileToString(buffer, path.string(), xacro_args); diff --git a/moveit_setup_assistant/moveit_setup_framework/include/moveit_setup_framework/utilities.hpp b/moveit_setup_assistant/moveit_setup_framework/include/moveit_setup_framework/utilities.hpp index ace3237c6b..455d9a3ae6 100644 --- a/moveit_setup_assistant/moveit_setup_framework/include/moveit_setup_framework/utilities.hpp +++ b/moveit_setup_assistant/moveit_setup_framework/include/moveit_setup_framework/utilities.hpp @@ -36,8 +36,15 @@ #pragma once +#include + #include +// For Rolling, L-turtle, and newer +#if RCLCPP_VERSION_GTE(30, 0, 0) +#include +#else #include +#endif #include #include #include @@ -52,7 +59,7 @@ inline std::filesystem::path getSharePath(const std::string& package_name) { try { - return std::filesystem::path(ament_index_cpp::get_package_share_directory(package_name)); + return ament_index_cpp::get_package_share_path(package_name); } catch (const std::runtime_error& e) {