For C++
I might be wrong, but (for C++ not Python) from rclcpp::Node Class Reference
std::shared_ptr< PublisherT > create_publisher (const std::string &topic_name, size_t qos_history_depth, std::shared_ptr< Alloc > allocator=nullptr)
and
std::shared_ptr< PublisherT > create_publisher (const std::string &topic_name, const rmw_qos_profile_t &qos_profile=rmw_qos_profile_default, std::shared_ptr< Alloc > allocator=nullptr)
In both cases, the last parameter is
std::shared_ptr< Alloc > allocator=nullptr
Then from create_publisher(), it says that the third parameter is
[in]
allocator Optional custom allocator.
Notes:
For Python
Actually, above, I was wrong.
From the link to the rclpy documentation that you posted, click on the API link in the left hand side bar.
Then click on the Publisher link (under "Topics"):
Read the warning (ignore the typo):
Warning:
Users should not create a publisher with this constuctor, instead they should call Node.create_publisher()
.
Click the link to Node.create_publisher()
Looking at
create_publisher(msg_type, topic, qos_profile, *, callback_group=None, event_callbacks=None, qos_overriding_options=None)
The third parameter is
- qos_profile (
Union[QoSProfile, int]
) – A QoSProfile or a history depth to apply to the publisher. In the case that a history depth is provided, the QoS history is set to KEEP_LAST, the QoS history depth is set to the value of the parameter, and all other QoS settings are set to their default values.