|
|
|
@ -81,27 +81,33 @@ except AttributeError:
@@ -81,27 +81,33 @@ except AttributeError:
|
|
|
|
|
using namespace eprosima::fastrtps; |
|
|
|
|
using namespace eprosima::fastrtps::rtps; |
|
|
|
|
|
|
|
|
|
class @(topic)_Subscriber |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
@(topic)_Subscriber(); |
|
|
|
|
virtual ~@(topic)_Subscriber(); |
|
|
|
|
bool init(uint8_t topic_ID, std::condition_variable* t_send_queue_cv, std::mutex* t_send_queue_mutex, std::queue<uint8_t>* t_send_queue); |
|
|
|
|
void run(); |
|
|
|
|
bool hasMsg(); |
|
|
|
|
@[if fastrtps_version <= 1.7]@ |
|
|
|
|
@[ if ros2_distro]@ |
|
|
|
|
@(package)::msg::dds_::@(topic)_ getMsg(); |
|
|
|
|
using @(topic)_msg_t = @(package)::msg::dds_::@(topic)_; |
|
|
|
|
using @(topic)_msg_datatype = @(package)::msg::dds_::@(topic)_PubSubType; |
|
|
|
|
@[ else]@ |
|
|
|
|
@(topic)_ getMsg(); |
|
|
|
|
using @(topic)_msg_t = @(topic)_; |
|
|
|
|
using @(topic)_msg_datatype = @(topic)_PubSubType; |
|
|
|
|
@[ end if]@ |
|
|
|
|
@[else]@ |
|
|
|
|
@[ if ros2_distro]@ |
|
|
|
|
@(package)::msg::@(topic) getMsg(); |
|
|
|
|
using @(topic)_msg_t = @(package)::msg::@(topic); |
|
|
|
|
using @(topic)_msg_datatype = @(package)::msg::@(topic)PubSubType; |
|
|
|
|
@[ else]@ |
|
|
|
|
@(topic) getMsg(); |
|
|
|
|
using @(topic)_msg_t = @(topic); |
|
|
|
|
using @(topic)_msg_datatype = @(topic)PubSubType; |
|
|
|
|
@[ end if]@ |
|
|
|
|
@[end if]@ |
|
|
|
|
|
|
|
|
|
class @(topic)_Subscriber |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
@(topic)_Subscriber(); |
|
|
|
|
virtual ~@(topic)_Subscriber(); |
|
|
|
|
bool init(uint8_t topic_ID, std::condition_variable* t_send_queue_cv, std::mutex* t_send_queue_mutex, std::queue<uint8_t>* t_send_queue); |
|
|
|
|
void run(); |
|
|
|
|
bool hasMsg(); |
|
|
|
|
@(topic)_msg_t getMsg(); |
|
|
|
|
void unlockMsg(); |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
@ -118,19 +124,7 @@ private:
@@ -118,19 +124,7 @@ private:
|
|
|
|
|
SampleInfo_t m_info; |
|
|
|
|
int n_matched; |
|
|
|
|
int n_msg; |
|
|
|
|
@[if fastrtps_version <= 1.7]@ |
|
|
|
|
@[ if ros2_distro]@ |
|
|
|
|
@(package)::msg::dds_::@(topic)_ msg; |
|
|
|
|
@[ else]@ |
|
|
|
|
@(topic)_ msg; |
|
|
|
|
@[ end if]@ |
|
|
|
|
@[else]@ |
|
|
|
|
@[ if ros2_distro]@ |
|
|
|
|
@(package)::msg::@(topic) msg; |
|
|
|
|
@[ else]@ |
|
|
|
|
@(topic) msg; |
|
|
|
|
@[ end if]@ |
|
|
|
|
@[end if]@ |
|
|
|
|
@(topic)_msg_t msg; |
|
|
|
|
std::atomic_bool has_msg; |
|
|
|
|
uint8_t topic_ID; |
|
|
|
|
std::condition_variable* t_send_queue_cv; |
|
|
|
@ -140,19 +134,7 @@ private:
@@ -140,19 +134,7 @@ private:
|
|
|
|
|
std::mutex has_msg_mutex; |
|
|
|
|
|
|
|
|
|
} m_listener; |
|
|
|
|
@[if fastrtps_version <= 1.7]@ |
|
|
|
|
@[ if ros2_distro]@ |
|
|
|
|
@(package)::msg::dds_::@(topic)_PubSubType @(topic)DataType; |
|
|
|
|
@[ else]@ |
|
|
|
|
@(topic)_PubSubType @(topic)DataType; |
|
|
|
|
@[ end if]@ |
|
|
|
|
@[else]@ |
|
|
|
|
@[ if ros2_distro]@ |
|
|
|
|
@(package)::msg::@(topic)PubSubType @(topic)DataType; |
|
|
|
|
@[ else]@ |
|
|
|
|
@(topic)PubSubType @(topic)DataType; |
|
|
|
|
@[ end if]@ |
|
|
|
|
@[end if]@ |
|
|
|
|
@(topic)_msg_datatype @(topic)DataType; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#endif // _@(topic)__SUBSCRIBER_H_ |
|
|
|
|