rclnodejs 1.9.0-alpha.0 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/.prettierignore +4 -0
  2. package/README.md +2 -2
  3. package/binding.gyp +6 -5
  4. package/index.js +10 -0
  5. package/lib/action/client.js +5 -4
  6. package/lib/action/server_goal_handle.js +26 -1
  7. package/lib/action/uuid.js +1 -1
  8. package/lib/client.js +0 -45
  9. package/lib/distro.js +11 -4
  10. package/lib/interface_loader.js +1 -1
  11. package/lib/message_introspector.js +1 -29
  12. package/lib/message_serialization.js +2 -2
  13. package/lib/native_loader.js +21 -9
  14. package/lib/node.js +209 -12
  15. package/lib/parameter_event_handler.js +98 -0
  16. package/lib/prebuilds.js +47 -0
  17. package/lib/qos_overriding_options.js +358 -0
  18. package/lib/rmw.js +6 -1
  19. package/lib/subscription.js +2 -2
  20. package/lib/timer.js +1 -1
  21. package/package.json +11 -6
  22. package/prebuilds/linux-arm64/humble-jammy-arm64-electron-rclnodejs.node +0 -0
  23. package/prebuilds/linux-arm64/humble-jammy-arm64-node-rclnodejs.node +0 -0
  24. package/prebuilds/linux-arm64/jazzy-noble-arm64-electron-rclnodejs.node +0 -0
  25. package/prebuilds/linux-arm64/jazzy-noble-arm64-node-rclnodejs.node +0 -0
  26. package/prebuilds/linux-arm64/kilted-noble-arm64-electron-rclnodejs.node +0 -0
  27. package/prebuilds/linux-arm64/kilted-noble-arm64-node-rclnodejs.node +0 -0
  28. package/prebuilds/linux-arm64/lyrical-resolute-arm64-electron-rclnodejs.node +0 -0
  29. package/prebuilds/linux-arm64/lyrical-resolute-arm64-node-rclnodejs.node +0 -0
  30. package/prebuilds/linux-x64/humble-jammy-x64-electron-rclnodejs.node +0 -0
  31. package/prebuilds/linux-x64/humble-jammy-x64-node-rclnodejs.node +0 -0
  32. package/prebuilds/linux-x64/jazzy-noble-x64-electron-rclnodejs.node +0 -0
  33. package/prebuilds/linux-x64/jazzy-noble-x64-node-rclnodejs.node +0 -0
  34. package/prebuilds/linux-x64/kilted-noble-x64-electron-rclnodejs.node +0 -0
  35. package/prebuilds/linux-x64/kilted-noble-x64-node-rclnodejs.node +0 -0
  36. package/prebuilds/linux-x64/lyrical-resolute-x64-electron-rclnodejs.node +0 -0
  37. package/prebuilds/linux-x64/lyrical-resolute-x64-node-rclnodejs.node +0 -0
  38. package/rosidl_gen/packages.js +4 -4
  39. package/rosidl_gen/templates/message-template.js +20 -6
  40. package/rosocket/README.md +152 -0
  41. package/rosocket/cli.js +168 -0
  42. package/rosocket/index.js +245 -0
  43. package/scripts/install.js +14 -3
  44. package/scripts/tag_prebuilds.js +26 -9
  45. package/src/rcl_action_client_bindings.cpp +4 -4
  46. package/src/rcl_graph_bindings.cpp +8 -8
  47. package/src/rcl_lifecycle_bindings.cpp +1 -1
  48. package/src/rcl_subscription_bindings.cpp +2 -2
  49. package/src/rcl_timer_bindings.cpp +21 -2
  50. package/src/rcl_utilities.cpp +4 -4
  51. package/src/rcl_utilities.h +2 -2
  52. package/types/distro.d.ts +15 -1
  53. package/types/node.d.ts +69 -5
  54. package/types/parameter_event_handler.d.ts +11 -0
  55. package/types/qos.d.ts +55 -0
  56. package/types/timer.d.ts +3 -2
  57. package/prebuilds/linux-arm64/humble-jammy-arm64-rclnodejs.node +0 -0
  58. package/prebuilds/linux-arm64/jazzy-noble-arm64-rclnodejs.node +0 -0
  59. package/prebuilds/linux-arm64/kilted-noble-arm64-rclnodejs.node +0 -0
  60. package/prebuilds/linux-x64/humble-jammy-x64-rclnodejs.node +0 -0
  61. package/prebuilds/linux-x64/jazzy-noble-x64-rclnodejs.node +0 -0
  62. package/prebuilds/linux-x64/kilted-noble-x64-rclnodejs.node +0 -0
  63. package/tools/jsdoc/Makefile +0 -5
  64. package/tools/jsdoc/README.md +0 -96
  65. package/tools/jsdoc/build-index.js +0 -610
  66. package/tools/jsdoc/publish.js +0 -854
  67. package/tools/jsdoc/regenerate-published-docs.js +0 -605
  68. package/tools/jsdoc/static/fonts/OpenSans-Bold-webfont.eot +0 -0
  69. package/tools/jsdoc/static/fonts/OpenSans-Bold-webfont.svg +0 -1830
  70. package/tools/jsdoc/static/fonts/OpenSans-Bold-webfont.woff +0 -0
  71. package/tools/jsdoc/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  72. package/tools/jsdoc/static/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  73. package/tools/jsdoc/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  74. package/tools/jsdoc/static/fonts/OpenSans-Italic-webfont.eot +0 -0
  75. package/tools/jsdoc/static/fonts/OpenSans-Italic-webfont.svg +0 -1830
  76. package/tools/jsdoc/static/fonts/OpenSans-Italic-webfont.woff +0 -0
  77. package/tools/jsdoc/static/fonts/OpenSans-Light-webfont.eot +0 -0
  78. package/tools/jsdoc/static/fonts/OpenSans-Light-webfont.svg +0 -1831
  79. package/tools/jsdoc/static/fonts/OpenSans-Light-webfont.woff +0 -0
  80. package/tools/jsdoc/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  81. package/tools/jsdoc/static/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  82. package/tools/jsdoc/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  83. package/tools/jsdoc/static/fonts/OpenSans-Regular-webfont.eot +0 -0
  84. package/tools/jsdoc/static/fonts/OpenSans-Regular-webfont.svg +0 -1831
  85. package/tools/jsdoc/static/fonts/OpenSans-Regular-webfont.woff +0 -0
  86. package/tools/jsdoc/static/scripts/linenumber.js +0 -25
  87. package/tools/jsdoc/static/scripts/prettify/Apache-License-2.0.txt +0 -202
  88. package/tools/jsdoc/static/scripts/prettify/lang-css.js +0 -36
  89. package/tools/jsdoc/static/scripts/prettify/prettify.js +0 -738
  90. package/tools/jsdoc/static/styles/jsdoc-default.css +0 -1012
  91. package/tools/jsdoc/static/styles/prettify-jsdoc.css +0 -111
  92. package/tools/jsdoc/static/styles/prettify-tomorrow.css +0 -132
  93. package/tools/jsdoc/tmpl/augments.tmpl +0 -10
  94. package/tools/jsdoc/tmpl/container.tmpl +0 -193
  95. package/tools/jsdoc/tmpl/details.tmpl +0 -143
  96. package/tools/jsdoc/tmpl/example.tmpl +0 -2
  97. package/tools/jsdoc/tmpl/examples.tmpl +0 -13
  98. package/tools/jsdoc/tmpl/exceptions.tmpl +0 -17
  99. package/tools/jsdoc/tmpl/layout.tmpl +0 -83
  100. package/tools/jsdoc/tmpl/mainpage.tmpl +0 -163
  101. package/tools/jsdoc/tmpl/members.tmpl +0 -43
  102. package/tools/jsdoc/tmpl/method.tmpl +0 -124
  103. package/tools/jsdoc/tmpl/params.tmpl +0 -133
  104. package/tools/jsdoc/tmpl/properties.tmpl +0 -110
  105. package/tools/jsdoc/tmpl/returns.tmpl +0 -12
  106. package/tools/jsdoc/tmpl/source.tmpl +0 -8
  107. package/tools/jsdoc/tmpl/tutorial.tmpl +0 -19
  108. package/tools/jsdoc/tmpl/type.tmpl +0 -7
