Skip to content

Remove deprecated get_package_share_directory#71

Closed
fmrico wants to merge 1 commit into
rollingfrom
fix_deprecated_get_package_path
Closed

Remove deprecated get_package_share_directory#71
fmrico wants to merge 1 commit into
rollingfrom
fix_deprecated_get_package_path

Conversation

@fmrico

@fmrico fmrico commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Hi,

This PR remove deprecated get_package_share_directory, replacing by get_package_share_path

Best

Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
Copilot AI review requested due to automatic review settings July 18, 2026 18:26
@fmrico fmrico closed this Jul 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the map manager plugins to stop using the deprecated ament_index_cpp::get_package_share_directory() API by switching to ament_index_cpp::get_package_share_path() and std::filesystem path composition for building map file paths.

Changes:

  • Replaced get_package_share_directory() with get_package_share_path() across the updated map managers.
  • Switched string path concatenation to std::filesystem::path joining for map file resolution.
  • Added <filesystem> includes where needed to support the new path API.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
maps_managers/easynav_simple_maps_manager/src/easynav_simple_maps_manager/SimpleMapsManager.cpp Use get_package_share_path() and std::filesystem for map path construction.
maps_managers/easynav_routes_maps_manager/src/easynav_routes_maps_manager/RoutesMapsManager.cpp Use get_package_share_path() and std::filesystem join for route YAML path.
maps_managers/easynav_navmap_maps_manager/src/easynav_navmap_maps_manager/NavMapMapsManager.cpp Use get_package_share_path() and std::filesystem for occ/nav map file paths.
maps_managers/easynav_costmap_maps_manager/src/easynav_costmap_maps_manager/CostmapMapsManager.cpp Use get_package_share_path() and std::filesystem for costmap YAML path.
maps_managers/easynav_bonxai_maps_manager/src/easynav_bonxai_maps_manager/BonxaiMapsManager.cpp Use get_package_share_path() and std::filesystem for bonxai/occ map paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to 25
#include "ament_index_cpp/get_package_share_path.hpp"
#include "ament_index_cpp/get_package_prefix.hpp"
Comment on lines +67 to +68
pkgpath = ament_index_cpp::get_package_share_path(package_name);
map_path_ = (pkgpath / map_path_file).string();
Comment on lines +114 to +115
const std::filesystem::path pkgpath = ament_index_cpp::get_package_share_path(package_name);
map_path_ = (pkgpath / map_path_file).string();
Comment on lines +126 to +127
const std::filesystem::path pkgpath = ament_index_cpp::get_package_share_path(package_name);
map_path_ = (pkgpath / occmap_path_file).string();
Comment on lines +149 to +150
const std::filesystem::path pkgpath = ament_index_cpp::get_package_share_path(package_name);
map_path_ = (pkgpath / navmap_path_file).string();
Comment on lines +77 to +78
const std::filesystem::path pkgpath = ament_index_cpp::get_package_share_path(package_name);
map_path_ = (pkgpath / bonxai_path_file).string();
Comment on lines +110 to +111
const std::filesystem::path pkgpath = ament_index_cpp::get_package_share_path(package_name);
map_path_ = (pkgpath / occmap_path_file).string();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants