rclnodejs 1.7.0 → 1.8.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 (65) hide show
  1. package/binding.gyp +2 -0
  2. package/index.js +93 -0
  3. package/lib/action/client.js +54 -1
  4. package/lib/client.js +66 -1
  5. package/lib/clock.js +178 -0
  6. package/lib/clock_change.js +49 -0
  7. package/lib/clock_event.js +88 -0
  8. package/lib/errors.js +50 -0
  9. package/lib/logging.js +78 -0
  10. package/lib/message_introspector.js +123 -0
  11. package/lib/message_validation.js +512 -0
  12. package/lib/node.js +133 -1
  13. package/lib/node_options.js +40 -1
  14. package/lib/observable_subscription.js +105 -0
  15. package/lib/publisher.js +56 -1
  16. package/lib/qos.js +57 -0
  17. package/lib/subscription.js +8 -0
  18. package/lib/timer.js +42 -0
  19. package/lib/validator.js +63 -7
  20. package/package.json +4 -2
  21. package/prebuilds/linux-arm64/humble-jammy-arm64-rclnodejs.node +0 -0
  22. package/prebuilds/linux-arm64/jazzy-noble-arm64-rclnodejs.node +0 -0
  23. package/prebuilds/linux-arm64/kilted-noble-arm64-rclnodejs.node +0 -0
  24. package/prebuilds/linux-x64/humble-jammy-x64-rclnodejs.node +0 -0
  25. package/prebuilds/linux-x64/jazzy-noble-x64-rclnodejs.node +0 -0
  26. package/prebuilds/linux-x64/kilted-noble-x64-rclnodejs.node +0 -0
  27. package/rosidl_gen/message_translator.js +0 -61
  28. package/scripts/config.js +1 -0
  29. package/src/addon.cpp +2 -0
  30. package/src/clock_event.cpp +268 -0
  31. package/src/clock_event.hpp +62 -0
  32. package/src/macros.h +2 -4
  33. package/src/rcl_action_server_bindings.cpp +21 -3
  34. package/src/rcl_bindings.cpp +59 -0
  35. package/src/rcl_context_bindings.cpp +5 -0
  36. package/src/rcl_graph_bindings.cpp +73 -0
  37. package/src/rcl_logging_bindings.cpp +158 -0
  38. package/src/rcl_node_bindings.cpp +14 -2
  39. package/src/rcl_publisher_bindings.cpp +12 -0
  40. package/src/rcl_service_bindings.cpp +7 -6
  41. package/src/rcl_subscription_bindings.cpp +51 -14
  42. package/src/rcl_time_point_bindings.cpp +135 -0
  43. package/src/rcl_timer_bindings.cpp +140 -0
  44. package/src/rcl_utilities.cpp +103 -2
  45. package/src/rcl_utilities.h +7 -1
  46. package/types/action_client.d.ts +27 -2
  47. package/types/base.d.ts +3 -0
  48. package/types/client.d.ts +29 -1
  49. package/types/clock.d.ts +86 -0
  50. package/types/clock_change.d.ts +27 -0
  51. package/types/clock_event.d.ts +51 -0
  52. package/types/errors.d.ts +49 -0
  53. package/types/index.d.ts +10 -0
  54. package/types/interfaces.d.ts +1 -1910
  55. package/types/logging.d.ts +32 -0
  56. package/types/message_introspector.d.ts +75 -0
  57. package/types/message_validation.d.ts +183 -0
  58. package/types/node.d.ts +67 -0
  59. package/types/node_options.d.ts +13 -0
  60. package/types/observable_subscription.d.ts +39 -0
  61. package/types/publisher.d.ts +28 -1
  62. package/types/qos.d.ts +18 -0
  63. package/types/subscription.d.ts +6 -0
  64. package/types/timer.d.ts +18 -0
  65. package/types/validator.d.ts +86 -0
package/types/errors.d.ts CHANGED
@@ -149,6 +149,55 @@ declare module 'rclnodejs' {
149
149
  );
150
150
  }
151
151
 
152
+ /**
153
+ * A single validation issue found during message validation
154
+ */
155
+ export interface MessageValidationIssue {
156
+ /** Field path where issue occurred (e.g., 'linear.x' or 'data') */
157
+ field: string;
158
+ /** Problem type (UNKNOWN_FIELD, TYPE_MISMATCH, etc.) */
159
+ problem: string;
160
+ /** Expected type or value */
161
+ expected?: string;
162
+ /** Actual value received */
163
+ received?: any;
164
+ }
165
+
166
+ /**
167
+ * Message validation error for ROS message structure/type issues
168
+ */
169
+ export class MessageValidationError extends ValidationError {
170
+ /** The ROS message type (e.g., 'std_msgs/msg/String') */
171
+ messageType: string;
172
+ /** Array of validation issues found */
173
+ issues: MessageValidationIssue[];
174
+
175
+ /**
176
+ * @param messageType - The ROS message type
177
+ * @param issues - Array of validation issues
178
+ * @param options - Additional options
179
+ */
180
+ constructor(
181
+ messageType: string,
182
+ issues: MessageValidationIssue[],
183
+ options?: RclNodeErrorOptions
184
+ );
185
+
186
+ /**
187
+ * Get issues filtered by problem type
188
+ * @param problemType - Problem type to filter by
189
+ * @returns Filtered issues
190
+ */
191
+ getIssuesByType(problemType: string): MessageValidationIssue[];
192
+
193
+ /**
194
+ * Check if a specific field has validation issues
195
+ * @param fieldPath - Field path to check
196
+ * @returns True if field has issues
197
+ */
198
+ hasFieldIssue(fieldPath: string): boolean;
199
+ }
200
+
152
201
  /**
153
202
  * ROS name validation error (topics, nodes, services)
154
203
  */
package/types/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  /// <reference path="./base.d.ts" />
2
+ /// <reference path="./clock_event.d.ts" />
3
+ /// <reference path="./clock_change.d.ts" />
4
+ /// <reference path="./message_validation.d.ts" />
2
5
 
3
6
  import { ChildProcess } from 'child_process';
4
7
 
@@ -58,6 +61,13 @@ declare module 'rclnodejs' {
58
61
  */
59
62
  function init(context?: Context, argv?: string[]): Promise<void>;
60
63
 
64
+ /**
65
+ * Remove ROS-specific arguments from the given argument list.
66
+ * @param argv - The argument list to process.
67
+ * @returns The argument list with ROS arguments removed.
68
+ */
69
+ function removeROSArgs(argv: string[]): string[];
70
+
61
71
  /**
62
72
  * Start detection and processing of units of work.
63
73
  *