rclnodejs 0.32.5 → 1.0.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 (68) hide show
  1. package/README.md +3 -3
  2. package/binding.gyp +17 -2
  3. package/lib/client.js +2 -3
  4. package/lib/context.js +8 -0
  5. package/lib/logging.js +26 -9
  6. package/lib/node.js +68 -1
  7. package/lib/publisher.js +8 -0
  8. package/lib/service.js +9 -2
  9. package/lib/subscription.js +8 -0
  10. package/lib/timer.js +32 -0
  11. package/package.json +4 -4
  12. package/rostsd_gen/index.js +167 -67
  13. package/scripts/config.js +1 -0
  14. package/scripts/npmjs-readme.md +3 -3
  15. package/src/addon.cpp +54 -53
  16. package/src/executor.cpp +19 -10
  17. package/src/{executor.hpp → executor.h} +7 -5
  18. package/src/handle_manager.cpp +30 -56
  19. package/src/{handle_manager.hpp → handle_manager.h} +8 -7
  20. package/src/{macros.hpp → macros.h} +7 -5
  21. package/src/rcl_action_client_bindings.cpp +231 -0
  22. package/src/{rcl_action_bindings.hpp → rcl_action_client_bindings.h} +6 -11
  23. package/src/rcl_action_goal_bindings.cpp +117 -0
  24. package/src/rcl_action_goal_bindings.h +26 -0
  25. package/src/rcl_action_server_bindings.cpp +470 -0
  26. package/src/rcl_action_server_bindings.h +26 -0
  27. package/src/rcl_bindings.cpp +42 -1979
  28. package/src/{rcl_bindings.hpp → rcl_bindings.h} +5 -25
  29. package/src/rcl_client_bindings.cpp +183 -0
  30. package/src/rcl_client_bindings.h +26 -0
  31. package/src/rcl_context_bindings.cpp +156 -0
  32. package/src/rcl_context_bindings.h +26 -0
  33. package/src/rcl_graph_bindings.cpp +280 -0
  34. package/src/rcl_graph_bindings.h +26 -0
  35. package/src/rcl_guard_condition_bindings.cpp +75 -0
  36. package/src/rcl_guard_condition_bindings.h +26 -0
  37. package/src/rcl_handle.cpp +41 -57
  38. package/src/{rcl_handle.hpp → rcl_handle.h} +18 -17
  39. package/src/rcl_lifecycle_bindings.cpp +135 -114
  40. package/src/{rcl_lifecycle_bindings.hpp → rcl_lifecycle_bindings.h} +5 -7
  41. package/src/rcl_logging_bindings.cpp +96 -0
  42. package/src/rcl_logging_bindings.h +26 -0
  43. package/src/rcl_names_bindings.cpp +255 -0
  44. package/src/rcl_names_bindings.h +26 -0
  45. package/src/rcl_node_bindings.cpp +447 -0
  46. package/src/rcl_node_bindings.h +26 -0
  47. package/src/rcl_publisher_bindings.cpp +141 -0
  48. package/src/rcl_publisher_bindings.h +26 -0
  49. package/src/rcl_service_bindings.cpp +185 -0
  50. package/src/rcl_service_bindings.h +26 -0
  51. package/src/rcl_subscription_bindings.cpp +335 -0
  52. package/src/rcl_subscription_bindings.h +26 -0
  53. package/src/rcl_time_point_bindings.cpp +194 -0
  54. package/src/rcl_time_point_bindings.h +26 -0
  55. package/src/rcl_timer_bindings.cpp +237 -0
  56. package/src/rcl_timer_bindings.h +26 -0
  57. package/src/rcl_utilities.cpp +166 -1
  58. package/src/{rcl_utilities.hpp → rcl_utilities.h} +21 -3
  59. package/src/shadow_node.cpp +56 -75
  60. package/src/{shadow_node.hpp → shadow_node.h} +18 -17
  61. package/types/context.d.ts +6 -0
  62. package/types/interfaces.d.ts +4377 -0
  63. package/types/node.d.ts +53 -0
  64. package/types/publisher.d.ts +6 -0
  65. package/types/service.d.ts +6 -0
  66. package/types/subscription.d.ts +6 -0
  67. package/types/timer.d.ts +18 -0
  68. package/src/rcl_action_bindings.cpp +0 -826
package/types/node.d.ts CHANGED
@@ -685,6 +685,22 @@ declare module 'rclnodejs' {
685
685
  namespace?: string
686
686
  ): Array<NamesAndTypesQueryResult>;
687
687
 
