From 4f345628784a7c80940947c7ba4e0fae566355df Mon Sep 17 00:00:00 2001 From: ChenYing Kuo Date: Sat, 23 May 2020 04:14:48 +0800 Subject: [PATCH] Make sure rmw_publisher_options is initialized in to_rcl_publisher_options. (#1099) Signed-off-by: ChenYing Kuo --- rclcpp/include/rclcpp/publisher_options.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rclcpp/include/rclcpp/publisher_options.hpp b/rclcpp/include/rclcpp/publisher_options.hpp index dd24718..9547b34 100644 --- a/rclcpp/include/rclcpp/publisher_options.hpp +++ b/rclcpp/include/rclcpp/publisher_options.hpp @@ -71,7 +71,7 @@ struct PublisherOptionsWithAllocator : public PublisherOptionsBase rcl_publisher_options_t to_rcl_publisher_options(const rclcpp::QoS & qos) const { - rcl_publisher_options_t result; + rcl_publisher_options_t result = rcl_publisher_get_default_options(); using AllocatorTraits = std::allocator_traits; using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc; auto message_alloc = std::make_shared(*this->get_allocator().get());