diff --git a/msg/templates/urtps/Publisher.cpp.em b/msg/templates/urtps/Publisher.cpp.em index ca69957038be..ff862d409d4d 100644 --- a/msg/templates/urtps/Publisher.cpp.em +++ b/msg/templates/urtps/Publisher.cpp.em @@ -90,7 +90,11 @@ bool @(topic)_Publisher::init() { // Create RTPSParticipant ParticipantAttributes PParam; +@[if version.parse(fastrtps_version[:3]) < version.parse('2.0')]@ PParam.rtps.builtin.domainId = 0; +@[else]@ + PParam.domainId = 0; +@[end if]@ @[if version.parse(fastrtps_version[:3]) <= version.parse('1.8')]@ PParam.rtps.builtin.leaseDuration = c_TimeInfinite; @[else]@ diff --git a/msg/templates/urtps/Subscriber.cpp.em b/msg/templates/urtps/Subscriber.cpp.em index 25e84ba54f22..8a5d17c8d960 100644 --- a/msg/templates/urtps/Subscriber.cpp.em +++ b/msg/templates/urtps/Subscriber.cpp.em @@ -90,7 +90,11 @@ 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[:3]) < version.parse('2.0')]@ + PParam.rtps.builtin.domainId = 0; +@[else]@ + PParam.domainId = 0; +@[end if]@ @[if version.parse(fastrtps_version[:3]) <= version.parse('1.8')]@ PParam.rtps.builtin.leaseDuration = c_TimeInfinite; @[else]@