@@ -173,7 +173,7 @@ def profile_configure_short_keys(
173
173
profile : rclpy .qos .QoSProfile = None , reliability : Optional [str ] = None ,
174
174
durability : Optional [str ] = None , depth : Optional [int ] = None , history : Optional [str ] = None ,
175
175
liveliness : Optional [str ] = None , liveliness_lease_duration_s : Optional [int ] = None ,
176
- ) -> rclpy . qos . QoSProfile :
176
+ ) -> None :
177
177
"""Configure a QoSProfile given a profile, and optional overrides."""
178
178
if history :
179
179
profile .history = rclpy .qos .QoSHistoryPolicy .get_from_short_key (history )
@@ -206,50 +206,56 @@ def qos_profile_from_short_keys(
206
206
return profile
207
207
208
208
209
- def add_qos_arguments (parser : ArgumentParser , subscribe_or_publish : str , default_profile_str ):
209
+ def add_qos_arguments (
210
+ parser : ArgumentParser , entity_type : str ,
211
+ default_profile_str : str = 'default' , extra_message : str = ''
212
+ ) -> None :
210
213
parser .add_argument (
211
214
'--qos-profile' ,
212
215
choices = rclpy .qos .QoSPresetProfiles .short_keys (),
213
216
help = (
214
- f'Quality of service preset profile to { subscribe_or_publish } with'
217
+ f'Quality of service preset profile to { entity_type } with'
215
218
f' (default: { default_profile_str } )' ),
216
219
default = default_profile_str )
217
220
default_profile = rclpy .qos .QoSPresetProfiles .get_from_short_key (default_profile_str )
218
221
parser .add_argument (
219
222
'--qos-depth' , metavar = 'N' , type = int ,
220
223
help = (
221
- f'Queue size setting to { subscribe_or_publish } with '
222
- '(overrides depth value of --qos-profile option)' ))
224
+ f'Queue size setting to { entity_type } with '
225
+ '(overrides depth value of --qos-profile option, default: '
226
+ f'{ default_profile .depth } )' ))
223
227
parser .add_argument (
224
228
'--qos-history' ,
225
229
choices = rclpy .qos .QoSHistoryPolicy .short_keys (),
226
230
help = (
227
- f'History of samples setting to { subscribe_or_publish } with '
231
+ f'History of samples setting to { entity_type } with '
228
232
'(overrides history value of --qos-profile option, default: '
229
233
f'{ default_profile .history .short_key } )' ))
230
234
parser .add_argument (
231
235
'--qos-reliability' ,
232
236
choices = rclpy .qos .QoSReliabilityPolicy .short_keys (),
233
237
help = (
234
- f'Quality of service reliability setting to { subscribe_or_publish } with '
238
+ f'Quality of service reliability setting to { entity_type } with '
235
239
'(overrides reliability value of --qos-profile option, default: '
236
- 'Compatible profile with running endpoints )' ))
240
+ f' { default_profile . reliability . short_key } { extra_message } )' ))
237
241
parser .add_argument (
238
242
'--qos-durability' ,
239
243
choices = rclpy .qos .QoSDurabilityPolicy .short_keys (),
240
244
help = (
241
- f'Quality of service durability setting to { subscribe_or_publish } with '
245
+ f'Quality of service durability setting to { entity_type } with '
242
246
'(overrides durability value of --qos-profile option, default: '
243
- 'Compatible profile with running endpoints )' ))
247
+ f' { default_profile . durability . short_key } { extra_message } )' ))
244
248
parser .add_argument (
245
249
'--qos-liveliness' ,
246
250
choices = rclpy .qos .QoSLivelinessPolicy .short_keys (),
247
251
help = (
248
- f'Quality of service liveliness setting to { subscribe_or_publish } with '
249
- '(overrides liveliness value of --qos-profile option' ))
252
+ f'Quality of service liveliness setting to { entity_type } with '
253
+ '(overrides liveliness value of --qos-profile option, default '
254
+ f'{ default_profile .liveliness .short_key } )' ))
250
255
parser .add_argument (
251
256
'--qos-liveliness-lease-duration-seconds' ,
252
257
type = float ,
253
258
help = (
254
- f'Quality of service liveliness lease duration setting to { subscribe_or_publish } '
255
- 'with (overrides liveliness lease duration value of --qos-profile option' ))
259
+ f'Quality of service liveliness lease duration setting to { entity_type } '
260
+ 'with (overrides liveliness lease duration value of --qos-profile option, default: '
261
+ f'{ default_profile .liveliness_lease_duration } )' ))
0 commit comments