Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(pose_instability_detector, ar_tag_based_localizer): specify file path using get_package_share_directory #5588

Merged
Merged
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
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
Loading