|
CARLA
|
FastDDS implementation of ISubscriberMiddleware. More...
#include <FastDDSSubscriberMiddleware.h>
Inheritance diagram for carla::ros2::FastDDSSubscriberMiddleware< S >:Public Types | |
| using | msg_type = typename S::msg_type |
Public Member Functions | |
| FastDDSSubscriberMiddleware ()=default | |
| FastDDSSubscriberMiddleware (const FastDDSSubscriberMiddleware &)=delete | |
| std::string | GetTopicName () const override |
| bool | Init (const std::string &topic_name, void *message_ptr, bool *new_message_flag) override |
| Initialize the underlying middleware entities. | |
| bool | Init (const std::string &topic_name, void *message_ptr, bool *new_message_flag, const QosProfile &qos) override |
| Initialize with an explicit per-topic QoS profile (see QosProfile.h). | |
| bool | IsAlive () const override |
| void | on_data_available (efd::DataReader *reader) override |
| void | on_subscription_matched (efd::DataReader *reader, const efd::SubscriptionMatchedStatus &info) override |
| FastDDSSubscriberMiddleware & | operator= (const FastDDSSubscriberMiddleware &)=delete |
| ~FastDDSSubscriberMiddleware () override | |
Public Member Functions inherited from carla::ros2::ISubscriberMiddleware | |
| virtual | ~ISubscriberMiddleware ()=default |
Private Member Functions | |
| bool | InitImpl (const std::string &topic_name, void *message_ptr, bool *new_message_flag, const QosProfile *qos) |
| Shared Init body. | |
Private Attributes | |
| std::atomic< bool > | _alive { false } |
| efd::DataReader * | _datareader { nullptr } |
| msg_type * | _message_ptr { nullptr } |
| bool * | _new_message_ptr { nullptr } |
| efd::DomainParticipant * | _participant { nullptr } |
| efd::Subscriber * | _subscriber { nullptr } |
| efd::Topic * | _topic { nullptr } |
| std::string | _topic_name |
| efd::TypeSupport | _type { new GenericCdrPubSubType<msg_type>() } |
FastDDS implementation of ISubscriberMiddleware.
Parameterized on traits type S that provides: S::msg_type — the message type (a carla::ros2::msg::* POD struct) Deserialization is handled by GenericCdrPubSubType<msg_type> via CdrSerialization.h.
Uses FastDDSSharedParticipant for a single refcounted DomainParticipant across all FastDDS endpoints. See FastDDSPublisherMiddleware.h for the rationale.
Sets USER_DATA QoS on the DataReader 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 47 of file FastDDSSubscriberMiddleware.h.
| using carla::ros2::FastDDSSubscriberMiddleware< S >::msg_type = typename S::msg_type |
Definition at line 51 of file FastDDSSubscriberMiddleware.h.
|
default |
|
delete |
|
inlineoverride |
Definition at line 74 of file FastDDSSubscriberMiddleware.h.
References carla::ros2::FastDDSSubscriberMiddleware< S >::_datareader, carla::ros2::FastDDSSubscriberMiddleware< S >::_participant, carla::ros2::FastDDSSubscriberMiddleware< S >::_subscriber, carla::ros2::FastDDSSubscriberMiddleware< S >::_topic, carla::ros2::FastDDSSubscriberMiddleware< S >::_type, carla::ros2::FastDDSSharedParticipant::release(), and carla::ros2::FastDDSSharedParticipant::release_type().
|
inlineoverridevirtual |
Implements carla::ros2::ISubscriberMiddleware.
Definition at line 199 of file FastDDSSubscriberMiddleware.h.
References carla::ros2::FastDDSSubscriberMiddleware< S >::_topic_name.
|
inlineoverridevirtual |
Initialize the underlying middleware entities.
The middleware writes incoming messages to *message_ptr and sets *new_message_flag = true.
| topic_name | Full topic name. |
| message_ptr | Pointer to the message storage owned by the caller. |
| new_message_flag | Pointer to the new-message flag owned by the caller. |
Implements carla::ros2::ISubscriberMiddleware.
Definition at line 94 of file FastDDSSubscriberMiddleware.h.
References carla::ros2::FastDDSSubscriberMiddleware< S >::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::ISubscriberMiddleware.
Definition at line 101 of file FastDDSSubscriberMiddleware.h.
References carla::ros2::FastDDSSubscriberMiddleware< S >::InitImpl().
|
inlineprivate |
Shared Init body.
When qos is non-null the profile overrides the FastDDS DataReader defaults (BEST_EFFORT / VOLATILE); when null the defaults are kept, preserving the pre-QoS behavior for every existing subscriber.
Definition at line 114 of file FastDDSSubscriberMiddleware.h.
References carla::ros2::FastDDSSubscriberMiddleware< S >::_datareader, carla::ros2::FastDDSSubscriberMiddleware< S >::_message_ptr, carla::ros2::FastDDSSubscriberMiddleware< S >::_new_message_ptr, carla::ros2::FastDDSSubscriberMiddleware< S >::_participant, carla::ros2::FastDDSSubscriberMiddleware< S >::_subscriber, carla::ros2::FastDDSSubscriberMiddleware< S >::_topic, carla::ros2::FastDDSSubscriberMiddleware< S >::_topic_name, carla::ros2::FastDDSSubscriberMiddleware< S >::_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::FastDDSSubscriberMiddleware< S >::Init(), and carla::ros2::FastDDSSubscriberMiddleware< S >::Init().
|
inlineoverridevirtual |
Implements carla::ros2::ISubscriberMiddleware.
Definition at line 195 of file FastDDSSubscriberMiddleware.h.
References carla::ros2::FastDDSSubscriberMiddleware< S >::_alive.
|
inlineoverride |
|
inlineoverride |
Definition at line 57 of file FastDDSSubscriberMiddleware.h.
References carla::ros2::FastDDSSubscriberMiddleware< S >::_alive.
|
delete |
|
private |
Definition at line 214 of file FastDDSSubscriberMiddleware.h.
Referenced by carla::ros2::FastDDSSubscriberMiddleware< S >::IsAlive(), and carla::ros2::FastDDSSubscriberMiddleware< S >::on_subscription_matched().
|
private |
Definition at line 207 of file FastDDSSubscriberMiddleware.h.
Referenced by carla::ros2::FastDDSSubscriberMiddleware< S >::InitImpl(), and carla::ros2::FastDDSSubscriberMiddleware< S >::~FastDDSSubscriberMiddleware().
|
private |
Definition at line 210 of file FastDDSSubscriberMiddleware.h.
Referenced by carla::ros2::FastDDSSubscriberMiddleware< S >::InitImpl(), and carla::ros2::FastDDSSubscriberMiddleware< S >::on_data_available().
|
private |
Definition at line 211 of file FastDDSSubscriberMiddleware.h.
Referenced by carla::ros2::FastDDSSubscriberMiddleware< S >::InitImpl(), and carla::ros2::FastDDSSubscriberMiddleware< S >::on_data_available().
|
private |
Definition at line 204 of file FastDDSSubscriberMiddleware.h.
Referenced by carla::ros2::FastDDSSubscriberMiddleware< S >::InitImpl(), and carla::ros2::FastDDSSubscriberMiddleware< S >::~FastDDSSubscriberMiddleware().
|
private |
Definition at line 205 of file FastDDSSubscriberMiddleware.h.
Referenced by carla::ros2::FastDDSSubscriberMiddleware< S >::InitImpl(), and carla::ros2::FastDDSSubscriberMiddleware< S >::~FastDDSSubscriberMiddleware().
|
private |
Definition at line 206 of file FastDDSSubscriberMiddleware.h.
Referenced by carla::ros2::FastDDSSubscriberMiddleware< S >::InitImpl(), and carla::ros2::FastDDSSubscriberMiddleware< S >::~FastDDSSubscriberMiddleware().
|
private |
|
private |
Definition at line 208 of file FastDDSSubscriberMiddleware.h.
Referenced by carla::ros2::FastDDSSubscriberMiddleware< S >::InitImpl(), and carla::ros2::FastDDSSubscriberMiddleware< S >::~FastDDSSubscriberMiddleware().