@@ -18,6 +18,7 @@ use crate::{
18
18
/// - `use_global_arguments: true`
19
19
/// - `arguments: []`
20
20
/// - `enable_rosout: true`
21
+ /// - `start_parameter_services: true`
21
22
/// - `clock_type: ClockType::RosTime`
22
23
/// - `clock_qos: QOS_PROFILE_CLOCK`
23
24
///
@@ -49,6 +50,7 @@ pub struct NodeBuilder {
49
50
use_global_arguments : bool ,
50
51
arguments : Vec < String > ,
51
52
enable_rosout : bool ,
53
+ start_parameter_services : bool ,
52
54
clock_type : ClockType ,
53
55
clock_qos : QoSProfile ,
54
56
}
@@ -97,6 +99,7 @@ impl NodeBuilder {
97
99
use_global_arguments : true ,
98
100
arguments : vec ! [ ] ,
99
101
enable_rosout : true ,
102
+ start_parameter_services : true ,
100
103
clock_type : ClockType :: RosTime ,
101
104
clock_qos : QOS_PROFILE_CLOCK ,
102
105
}
@@ -231,6 +234,15 @@ impl NodeBuilder {
231
234
self
232
235
}
233
236
237
+ /// Enables or disables parameter services.
238
+ ///
239
+ /// Parameter services can be used to allow external nodes to list, get and set
240
+ /// parameters for this node.
241
+ pub fn start_parameter_services ( mut self , start : bool ) -> Self {
242
+ self . start_parameter_services = start;
243
+ self
244
+ }
245
+
234
246
/// Sets the node's clock type.
235
247
pub fn clock_type ( mut self , clock_type : ClockType ) -> Self {
236
248
self . clock_type = clock_type;
@@ -308,7 +320,9 @@ impl NodeBuilder {
308
320
parameter,
309
321
} ) ;
310
322
node. time_source . attach_node ( & node) ;
311
- node. parameter . create_services ( & node) ?;
323
+ if self . start_parameter_services {
324
+ node. parameter . create_services ( & node) ?;
325
+ }
312
326
Ok ( node)
313
327
}
314
328
0 commit comments