File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,6 +214,20 @@ rmw_create_publisher(
214214 qos_policies -> reliability == RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT ;
215215 bool history = qos_policies -> history == RMW_QOS_POLICY_HISTORY_KEEP_LAST ;
216216
217+ uxrQoSDurability durability ;
218+ switch (qos_policies -> durability )
219+ {
220+ case RMW_QOS_POLICY_DURABILITY_VOLATILE :
221+ durability = UXR_DURABILITY_VOLATILE ;
222+ break ;
223+ case RMW_QOS_POLICY_DURABILITY_UNKNOWN :
224+ case RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT :
225+ case RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL :
226+ default :
227+ durability = UXR_DURABILITY_TRANSIENT_LOCAL ;
228+ break ;
229+ }
230+
217231 datawriter_req = uxr_buffer_create_datawriter_bin (
218232 & custom_publisher -> owner_node -> context -> session ,
219233 * custom_node -> context -> creation_destroy_stream ,
@@ -222,7 +236,7 @@ rmw_create_publisher(
222236 custom_publisher -> topic -> topic_id ,
223237 reliability ,
224238 history ,
225- 1 ,
239+ durability ,
226240 UXR_REPLACE );
227241 #endif /* ifdef RMW_UXRCE_USE_REFS */
228242
Original file line number Diff line number Diff line change @@ -202,6 +202,20 @@ rmw_create_subscription(
202202 qos_policies -> reliability == RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT ;
203203 bool history = qos_policies -> history == RMW_QOS_POLICY_HISTORY_KEEP_LAST ;
204204
205+ uxrQoSDurability durability ;
206+ switch (qos_policies -> durability )
207+ {
208+ case RMW_QOS_POLICY_DURABILITY_VOLATILE :
209+ durability = UXR_DURABILITY_VOLATILE ;
210+ break ;
211+ case RMW_QOS_POLICY_DURABILITY_UNKNOWN :
212+ case RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT :
213+ case RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL :
214+ default :
215+ durability = UXR_DURABILITY_TRANSIENT_LOCAL ;
216+ break ;
217+ }
218+
205219 datareader_req = uxr_buffer_create_datareader_bin (
206220 & custom_node -> context -> session ,
207221 * custom_node -> context -> creation_destroy_stream ,
@@ -210,7 +224,7 @@ rmw_create_subscription(
210224 custom_subscription -> topic -> topic_id ,
211225 reliability ,
212226 history ,
213- 1 ,
227+ durability ,
214228 UXR_REPLACE );
215229#endif /* ifdef RMW_UXRCE_USE_XML */
216230
You can’t perform that action at this time.
0 commit comments