Make sure rmw_publisher_options is initialized in to_rcl_publisher_options. (#1099)

Signed-off-by: ChenYing Kuo <evshary@gmail.com>
This commit is contained in:
ChenYing Kuo 2020-05-23 04:14:48 +08:00 committed by GitHub
parent c7b62bff71
commit 4f34562878
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,7 @@ struct PublisherOptionsWithAllocator : public PublisherOptionsBase
rcl_publisher_options_t rcl_publisher_options_t
to_rcl_publisher_options(const rclcpp::QoS & qos) const 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<Allocator>; using AllocatorTraits = std::allocator_traits<Allocator>;
using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc<MessageT>; using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc<MessageT>;
auto message_alloc = std::make_shared<MessageAllocatorT>(*this->get_allocator().get()); auto message_alloc = std::make_shared<MessageAllocatorT>(*this->get_allocator().get());