|
CARLA
|
FastDDS implementation of IPublisherMiddleware. More...
#include <FastDDSPublisherMiddleware.h>
Inheritance diagram for carla::ros2::FastDDSPublisherMiddleware< T >: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 } |
| 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 |
|
delete |
|
inlineoverride |
Definition at line 64 of file FastDDSPublisherMiddleware.h.
References carla::ros2::FastDDSPublisherMiddleware< T >::_datawriter, carla::ros2::FastDDSPublisherMiddleware< T >::_participant, carla::ros2::FastDDSPublisherMiddleware< T >::_publisher, carla::ros2::FastDDSPublisherMiddleware< T >::_topic, carla::ros2::FastDDSPublisherMiddleware< T >::_type, carla::ros2::FastDDSSharedParticipant::release(), and carla::ros2::FastDDSSharedParticipant::release_type().
|
inlineoverridevirtual |
Implements carla::ros2::IPublisherMiddleware.
Definition at line 206 of file FastDDSPublisherMiddleware.h.
References carla::ros2::FastDDSPublisherMiddleware< T >::_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 carla::ros2::FastDDSPublisherMiddleware< T >::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 carla::ros2::FastDDSPublisherMiddleware< T >::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 carla::ros2::FastDDSPublisherMiddleware< T >::_datawriter, carla::ros2::FastDDSPublisherMiddleware< T >::_participant, carla::ros2::FastDDSPublisherMiddleware< T >::_publisher, carla::ros2::FastDDSPublisherMiddleware< T >::_topic, carla::ros2::FastDDSPublisherMiddleware< T >::_topic_name, carla::ros2::FastDDSPublisherMiddleware< T >::_type, carla::ros2::FastDDSSharedParticipant::acquire(), carla::ros2::QosProfile::durability, carla::ros2::QosProfile::history, carla::ros2::QosProfile::history_depth, carla::ros2::QosProfile::KeepLast, carla::log_error(), carla::ros2::QosProfile::reliability, carla::ros2::QosProfile::Reliable, carla::ros2::FastDDSSharedParticipant::retain_type(), and carla::ros2::QosProfile::TransientLocal.
Referenced by carla::ros2::FastDDSPublisherMiddleware< T >::Init(), and carla::ros2::FastDDSPublisherMiddleware< T >::Init().
|
inlineoverridevirtual |
Implements carla::ros2::IPublisherMiddleware.
Definition at line 202 of file FastDDSPublisherMiddleware.h.
References carla::ros2::FastDDSPublisherMiddleware< T >::_alive.
|
inlineoverride |
Definition at line 58 of file FastDDSPublisherMiddleware.h.
References carla::ros2::FastDDSPublisherMiddleware< T >::_alive.
|
delete |
|
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 carla::ros2::FastDDSPublisherMiddleware< T >::_datawriter, carla::ros2::FastDDSPublisherMiddleware< T >::_topic_name, and carla::log_error().
|
private |
Definition at line 218 of file FastDDSPublisherMiddleware.h.
Referenced by carla::ros2::FastDDSPublisherMiddleware< T >::IsAlive(), and carla::ros2::FastDDSPublisherMiddleware< T >::on_publication_matched().
|
private |
|
private |
Definition at line 211 of file FastDDSPublisherMiddleware.h.
Referenced by carla::ros2::FastDDSPublisherMiddleware< T >::InitImpl(), and carla::ros2::FastDDSPublisherMiddleware< T >::~FastDDSPublisherMiddleware().
|
private |
Definition at line 212 of file FastDDSPublisherMiddleware.h.
Referenced by carla::ros2::FastDDSPublisherMiddleware< T >::InitImpl(), and carla::ros2::FastDDSPublisherMiddleware< T >::~FastDDSPublisherMiddleware().
|
private |
Definition at line 213 of file FastDDSPublisherMiddleware.h.
Referenced by carla::ros2::FastDDSPublisherMiddleware< T >::InitImpl(), and carla::ros2::FastDDSPublisherMiddleware< T >::~FastDDSPublisherMiddleware().
|
private |
Definition at line 217 of file FastDDSPublisherMiddleware.h.
Referenced by carla::ros2::FastDDSPublisherMiddleware< T >::GetTopicName(), carla::ros2::FastDDSPublisherMiddleware< T >::InitImpl(), and carla::ros2::FastDDSPublisherMiddleware< T >::Publish().
|
private |
Definition at line 215 of file FastDDSPublisherMiddleware.h.
Referenced by carla::ros2::FastDDSPublisherMiddleware< T >::InitImpl(), and carla::ros2::FastDDSPublisherMiddleware< T >::~FastDDSPublisherMiddleware().