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

feat(ar_tag_based_localizer): componentize ArTagBasedLocalizer #7187

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 @@ -14,27 +14,33 @@ ament_auto_find_build_dependencies()

find_package(OpenCV REQUIRED)

ament_auto_add_executable(ar_tag_based_localizer
src/main.cpp
ament_auto_add_library(${PROJECT_NAME} SHARED
src/ar_tag_based_localizer.cpp
)
target_include_directories(ar_tag_based_localizer

target_include_directories(${PROJECT_NAME}
SYSTEM PUBLIC
${OpenCV_INCLUDE_DIRS}
)
target_link_libraries(ar_tag_based_localizer ${OpenCV_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBRARIES})

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "ArTagBasedLocalizer"
EXECUTABLE ${PROJECT_NAME}_node
EXECUTOR SingleThreadedExecutor
)

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
ament_auto_add_gtest(test_ar_tag_based_localizer
ament_auto_add_gtest(test_${PROJECT_NAME}
test/test.cpp
src/ar_tag_based_localizer.cpp
)
target_include_directories(test_ar_tag_based_localizer
target_include_directories(test_${PROJECT_NAME}
SYSTEM PUBLIC
${OpenCV_INCLUDE_DIRS}
)
target_link_libraries(test_ar_tag_based_localizer ${OpenCV_LIBRARIES})
target_link_libraries(test_${PROJECT_NAME} ${OpenCV_LIBRARIES})
endif()

ament_auto_package(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<arg name="debug_mapped_tag" default="~/debug/mapped_tag"/>
<arg name="debug_detected_tag" default="~/debug/detected_tag"/>

<node pkg="ar_tag_based_localizer" exec="ar_tag_based_localizer" name="$(var node_name)" output="log">
<node pkg="ar_tag_based_localizer" exec="ar_tag_based_localizer_node" name="$(var node_name)" output="both">
<remap from="~/input/lanelet2_map" to="$(var input_lanelet2_map)"/>
<remap from="~/input/image" to="$(var input_image)"/>
<remap from="~/input/camera_info" to="$(var input_camera_info)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<depend>lanelet2_extension</depend>
<depend>localization_util</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tf2_eigen</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tf2_ros</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#include <tier4_autoware_utils/geometry/geometry.hpp>

ArTagBasedLocalizer::ArTagBasedLocalizer(const rclcpp::NodeOptions & options)
: Node("ar_tag_based_localizer", options), cam_info_received_(false)
: rclcpp::Node("ar_tag_based_localizer", options), cam_info_received_(false)
{
/*
Declare node parameters
Expand Down Expand Up @@ -346,3 +346,6 @@ std::vector<landmark_manager::Landmark> ArTagBasedLocalizer::detect_landmarks(

return landmarks;
}

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(ArTagBasedLocalizer)

This file was deleted.

Loading