From bc710892d4b30ce14163a59645ad79150501dbd1 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 16 Mar 2024 11:00:36 +0100 Subject: [PATCH] resolve topic name before applying the image transport suffix --- src/AprilTagNode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/AprilTagNode.cpp b/src/AprilTagNode.cpp index 5be0d32..5f646a3 100644 --- a/src/AprilTagNode.cpp +++ b/src/AprilTagNode.cpp @@ -98,7 +98,12 @@ AprilTagNode::AprilTagNode(const rclcpp::NodeOptions& options) cb_parameter(add_on_set_parameters_callback(std::bind(&AprilTagNode::onParameter, this, std::placeholders::_1))), td(apriltag_detector_create()), // topics - sub_cam(image_transport::create_camera_subscription(this, "image_rect", std::bind(&AprilTagNode::onCamera, this, std::placeholders::_1, std::placeholders::_2), declare_parameter("image_transport", "raw", descr({}, true)), rmw_qos_profile_sensor_data)), + sub_cam(image_transport::create_camera_subscription( + this, + this->get_node_topics_interface()->resolve_topic_name("image_rect"), + std::bind(&AprilTagNode::onCamera, this, std::placeholders::_1, std::placeholders::_2), + declare_parameter("image_transport", "raw", descr({}, true)), + rmw_qos_profile_sensor_data)), pub_detections(create_publisher("detections", rclcpp::QoS(1))), tf_broadcaster(this) {