|
CARLA
|
FastDDS implementation of IPublisherMiddleware. More...
#include <FastDDSPublisherMiddleware.h>
Public Types | |
| using | msg_type = typename T::msg_type |
Public Member Functions | |
| FastDDSPublisherMiddleware ()=default | |
| FastDDSPublisherMiddleware (const FastDDSPublisherMiddleware &)=delete | |
| std::string | GetTopicName () const override |
| bool | Init (const std::string &topic_name) override |
| Initialize the underlying middleware entities. | |
| bool | Init (const std::string &topic_name, const QosProfile &qos) override |
| Initialize with an explicit per-topic QoS profile (see QosProfile.h). | |
| bool | IsAlive () const override |
| void | on_publication_matched (efd::DataWriter *writer, const efd::PublicationMatchedStatus &info) override |
| FastDDSPublisherMiddleware & | operator= (const FastDDSPublisherMiddleware &)=delete |
| bool | Publish (void *message_data) override |
| Serialize and write a message to the network. | |
| ~FastDDSPublisherMiddleware () override | |
| Public Member Functions inherited from carla::ros2::IPublisherMiddleware | |
| virtual | ~IPublisherMiddleware ()=default |
Private Member Functions | |
| bool | InitImpl (const std::string &topic_name, const QosProfile *qos) |
| Shared Init body. | |
Private Attributes | |
| std::atomic< bool > | _alive { false } |
| efd::DataWriter * | _datawriter { nullptr } |
| efd::DomainParticipant * | _participant { nullptr } |
| efd::Publisher * | _publisher { nullptr } |
| std::atomic< bool > | _reported_not_ready { false } |
| efd::Topic * | _topic { nullptr } |
| std::string | _topic_name |
| efd::TypeSupport | _type { new GenericCdrPubSubType<msg_type>() } |
FastDDS implementation of IPublisherMiddleware.
Parameterized on a traits type T that provides: T::msg_type — the message type (a carla::ros2::msg::* POD struct) Serialization is handled by GenericCdrPubSubType<msg_type> via CdrSerialization.h.
Uses FastDDSSharedParticipant for a single refcounted DomainParticipant across all FastDDS endpoints, mirroring CycloneDDS's shared-participant model. This avoids the discovery storm that occurred when N independent participants were destroyed back-to-back on ROS2::Shutdown().
Sets USER_DATA QoS on the DataWriter to the REP-2016 KV payload "typehash=RIHS01_<hex>;" (PID_USER_DATA = 0x002c in DDSI-RTPS v2.5 §9.6.2.2.2) so that Jazzy rmw_cyclonedds_cpp and rmw_fastrtps_cpp can perform REP-2011 type-hash-based endpoint matching without warning.
Definition at line 48 of file FastDDSPublisherMiddleware.h.
| using carla::ros2::FastDDSPublisherMiddleware< T >::msg_type = typename T::msg_type |
Definition at line 52 of file FastDDSPublisherMiddleware.h.
|
default |
Referenced by FastDDSPublisherMiddleware(), and operator=().
|
delete |
References FastDDSPublisherMiddleware().
|
inlineoverride |
Definition at line 64 of file FastDDSPublisherMiddleware.h.
References _datawriter, _participant, _publisher, _topic, _type, carla::ros2::FastDDSSharedParticipant::release(), and carla::ros2::FastDDSSharedParticipant::release_type().
|
inlineoverridevirtual |
Implements carla::ros2::IPublisherMiddleware.
Definition at line 215 of file FastDDSPublisherMiddleware.h.
References _topic_name.
|
inlineoverridevirtual |
Initialize the underlying middleware entities.
| topic_name | Full topic name including "rt/" prefix. |
Implements carla::ros2::IPublisherMiddleware.
Definition at line 86 of file FastDDSPublisherMiddleware.h.
References InitImpl().
|
inlineoverridevirtual |
Initialize with an explicit per-topic QoS profile (see QosProfile.h).
The default implementation ignores the profile and falls back to the QoS-less Init so test fakes and QoS-agnostic middlewares keep working; concrete backends override this to honor the profile.
Reimplemented from carla::ros2::IPublisherMiddleware.
Definition at line 90 of file FastDDSPublisherMiddleware.h.
References InitImpl().
|
inlineprivate |
Shared Init body.
When qos is non-null the profile overrides the FastDDS DataWriter defaults; when null the defaults are kept, preserving the pre-QoS behavior for every existing publisher.
Definition at line 98 of file FastDDSPublisherMiddleware.h.
References _datawriter, _participant, _publisher, _topic, _topic_name, _type, carla::ros2::FastDDSSharedParticipant::acquire(), carla::ros2::build_user_data_for(), carla::ros2::QosProfile::durability, carla::ros2::QosProfile::history, carla::ros2::QosProfile::history_depth, carla::ros2::QosProfile::KeepLast, carla::ros2::QosProfile::reliability, carla::ros2::QosProfile::Reliable, carla::ros2::FastDDSSharedParticipant::retain_type(), and carla::ros2::QosProfile::TransientLocal.
|
inlineoverridevirtual |
Implements carla::ros2::IPublisherMiddleware.
Definition at line 211 of file FastDDSPublisherMiddleware.h.
References _alive.
|
inlineoverride |
Definition at line 58 of file FastDDSPublisherMiddleware.h.
References _alive.
|
delete |
References FastDDSPublisherMiddleware().
|
inlineoverridevirtual |
Serialize and write a message to the network.
| message_data | Pointer to the message object (type-erased, cast internally). |
Implements carla::ros2::IPublisherMiddleware.
Definition at line 191 of file FastDDSPublisherMiddleware.h.
References _datawriter, _reported_not_ready, and _topic_name.
|
private |
Definition at line 227 of file FastDDSPublisherMiddleware.h.
Referenced by IsAlive(), and on_publication_matched().
|
private |
Definition at line 223 of file FastDDSPublisherMiddleware.h.
Referenced by InitImpl(), Publish(), and ~FastDDSPublisherMiddleware().
|
private |
Definition at line 220 of file FastDDSPublisherMiddleware.h.
Referenced by InitImpl(), and ~FastDDSPublisherMiddleware().
|
private |
Definition at line 221 of file FastDDSPublisherMiddleware.h.
Referenced by InitImpl(), and ~FastDDSPublisherMiddleware().
|
private |
Definition at line 228 of file FastDDSPublisherMiddleware.h.
Referenced by Publish().
|
private |
Definition at line 222 of file FastDDSPublisherMiddleware.h.
Referenced by InitImpl(), and ~FastDDSPublisherMiddleware().
|
private |
Definition at line 226 of file FastDDSPublisherMiddleware.h.
Referenced by GetTopicName(), InitImpl(), and Publish().
|
private |
Definition at line 224 of file FastDDSPublisherMiddleware.h.
Referenced by InitImpl(), and ~FastDDSPublisherMiddleware().