Skip to content

Commit

Permalink
refactor(pose_instability_detector, ar_tag_based_localizer): specify …
Browse files Browse the repository at this point in the history
…file path using get_package_share_directory (#5588)

* use get_package_share_directory

Signed-off-by: Kento Yabuuchi <[email protected]>

* use get_package_share_directory in pose_instability_detector

Signed-off-by: Kento Yabuuchi <[email protected]>

---------

Signed-off-by: Kento Yabuuchi <[email protected]>
  • Loading branch information
KYabuuchi authored Nov 15, 2023
1 parent 017aed4 commit b5d6c51
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>aruco</depend>
<depend>cv_bridge</depend>
<depend>diagnostic_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "../src/ar_tag_based_localizer.hpp"

#include <ament_index_cpp/get_package_share_directory.hpp>
#include <rclcpp/rclcpp.hpp>

#include <gtest/gtest.h>
Expand All @@ -29,8 +30,8 @@ class TestArTagBasedLocalizer : public ::testing::Test
void SetUp() override
{
const std::string yaml_path =
"../../install/ar_tag_based_localizer/share/ar_tag_based_localizer/config/"
"ar_tag_based_localizer.param.yaml";
ament_index_cpp::get_package_share_directory("ar_tag_based_localizer") +
"/config/ar_tag_based_localizer.param.yaml";

rcl_params_t * params_st = rcl_yaml_node_struct_init(rcl_get_default_allocator());
if (!rcl_parse_yaml_file(yaml_path.c_str(), params_st)) {
Expand Down
1 change: 1 addition & 0 deletions localization/pose_instability_detector/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>diagnostic_msgs</depend>
<depend>geometry_msgs</depend>
<depend>nav_msgs</depend>
Expand Down
5 changes: 3 additions & 2 deletions localization/pose_instability_detector/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "../src/pose_instability_detector.hpp"
#include "test_message_helper_node.hpp"

#include <ament_index_cpp/get_package_share_directory.hpp>
#include <rclcpp/rclcpp.hpp>

#include <gtest/gtest.h>
Expand All @@ -35,8 +36,8 @@ class TestPoseInstabilityDetector : public ::testing::Test
void SetUp() override
{
const std::string yaml_path =
"../../install/pose_instability_detector/share/pose_instability_detector/config/"
"pose_instability_detector.param.yaml";
ament_index_cpp::get_package_share_directory("pose_instability_detector") +
"/config/pose_instability_detector.param.yaml";

rcl_params_t * params_st = rcl_yaml_node_struct_init(rcl_get_default_allocator());
if (!rcl_parse_yaml_file(yaml_path.c_str(), params_st)) {
Expand Down

0 comments on commit b5d6c51

Please sign in to comment.