Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 12 additions & 7 deletions moveit_core/utils/src/robot_model_test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@

/* Author: Bryce Willey */

#include <rclcpp/version.h>

// For Rolling, L-turtle, and newer
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is backported

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stand corrected... It's not.

#if RCLCPP_VERSION_GTE(30, 0, 0)
#include <ament_index_cpp/get_package_share_path.hpp>
#else
#include <ament_index_cpp/get_package_share_directory.hpp>
#endif
#include <boost/algorithm/string_regex.hpp>
#include <filesystem>
#include <geometry_msgs/msg/pose.hpp>
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
{
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 9 additions & 3 deletions moveit_ros/planning/rdf_loader/src/rdf_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@

/* Author: Ioan Sucan, Mathias Lüdtke, Dave Coleman */

#include <rclcpp/version.h>

// MoveIt
#include <moveit/rdf_loader/rdf_loader.hpp>
#include <std_msgs/msg/string.hpp>
#include <ament_index_cpp/get_package_prefix.hpp>
// For Rolling, L-turtle, and newer
#if RCLCPP_VERSION_GTE(30, 0, 0)
#include <ament_index_cpp/get_package_share_path.hpp>
#else
#include <ament_index_cpp/get_package_share_directory.hpp>
#endif
#include <moveit/utils/logger.hpp>

#include <rclcpp/duration.hpp>
Expand Down Expand Up @@ -217,18 +224,17 @@ 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<std::string>& 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)
{
RCLCPP_ERROR(getLogger(), "ament_index_cpp: %s", e.what());
return false;
}

std::filesystem::path path(package_path);
path = path / relative_path;

return loadXmlFileToString(buffer, path.string(), xacro_args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,15 @@

#pragma once

#include <rclcpp/version.h>

#include <ament_index_cpp/get_package_prefix.hpp>
// For Rolling, L-turtle, and newer
#if RCLCPP_VERSION_GTE(30, 0, 0)
#include <ament_index_cpp/get_package_share_path.hpp>
#else
#include <ament_index_cpp/get_package_share_directory.hpp>
#endif
#include <filesystem>
#include <string>
#include <tinyxml2.h>
Expand All @@ -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)
{
Expand Down
Loading