688
+ /**
689
+ * Get a remote node's client topics.
690
+ *
691
+ * @param remoteNodeName - Name of the remote node.
692
+ * @param namespace - Name of the remote namespace.
693
+ * @returns An array of the names and types.
694
+ * [
695
+ * { name: '/rosout', types: [ 'rcl_interfaces/msg/Log' ] },
696
+ * ...
697
+ * ]
698
+ */
699
+ getClientNamesAndTypesByNode(
700
+ remoteNodeName: string,
701
+ namespace?: string
702
+ ): Array<NamesAndTypesQueryResult>;
703
+
688
704
  /**
689
705
  * Get this node's topics and corresponding types.
690
706
  *
@@ -711,6 +727,29 @@ declare module 'rclnodejs' {
711
727
  */
712
728
  getServiceNamesAndTypes(): Array<NamesAndTypesQueryResult>;
713
729
 
730
+ /**
731
+ * Get an array of publishers on a given topic.
732
+ *
733
+ * @param topic - The name of the topic.
734
+ * @param noDemangle - if `true`, `topic_name` needs to be a valid middleware topic name,
735
+ * otherwise it should be a valid ROS topic name.
736
+ * @returns An array of publishers.
737
+ */
738
+ getPublishersInfoByTopic(topic: string, noDemangle: boolean): Array<object>;
739
+
740
+ /**
741
+ * Get an array of subscriptions on a given topic.
742
+ *
743
+ * @param topic - The name of the topic.
744
+ * @param noDemangle - if `true`, `topic_name` needs to be a valid middleware topic name,
745
+ * otherwise it should be a valid ROS topic name.
746
+ * @returns An array of subscriptions.
747
+ */
748
+ getSubscriptionsInfoByTopic(
749
+ topic: string,
750
+ noDemangle: boolean
751
+ ): Array<object>;
752
+
714
753
  /**
715
754
  * Get the list of nodes discovered by the provided node.
716
755
  *
@@ -743,5 +782,19 @@ declare module 'rclnodejs' {
743
782
  * @returns Number of subscribers on the given topic.
744
783
  */
745
784
  countSubscribers(topic: string): number;
785
+
786
+ /**
787
+ * Get the number of clients on a given service name.
788
+ * @param serviceName - The service name.
789
+ * @returns Number of clients.
790
+ */
791
+ countClients(serviceName: string): number;
792
+
793
+ /**
794
+ * Get the number of services on a given service name.
795
+ * @param serviceName - The service name.
796
+ * @returns Number of services.
797
+ */
798
+ countServices(serviceName: string): number;
746
799
  }
747
800
  }
@@ -14,5 +14,11 @@ declare module 'rclnodejs' {
14
14
  * @param message - The message to be sent.
15
15
  */
16
16
  publish(message: MessageType<T> | Buffer): void;
17
+
18
+ /**
19
+ * Get the number of subscriptions to this publisher.
20
+ * @returns The number of subscriptions
21
+ */
22
+ subscriptionCount(): number;
17
23
  }
18
24
  }
@@ -88,5 +88,11 @@ declare module 'rclnodejs' {
88
88
  serviceEventPubQOS: QoS,
89
89
  introspectionState: ServiceIntrospectionStates
90
90
  ): void;
91
+
92
+ /**
93
+ * Get the options of this service.
94
+ * @return The options of this service.
95
+ */
96
+ getOptions(): object;
91
97
  }
92
98
  }
@@ -66,5 +66,11 @@ declare module 'rclnodejs' {
66
66
  * @returns True if successful; false otherwise
67
67
  */
68
68
  clearContentFilter(): boolean;
69
+
70
+ /**
71
+ * Get the number of publishers to this subscription.
72
+ * @returns The number of publishers
73
+ */
74
+ publisherCount(): number;
69
75
  }
70
76
  }
package/types/timer.d.ts CHANGED
@@ -45,5 +45,23 @@ declare module 'rclnodejs' {
45
45
  * @returns The interval value in nanoseconds
46
46
  */
47
47
  timeUntilNextCall(): bigint;
48
+
49
+ /**
50
+ * Change the timer period.
51
+ * @param period - The new period in nanoseconds.
52
+ */
53
+ changeTimerPeriod(period: bigint): void;
54
+
55
+ /**
56
+ * Get the timer period.
57
+ * @return The period in nanoseconds.
58
+ */
59
+ timerPeriod(): bigint;
60
+
61
+ /**
62
+ * Call a timer and starts counting again, retrieves actual and expected call time.
63
+ * @return - The timer information.
64
+ */
65
+ callTimerWithInfo(): object;
48
66
  }
49
67
  }