Conversation
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
|
Nice to see this, will review soon! |
ament_index_cpp/src/has_resource.cpp
Outdated
| auto resource_path = path + "/share/ament_index/resource_index/" + | ||
| resource_type + "/" + resource_name; |
There was a problem hiding this comment.
| auto resource_path = path + "/share/ament_index/resource_index/" + | |
| resource_type + "/" + resource_name; | |
| auto resource_path = path / "share" / "ament_index" / "resource_index" / | |
| resource_type / resource_name; |
Would it be time to also do changes like this?
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
|
There is still one function which required deprecation which is |
|
@ros-pull-request-builder retest this please |
|
do you mind to take a look ? @mjcarroll @asymingt |
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
|
Pulls: ros/pluginlib#289, #104, ros/resource_retriever#118, ros/ros_tutorials#190, ros-perception/image_common#388, ros2/rclcpp#3011, ros2/rmw_implementation#272, ros2/rmw_zenoh#879, ros2/rosbag2#2268, ros2/rviz#1647 |
| * \throws std::runtime_error if resource_type or resource_name are empty. | ||
| */ | ||
| AMENT_INDEX_CPP_PUBLIC | ||
| std::pair<std::optional<std::filesystem::path>, std::string> |
There was a problem hiding this comment.
I am not the biggest fan of std::pair as return type.
A small struct like
| std::pair<std::optional<std::filesystem::path>, std::string> | |
| struct PathWithResource | |
| { | |
| std::optional<std::filesystem::path> resourcePath; | |
| // ? | |
| std::string contents; | |
| } |
is nicer and makes the code using the return type way more understandable.
Also from the documentation I can't figure out what contents is / should contain.
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
|
Pulls: ros/pluginlib#289, #104, ros/resource_retriever#118, ros/ros_tutorials#190, ros-perception/image_common#388, ros2/rclcpp#3011, ros2/rmw_implementation#272, ros2/rmw_zenoh#879, ros2/rosbag2#2268, ros2/rviz#1647 |
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
|
Would you consider backporting this (without the deprecations) to Jazzy and Kilted? It seems to me most of the changes are just adding new free functions, so it should be API and ABI compatible. |
|
@peci1 I don't see a reason against it, feel free to open a PR |
|
I thought mergifio could do it, but I can't task it =) |
|
Mergify won't filter out the deprecation, therefore it needs to be a manual backport |
|
Okay, I'll have a look ;) |
You can use mergify to start and then edit the code before merge. |
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
|
Okay, I went with Jazzy manually: #109 . I'll do Kilted once Jazzy is merged. |
(cherry picked from commit 1bba98c) Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Martin Pecka <peckama2@fel.cvut.cz> Co-authored-by: Martin Pecka <peci1@seznam.cz> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
| */ | ||
| AMENT_INDEX_CPP_PUBLIC | ||
| void | ||
| get_package_prefix(const std::string & package_name, std::filesystem::path & path); |
There was a problem hiding this comment.
Why is the result an argument and not an output of the function?
Now my code is more verbose because I need to construct an empty path first to pass it to this function.
This:
auto dbc = ament_index_cpp::get_package_share_directory("can_dbc_pkg") + "/test/motohawk.dbc";Becomes this:
std::filesystem::path package_path;
ament_index_cpp::get_package_share_directory("can_dbc_pkg", package_path);
auto dbc = package_path / "test" / "motohawk.dbc";To keep ABI perhaps we could have also just created a different function name? How about get_package_share_path:
auto dbc = ament_index_cpp::get_package_share_path("can_dbc_pkg") / "test" / "motohawk.dbc";There was a problem hiding this comment.
I think this was because you can't have two functions with the same args and different result type. So there was need to distinguish the new API somehow else.
But I agree the solution with renaming the function is much friendlier.
Migrate to non-deprecated ament_index_cpp APIs introduced in ament/ament_index#104 to fix -Werror=deprecated-declarations errors. Signed-off-by: Daisuke Sato <tiryoh@gmail.com>
Temporarily disable deprecation warning-as-error for QT and ament_target_dependencies deprecation warnings
…:path (#3703) * Update deprecated usage of get_package_share * Add include guards for ament/ament_index#104 --------- Co-authored-by: Stephanie Eng <seng@ottomotors.com> Co-authored-by: Nathan Brooks <nathanbrooks@picknik.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Related with this issue #92
@Ryanf55 FYI