@@ -250,7 +250,7 @@ Napi::Value ActionSendCancelRequest(const Napi::CallbackInfo& info) {
250
250
  return Napi::Number::New(env, static_cast<double>(sequence_number));
251
251
  }
252
252
 
253
- #if ROS_VERSION >= 5000 // ROS2 Rolling
253
+ #if ROS_VERSION >= 2605 // ROS2 Lyrical or newer
254
254
  Napi::Value ActionConfigureFeedbackSubFilterAddGoalId(
255
255
  const Napi::CallbackInfo& info) {
256
256
  Napi::Env env = info.Env();
@@ -309,7 +309,7 @@ Napi::Value ActionConfigureFeedbackSubFilterRemoveGoalId(
309
309
 
310
310
  return Napi::Boolean::New(env, true);
311
311
  }
312
- #endif // ROS_VERSION >= 5000
312
+ #endif // ROS_VERSION >= 2605
313
313
 
314
314
  #if ROS_VERSION >= 2505 // ROS2 >= Kilted
315
315
  Napi::Value ConfigureActionClientIntrospection(const Napi::CallbackInfo& info) {
@@ -369,14 +369,14 @@ Napi::Object InitActionClientBindings(Napi::Env env, Napi::Object exports) {
369
369
  exports.Set("configureActionClientIntrospection",
370
370
  Napi::Function::New(env, ConfigureActionClientIntrospection));
371
371
  #endif // ROS_VERSION >= 2505
372
- #if ROS_VERSION >= 5000 // ROS2 Rolling
372
+ #if ROS_VERSION >= 2605 // ROS2 Lyrical or newer
373
373
  exports.Set(
374
374
  "actionConfigureFeedbackSubFilterAddGoalId",
375
375
  Napi::Function::New(env, ActionConfigureFeedbackSubFilterAddGoalId));
376
376
  exports.Set(
377
377
  "actionConfigureFeedbackSubFilterRemoveGoalId",
378
378
  Napi::Function::New(env, ActionConfigureFeedbackSubFilterRemoveGoalId));
379
- #endif // ROS_VERSION >= 5000
379
+ #endif // ROS_VERSION >= 2605
380
380
  return exports;
381
381
  }
382
382
 
@@ -33,12 +33,12 @@ typedef rcl_ret_t (*rcl_get_info_by_topic_func_t)(
33
33
  const char* topic_name, bool no_mangle,
34
34
  rcl_topic_endpoint_info_array_t* info_array);
35
35
 
36
- #if ROS_VERSION > 2505
36
+ #if ROS_VERSION >= 2605
37
37
  typedef rcl_ret_t (*rcl_get_info_by_service_func_t)(
38
38
  const rcl_node_t* node, rcutils_allocator_t* allocator,
39
39
  const char* service_name, bool no_mangle,
40
40
  rcl_service_endpoint_info_array_t* info_array);
41
- #endif // ROS_VERSION > 2505
41
+ #endif // ROS_VERSION >= 2605
42
42
 
43
43
  Napi::Value GetPublisherNamesAndTypesByNode(const Napi::CallbackInfo& info) {
44
44
  Napi::Env env = info.Env();
@@ -264,7 +264,7 @@ Napi::Value GetSubscriptionsInfoByTopic(const Napi::CallbackInfo& info) {
264
264
  "subscriptions", rcl_get_subscriptions_info_by_topic);
265
265
  }
266
266
 
267
- #if ROS_VERSION > 2505
267
+ #if ROS_VERSION >= 2605
268
268
  Napi::Value GetInfoByService(
269
269
  Napi::Env env, rcl_node_t* node, const char* service_name, bool no_mangle,
270
270
  const char* type, rcl_get_info_by_service_func_t rcl_get_info_by_service) {
@@ -300,9 +300,9 @@ Napi::Value GetInfoByService(
300
300
 
301
301
  return ConvertToJSServiceEndpointInfoList(env, &info_array);
302
302
  }
303
- #endif // ROS_VERSION > 2505
303
+ #endif // ROS_VERSION >= 2605
304
304
 
305
- #if ROS_VERSION > 2505
305
+ #if ROS_VERSION >= 2605
306
306
  Napi::Value GetClientsInfoByService(const Napi::CallbackInfo& info) {
307
307
  RclHandle* node_handle = RclHandle::Unwrap(info[0].As<Napi::Object>());
308
308
  rcl_node_t* node = reinterpret_cast<rcl_node_t*>(node_handle->ptr());
@@ -322,7 +322,7 @@ Napi::Value GetServersInfoByService(const Napi::CallbackInfo& info) {
322
322
  return GetInfoByService(info.Env(), node, service_name.c_str(), no_mangle,
323
323
  "servers", rcl_get_servers_info_by_service);
324
324
  }
325
- #endif // ROS_VERSION > 2505
325
+ #endif // ROS_VERSION >= 2605
326
326
 
327
327
  Napi::Object InitGraphBindings(Napi::Env env, Napi::Object exports) {
328
328
  exports.Set("getPublisherNamesAndTypesByNode",
@@ -341,12 +341,12 @@ Napi::Object InitGraphBindings(Napi::Env env, Napi::Object exports) {
341
341
  Napi::Function::New(env, GetPublishersInfoByTopic));
342
342
  exports.Set("getSubscriptionsInfoByTopic",
343
343
  Napi::Function::New(env, GetSubscriptionsInfoByTopic));
344
- #if ROS_VERSION > 2505
344
+ #if ROS_VERSION >= 2605
345
345
  exports.Set("getClientsInfoByService",
346
346
  Napi::Function::New(env, GetClientsInfoByService));
347
347
  exports.Set("getServersInfoByService",
348
348
  Napi::Function::New(env, GetServersInfoByService));
349
- #endif // ROS_VERSION > 2505
349
+ #endif // ROS_VERSION >= 2605
350
350
  return exports;
351
351
  }
352
352
 
@@ -71,7 +71,7 @@ Napi::Value CreateLifecycleStateMachine(const Napi::CallbackInfo& info) {
71
71
  const rosidl_service_type_support_t* gs =
72
72
  GetServiceTypeSupport("lifecycle_msgs", "GetState");
73
73
 
74
- #if ROS_VERSION >= 5000 // ROS2 Rolling
74
+ #if ROS_VERSION >= 2605 // ROS2 Lyrical or newer
75
75
  rcl_lifecycle_state_machine_options_t options =
76
76
  rcl_lifecycle_get_default_state_machine_options();
77
77
  options.enable_com_interface = info[1].As<Napi::Boolean>().Value();
@@ -265,7 +265,7 @@ Napi::Value GetSubscriptionTopic(const Napi::CallbackInfo& info) {
265
265
  return Napi::String::New(env, topic);
266
266
  }
267
267
 
268
- #if ROS_VERSION > 2505 // Rolling only
268
+ #if ROS_VERSION >= 2605 // ROS2 Lyrical or newer
269
269
  Napi::Value IsContentFilterSupported(const Napi::CallbackInfo& info) {
270
270
  Napi::Env env = info.Env();
271
271
 
@@ -491,7 +491,7 @@ Napi::Object InitSubscriptionBindings(Napi::Env env, Napi::Object exports) {
491
491
  exports.Set("rclTakeRaw", Napi::Function::New(env, RclTakeRaw));
492
492
  exports.Set("getSubscriptionTopic",
493
493
  Napi::Function::New(env, GetSubscriptionTopic));
494
- #if ROS_VERSION > 2505 // Rolling only
494
+ #if ROS_VERSION >= 2605 // ROS2 Lyrical or newer
495
495
  exports.Set("isContentFilterSupported",
496
496
  Napi::Function::New(env, IsContentFilterSupported));
497
497
  #endif
@@ -78,6 +78,15 @@ Napi::Value CreateTimer(const Napi::CallbackInfo& info) {
78
78
 
79
79
  bool lossless;
80
80
  int64_t period_nsec = info[2].As<Napi::BigInt>().Int64Value(&lossless);
81
+ bool autostart = true;
82
+ if (info.Length() > 3) {
83
+ if (!info[3].IsBoolean()) {
84
+ Napi::TypeError::New(env, "Timer autostart must be a boolean")
85
+ .ThrowAsJavaScriptException();
86
+ return env.Undefined();
87
+ }
88
+ autostart = info[3].As<Napi::Boolean>().Value();
89
+ }
81
90
  rcl_timer_t* timer =
82
91
  reinterpret_cast<rcl_timer_t*>(malloc(sizeof(rcl_timer_t)));
83
92
  *timer = rcl_get_zero_initialized_timer();
@@ -85,8 +94,7 @@ Napi::Value CreateTimer(const Napi::CallbackInfo& info) {
85
94
  #if ROS_VERSION > 2305 // After Iron.
86
95
  {
87
96
  rcl_ret_t ret = rcl_timer_init2(timer, clock, context, period_nsec, nullptr,
88
- rcl_get_default_allocator(),
89
- /*autostart=*/true);
97
+ rcl_get_default_allocator(), autostart);
90
98
  if (RCL_RET_OK != ret) {
91
99
  std::string error_msg = rcl_get_error_string().str;
92
100
  rcl_reset_error();
@@ -106,6 +114,17 @@ Napi::Value CreateTimer(const Napi::CallbackInfo& info) {
106
114
  Napi::Error::New(env, error_msg).ThrowAsJavaScriptException();
107
115
  return env.Undefined();
108
116
  }
117
+ if (!autostart) {
118
+ rcl_ret_t cancel_ret = rcl_timer_cancel(timer);
119
+ if (RCL_RET_OK != cancel_ret) {
120
+ std::string error_msg = rcl_get_error_string().str;
121
+ rcl_reset_error();
122
+ rcl_timer_fini(timer);
123
+ free(timer);
124
+ Napi::Error::New(env, error_msg).ThrowAsJavaScriptException();
125
+ return env.Undefined();
126
+ }
127
+ }
109
128
  }
110
129
  #endif
111
130
 
@@ -124,7 +124,7 @@ Napi::Value ConvertToJSTopicEndpoint(
124
124
  return endpoint;
125
125
  }
126
126
 
127
- #if ROS_VERSION > 2505
127
+ #if ROS_VERSION >= 2605
128
128
  Napi::Value ConvertToJSServiceEndpointInfo(
129
129
  Napi::Env env, const rmw_service_endpoint_info_t* service_endpoint_info) {
130
130
  Napi::Object endpoint = Napi::Object::New(env);
@@ -164,7 +164,7 @@ Napi::Value ConvertToJSServiceEndpointInfo(
164
164
 
165
165
  return endpoint;
166
166
  }
167
- #endif // ROS_VERSION > 2505
167
+ #endif // ROS_VERSION >= 2605
168
168
 
169
169
  uv_lib_t g_lib;
170
170
  Napi::Env g_env = nullptr;
@@ -308,7 +308,7 @@ Napi::Array ConvertToJSTopicEndpointInfoList(
308
308
  return list;
309
309
  }
310
310
 
311
- #if ROS_VERSION > 2505
311
+ #if ROS_VERSION >= 2605
312
312
  Napi::Array ConvertToJSServiceEndpointInfoList(
313
313
  Napi::Env env, const rmw_service_endpoint_info_array_t* info_array) {
314
314
  Napi::Array list = Napi::Array::New(env, info_array->size);
@@ -319,7 +319,7 @@ Napi::Array ConvertToJSServiceEndpointInfoList(
319
319
  }
320
320
  return list;
321
321
  }
322
- #endif // ROS_VERSION > 2505
322
+ #endif // ROS_VERSION >= 2605
323
323
 
324
324
  char** AbstractArgsFromNapiArray(const Napi::Array& jsArgv) {
325
325
  size_t argc = jsArgv.Length();
@@ -51,10 +51,10 @@ void ExtractNamesAndTypes(rcl_names_and_types_t names_and_types,
51
51
  Napi::Array ConvertToJSTopicEndpointInfoList(
52
52
  Napi::Env env, const rmw_topic_endpoint_info_array_t* info_array);
53
53
 
54
- #if ROS_VERSION > 2505
54
+ #if ROS_VERSION >= 2605
55
55
  Napi::Array ConvertToJSServiceEndpointInfoList(
56
56
  Napi::Env env, const rmw_service_endpoint_info_array_t* info_array);
57
- #endif // ROS_VERSION > 2505
57
+ #endif // ROS_VERSION >= 2605
58
58
 
59
59
  Napi::Value ConvertToQoS(Napi::Env env, const rmw_qos_profile_t* qos_profile);
60
60
 
package/types/distro.d.ts CHANGED
@@ -3,7 +3,16 @@ declare module 'rclnodejs' {
3
3
  /**
4
4
  * Valid ROS 2 distro short names
5
5
  */
6
- type DistroName = 'eloquent' | 'foxy' | 'galactic' | 'humble' | 'rolling';
6
+ type DistroName =
7
+ | 'eloquent'
8
+ | 'foxy'
9
+ | 'galactic'
10
+ | 'humble'
11
+ | 'iron'
12
+ | 'jazzy'
13
+ | 'kilted'
14
+ | 'lyrical'
15
+ | 'rolling';
7
16
 
8
17
  /**
9
18
  * rclnodejs distro ID numbers
@@ -14,7 +23,12 @@ declare module 'rclnodejs' {
14
23
  FOXY = 2006,
15
24
  GALACTIC = 2105,
16
25
  HUMBLE = 2205,
26
+ IRON = 2305,
27
+ JAZZY = 2405,
28
+ KILTED = 2505,
29
+ LYRICAL = 2605,
17
30
  ROLLING = 5000,
31
+ FUTURE = 9999,
18
32
  }
19
33
 
20
34
  /**
package/types/node.d.ts CHANGED
@@ -80,6 +80,13 @@ declare module 'rclnodejs' {
80
80
  * inspect and limit messages that it accepts.
81
81
  */
82
82
  contentFilter?: SubscriptionContentFilter;
83
+
84
+ /**
85
+ * If provided, declares read-only ROS parameters for the specified QoS policies.
86
+ * These can be overridden at startup via `--ros-args -p` or `--params-file`.
87
+ * If qos is a profile string, it will be resolved to a mutable QoS object.
88
+ */
89
+ qosOverridingOptions?: QoSOverridingOptions;
83
90
  }
84
91
 
85
92
  /**
@@ -97,14 +104,24 @@ declare module 'rclnodejs' {
97
104
  */
98
105
  const DEFAULT_OPTIONS: Options;
99
106
 
107
+ interface TimerInfo {
108
+ expectedCallTime: bigint;
109
+ actualCallTime: bigint;
110
+ }
111
+
112
+ interface TimerOptions {
113
+ autostart?: boolean;
114
+ }
115
+
100
116
  /**
101
117
  * Callback for receiving periodic interrupts from a Timer.
118
+ * Receives timer metadata when the underlying ROS distro exposes it.
102
119
  *
103
120
  * @remarks
104
121
  * See {@link Node.createTimer | Node.createTimer}
105
122
  * See {@link Timer}
106
123
  */
107
- type TimerRequestCallback = () => void;
124
+ type TimerRequestCallback = (timerInfo?: TimerInfo) => void;
108
125
 
109
126
  /**
110
127
  * Callback indicating parameters are about to be declared or set.
@@ -123,6 +140,19 @@ declare module 'rclnodejs' {
123
140
  parameters: Parameter[]
124
141
  ) => rcl_interfaces.msg.SetParametersResult;
125
142
 
143
+ /**
144
+ * Callback invoked before parameter validation and setting.
145
+ * Receives the parameter list, must return a (possibly modified) parameter list.
146
+ * Returning an empty list rejects the set.
147
+ */
148
+ type PreSetParametersCallback = (parameters: Parameter[]) => Parameter[];
149
+
150
+ /**
151
+ * Callback invoked after parameters have been successfully set.
152
+ * For side effects only (return value is ignored).
153
+ */
154
+ type PostSetParametersCallback = (parameters: Parameter[]) => void;
155
+
126
156
  /**
127
157
  * Standard result of Node.getXXXNamesAndTypes() queries
128
158
  *
@@ -293,15 +323,18 @@ declare module 'rclnodejs' {
293
323
  /**
294
324
  * Create a Timer.
295
325
  *
296
- * @param period - Elapsed time between interrupt events (milliseconds).
297
- * @param callback - Called on timeout interrupt.
298
- * @param clock - Optional clock to use for the timer.
326
+ * @param period - Elapsed time between interrupt events in nanoseconds.
327
+ * @param callback - Called when the timer fires. Receives a `TimerInfo` argument when available.
328
+ * @param optionsOrClock - Optional timer options or clock to use for the timer.
329
+ * Supports `{ autostart?: boolean }` when an options object is provided.
330
+ * @param clock - Optional clock to use for the timer when options are provided.
299
331
  * @returns New instance of Timer.
300
332
  */
301
333
  createTimer(
302
334
  period: bigint,
303
335
  callback: TimerRequestCallback,
304
- clock?: Clock
336
+ optionsOrClock?: TimerOptions | Clock | null,
337
+ clock?: Clock | null
305
338
  ): Timer;
306
339
 
307
340
  /**
@@ -749,6 +782,37 @@ declare module 'rclnodejs' {
749
782
  */
750
783
  removeOnSetParametersCallback(call: SetParametersCallback): void;
751
784
 
785
+ /**
786
+ * Add a callback invoked before parameter validation.
787
+ * The callback receives the parameter list and must return a (possibly modified)
788
+ * parameter list. Returning an empty list rejects the set.
789
+ *
790
+ * @param callback - The callback to add.
791
+ */
792
+ addPreSetParametersCallback(callback: PreSetParametersCallback): void;
793
+
794
+ /**
795
+ * Remove a pre-set parameters callback.
796
+ *
797
+ * @param callback - The callback to remove.
798
+ */
799
+ removePreSetParametersCallback(callback: PreSetParametersCallback): void;
800
+
801
+ /**
802
+ * Add a callback invoked after parameters are successfully set.
803
+ * Useful for triggering side effects (e.g., reconfiguring a component).
804
+ *
805
+ * @param callback - The callback to add.
806
+ */
807
+ addPostSetParametersCallback(callback: PostSetParametersCallback): void;
808
+
809
+ /**
810
+ * Remove a post-set parameters callback.
811
+ *
812
+ * @param callback - The callback to remove.
813
+ */
814
+ removePostSetParametersCallback(callback: PostSetParametersCallback): void;
815
+
752
816
  /**
753
817
  * Get a remote node's published topics.
754
818
  *
@@ -97,6 +97,17 @@ declare module 'rclnodejs' {
97
97
  callback: (event: any) => void
98
98
  ): ParameterEventCallbackHandle;
99
99
 
100
+ /**
101
+ * Configure which node parameter events will be received.
102
+ *
103
+ * If nodeNames is omitted or empty, the node filter is cleared.
104
+ * Relative names are resolved against the handler node namespace.
105
+ *
106
+ * @param nodeNames - Node names to filter parameter events from.
107
+ * @returns True if the filter is active or was successfully cleared.
108
+ */
109
+ configureNodesFilter(nodeNames?: string[]): boolean;
110
+
100
111
  /**
101
112
  * Remove a previously added parameter event callback.
102
113
  *
package/types/qos.d.ts CHANGED
@@ -134,4 +134,59 @@ declare module 'rclnodejs' {
134
134
  RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE = 5,
135
135
  }
136
136
  }
137
+
138
+ /**
139
+ * Enum of overridable QoS policy kinds.
140
+ */
141
+ enum QoSPolicyKind {
142
+ HISTORY = 1,
143
+ DEPTH = 2,
144
+ RELIABILITY = 3,
145
+ DURABILITY = 4,
146
+ LIVELINESS = 5,
147
+ AVOID_ROS_NAMESPACE_CONVENTIONS = 6,
148
+ }
149
+
150
+ /**
151
+ * Options for overriding QoS policies via ROS parameters.
152
+ *
153
+ * When passed to `createPublisher()` or `createSubscription()`, the node
154
+ * declares read-only parameters for each specified policy kind. These
155
+ * parameters can be overridden at startup via `--ros-args -p` or `--params-file`.
156
+ *
157
+ * Parameter naming convention:
158
+ * `qos_overrides.<topic>.<publisher|subscription>[_<entityId>].<policy>`
159
+ */
160
+ class QoSOverridingOptions {
161
+ /**
162
+ * @param policyKinds - Which QoS policies to expose as parameters.
163
+ * @param opts - Optional callback and entityId.
164
+ */
165
+ constructor(
166
+ policyKinds: QoSPolicyKind[],
167
+ opts?: {
168
+ callback?: (qos: QoS) => { successful: boolean; reason?: string };
169
+ entityId?: string;
170
+ }
171
+ );
172
+
173
+ /** Which QoS policies are exposed as parameters. */
174
+ readonly policyKinds: QoSPolicyKind[];
175
+
176
+ /** Optional validation callback. */
177
+ readonly callback:
178
+ | ((qos: QoS) => { successful: boolean; reason?: string })
179
+ | null;
180
+
181
+ /** Optional entity disambiguation suffix. */
182
+ readonly entityId: string | null;
183
+
184
+ /**
185
+ * Create options that override history, depth, and reliability.
186
+ */
187
+ static withDefaultPolicies(opts?: {
188
+ callback?: (qos: QoS) => { successful: boolean; reason?: string };
189
+ entityId?: string;
190
+ }): QoSOverridingOptions;
191
+ }
137
192
  }
package/types/timer.d.ts CHANGED
@@ -78,8 +78,9 @@ declare module 'rclnodejs' {
78
78
 
79
79
  /**
80
80
  * Call a timer and starts counting again, retrieves actual and expected call time.
81
- * @return - The timer information.
81
+ *
82
+ * @return The timer information with expected and actual call timestamps.
82
83
  */
83
- callTimerWithInfo(): object;
84
+ callTimerWithInfo(): TimerInfo;
84
85
  }
85
86
  }
@@ -1,5 +0,0 @@
1
- .PHONY: docs
2
-
3
- docs:
4
- npx jsdoc --package ../../package.json ../../index.js ../../lib/*.js ../../lib/action/*.js -t . -d ../../docs
5
- node ./build-index.js
@@ -1,96 +0,0 @@
1
- # JSDoc Workflow
2
-
3
- This directory contains the custom JSDoc template, the landing-page generator,
4
- and the staging script used to prepare the docs content that is published to the
5
- `gh-pages` branch.
6
-
7
- ## Commands
8
-
9
- ### `npm run docs`
10
-
11
- Build local docs for the current workspace version.
12
-
13
- Output:
14
-
15
- - `docs/<current-version>/`
16
- - `docs/index.html`
17
-
18
- Use this to verify the docs for the version currently declared in
19
- `package.json`.
20
-
21
- ### `npm run docs:gh-pages`
22
-
23
- Stage the publishable docs tree under `build/gh-pages-docs/`.
24
-
25
- Behavior:
26
-
27
- - reads the currently published version set from `origin/gh-pages`
28
- - preserves that published history
29
- - regenerates docs for the current workspace version
30
- - rebuilds the staged landing page index
31
-
32
- This is the normal command to use for a new release.
33
-
34
- If you delete `build/` and rerun `npm run docs:gh-pages`, the staged tree will
35
- still contain all currently published versions. That command recreates
36
- `build/gh-pages-docs/` by copying the published docs snapshot from
37
- `origin/gh-pages`, then regenerating only the current workspace version.
38
-
39
- ### `npm run docs:gh-pages:full`
40
-
41
- Fully rebuild the currently published docs history under
42
- `build/gh-pages-docs/`.
43
-
44
- Behavior:
45
-
46
- - reads the published version set from `origin/gh-pages`
47
- - rebuilds only those published versions from tags
48
- - regenerates docs for the current workspace version
49
- - rebuilds the staged landing page index
50
-
51
- This does **not** rebuild docs for every historical `rclnodejs` tag. It only
52
- rebuilds the subset that is actually published online.
53
-
54
- ## New Release Example
55
-
56
- For a new release such as `1.9.0`:
57
-
58
- 1. Update `package.json` to `1.9.0`.
59
- 2. Run `npm run docs`.
60
- 3. Verify the local output in `docs/1.9.0/` and `docs/index.html`.
61
- 4. Run `npm run docs:gh-pages`.
62
- 5. Verify the staged output in:
63
- - `build/gh-pages-docs/docs/1.9.0/`
64
- - `build/gh-pages-docs/docs/index.html`
65
- - `build/gh-pages-docs/.nojekyll`
66
- 6. Publish the contents of `build/gh-pages-docs/` to the `gh-pages` branch.
67
-
68
- ## Manual Landing Page Rebuild
69
-
70
- If the staged docs tree already exists and you only want to rebuild
71
- `build/gh-pages-docs/docs/index.html`, run `tools/jsdoc/build-index.js` against
72
- that docs root and point it at the package metadata for the latest published
73
- version.
74
-
75
- Example for published version `1.8.0`:
76
-
77
- ```bash
78
- mkdir -p build/gh-pages-docs/.tmp
79
- git show 1.8.0:package.json > build/gh-pages-docs/.tmp/package-1.8.0.json
80
-
81
- export RCLNODEJS_DOCS_ROOT="$PWD/build/gh-pages-docs/docs"
82
- export RCLNODEJS_DOCS_INDEX_PATH="$PWD/build/gh-pages-docs/docs/index.html"
83
- export RCLNODEJS_LOCAL_INDEX_PATH=''
84
- export RCLNODEJS_PACKAGE_JSON_PATH="$PWD/build/gh-pages-docs/.tmp/package-1.8.0.json"
85
-
86
- node tools/jsdoc/build-index.js
87
- rm -rf build/gh-pages-docs/.tmp
88
- ```
89
-
90
- ## Notes
91
-
92
- - The staged publish output keeps shared assets in `build/gh-pages-docs/docs/_static/`.
93
- - `.nojekyll` must remain in the staged output because the published docs tree
94
- uses an underscore-prefixed directory.
95
- - The live docs index is the source of truth for which versions should remain
96
- published.