From 1b453ed8499d7348270ac8815ab72df1db38c43c Mon Sep 17 00:00:00 2001 From: TSC21 Date: Tue, 24 Mar 2020 16:25:29 +0000 Subject: [PATCH] microRTPS: templates: check only the major and minor of FastRTPS to set the 'discovery_config' namespace --- msg/templates/urtps/Publisher.cpp.em | 2 +- msg/templates/urtps/Subscriber.cpp.em | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/msg/templates/urtps/Publisher.cpp.em b/msg/templates/urtps/Publisher.cpp.em index d63d4049b6..54aca65168 100644 --- a/msg/templates/urtps/Publisher.cpp.em +++ b/msg/templates/urtps/Publisher.cpp.em @@ -91,7 +91,7 @@ bool @(topic)_Publisher::init() // Create RTPSParticipant ParticipantAttributes PParam; PParam.rtps.builtin.domainId = 0; -@[if version.parse(fastrtps_version) <= version.parse('1.8')]@ +@[if version.parse(fastrtps_version[:3]) <= version.parse('1.8')]@ PParam.rtps.builtin.leaseDuration = c_TimeInfinite; @[else]@ PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite; diff --git a/msg/templates/urtps/Subscriber.cpp.em b/msg/templates/urtps/Subscriber.cpp.em index 8583379fc5..4b76477438 100644 --- a/msg/templates/urtps/Subscriber.cpp.em +++ b/msg/templates/urtps/Subscriber.cpp.em @@ -91,7 +91,7 @@ bool @(topic)_Subscriber::init(uint8_t topic_ID, std::condition_variable* t_send // Create RTPSParticipant ParticipantAttributes PParam; PParam.rtps.builtin.domainId = 0; // MUST BE THE SAME AS IN THE PUBLISHER -@[if version.parse(fastrtps_version) <= version.parse('1.8')]@ +@[if version.parse(fastrtps_version[:3]) <= version.parse('1.8')]@ PParam.rtps.builtin.leaseDuration = c_TimeInfinite; @[else]@ PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;