Skip to content

Commit a7523e9

Browse files
committed
feat: update test_pub_msg function to not use setpublisher function
Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
1 parent cd28fc5 commit a7523e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

common/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ void createPublisherWithQoS(
412412
qos.transient_local();
413413
publisher = rclcpp::create_publisher<T>(test_node, topic_name, qos);
414414
} else {
415-
// publisher is already created. Do nothing
415+
publisher = rclcpp::create_publisher<T>(test_node, topic_name, 1);
416416
}
417417
}
418418

@@ -562,7 +562,9 @@ class AutowareTestManager
562562
auto publisher =
563563
std::dynamic_pointer_cast<rclcpp::Publisher<MessageType>>(publishers_[topic_name]);
564564

565-
autoware::test_utils::publishToTargetNode(test_node_, target_node, topic_name, publisher, msg);
565+
publisher->publish(msg);
566+
const int repeat_count = 3;
567+
autoware::test_utils::spinSomeNodes(test_node_, target_node, repeat_count);
566568
RCLCPP_INFO(test_node_->get_logger(), "Published message on topic '%s'", topic_name.c_str());
567569
}
568570

0 commit comments

Comments
 (0)