Skip to content

Commit ec17f02

Browse files
committed
Address comments
1 parent a1f4f40 commit ec17f02

File tree

2 files changed

+42
-16
lines changed

2 files changed

+42
-16
lines changed

lib/node.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,18 +1080,19 @@ class Node extends rclnodejs.ShadowNode {
10801080
*
10811081
* When the `no_mangle` parameter is `true`, the provided `topic` should be a valid
10821082
* topic name for the middleware (useful when combining ROS with native middleware (e.g. DDS)
1083-
* apps). When the `no_mangle` parameter is `False`, the provided `topic` should
1083+
* apps). When the `no_mangle` parameter is `false`, the provided `topic` should
10841084
* follow ROS topic name conventions.
10851085
*
10861086
* `topic` may be a relative, private, or fully qualified topic name.
10871087
* A relative or private topic will be expanded using this node's namespace and name.
10881088
* The queried `topic` is not remapped.
1089+
*
10891090
* @param {string} topic - The topic on which to find the publishers.
1090-
* @param {boolean} noDemangle - If `true`, `topic` needs to be a valid middleware topic
1091+
* @param {boolean} [noDemangle=false] - If `true`, `topic` needs to be a valid middleware topic
10911092
* name, otherwise it should be a valid ROS topic name. Defaults to `false`.
10921093
* @returns {Array} - list of publishers
10931094
*/
1094-
getPublishersInfoByTopic(topic, noDemangle) {
1095+
getPublishersInfoByTopic(topic, noDemangle = false) {
10951096
return rclnodejs.getPublishersInfoByTopic(
10961097
this.handle,
10971098
this._getValidatedTopic(topic, noDemangle),
@@ -1107,18 +1108,19 @@ class Node extends rclnodejs.ShadowNode {
11071108
*
11081109
* When the `no_mangle` parameter is `true`, the provided `topic` should be a valid
11091110
* topic name for the middleware (useful when combining ROS with native middleware (e.g. DDS)
1110-
* apps). When the `no_mangle` parameter is `False`, the provided `topic` should
1111+
* apps). When the `no_mangle` parameter is `false`, the provided `topic` should
11111112
* follow ROS topic name conventions.
11121113
*
11131114
* `topic` may be a relative, private, or fully qualified topic name.
11141115
* A relative or private topic will be expanded using this node's namespace and name.
11151116
* The queried `topic` is not remapped.
1117+
*
11161118
* @param {string} topic - The topic on which to find the subscriptions.
1117-
* @param {boolean} noDemangle - If `True`, `topic` needs to be a valid middleware topic
1118-
name, otherwise it should be a valid ROS topic name. Defaults to `False`.
1119+
* @param {boolean} [noDemangle=false] - If `true`, `topic` needs to be a valid middleware topic
1120+
name, otherwise it should be a valid ROS topic name. Defaults to `false`.
11191121
* @returns {Array} - list of subscriptions
11201122
*/
1121-
getSubscriptionsInfoByTopic(topic, noDemangle) {
1123+
getSubscriptionsInfoByTopic(topic, noDemangle = false) {
11221124
return rclnodejs.getSubscriptionsInfoByTopic(
11231125
this.handle,
11241126
this._getValidatedTopic(topic, noDemangle),
@@ -1457,7 +1459,7 @@ class Node extends rclnodejs.ShadowNode {
14571459
* Determine if a parameter descriptor exists.
14581460
*
14591461
* @param {string} name - The name of a descriptor to for.
1460-
* @return {boolean} - True if a descriptor has been declared; otherwise false.
1462+
* @return {boolean} - true if a descriptor has been declared; otherwise false.
14611463
*/
14621464
hasParameterDescriptor(name) {
14631465
return !!this.getParameterDescriptor(name);

types/node.d.ts

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -750,21 +750,45 @@ declare module 'rclnodejs' {
750750
getServiceNamesAndTypes(): Array<NamesAndTypesQueryResult>;
751751

752752
/**
753-
* Get an array of publishers on a given topic.
753+
* Return a list of publishers on a given topic.
754754
*
755-
* @param topic - The name of the topic.
756-
* @param noDemangle - if `true`, `topic_name` needs to be a valid middleware topic name,
757-
* otherwise it should be a valid ROS topic name.
755+
* The returned parameter is a list of TopicEndpointInfo objects, where each will contain
756+
* the node name, node namespace, topic type, topic endpoint's GID, and its QoS profile.
757+
*
758+
* When the `no_mangle` parameter is `true`, the provided `topic` should be a valid
759+
* topic name for the middleware (useful when combining ROS with native middleware (e.g. DDS)
760+
* apps). When the `no_mangle` parameter is `false`, the provided `topic` should
761+
* follow ROS topic name conventions.
762+
*
763+
* `topic` may be a relative, private, or fully qualified topic name.
764+
* A relative or private topic will be expanded using this node's namespace and name.
765+
* The queried `topic` is not remapped.
766+
*
767+
* @param topic - The topic on which to find the publishers.
768+
* @param [noDemangle=false] - If `true`, `topic` needs to be a valid middleware topic
769+
* name, otherwise it should be a valid ROS topic name. Defaults to `false`.
758770
* @returns An array of publishers.
759771
*/
760772
getPublishersInfoByTopic(topic: string, noDemangle: boolean): Array<object>;
761773

762774
/**
763-
* Get an array of subscriptions on a given topic.
775+
* Return a list of subscriptions on a given topic.
764776
*
765-
* @param topic - The name of the topic.
766-
* @param noDemangle - if `true`, `topic_name` needs to be a valid middleware topic name,
767-
* otherwise it should be a valid ROS topic name.
777+
* The returned parameter is a list of TopicEndpointInfo objects, where each will contain
778+
* the node name, node namespace, topic type, topic endpoint's GID, and its QoS profile.
779+
*
780+
* When the `no_mangle` parameter is `true`, the provided `topic` should be a valid
781+
* topic name for the middleware (useful when combining ROS with native middleware (e.g. DDS)
782+
* apps). When the `no_mangle` parameter is `false`, the provided `topic` should
783+
* follow ROS topic name conventions.
784+
*
785+
* `topic` may be a relative, private, or fully qualified topic name.
786+
* A relative or private topic will be expanded using this node's namespace and name.
787+
* The queried `topic` is not remapped.
788+
*
789+
* @param topic - The topic on which to find the subscriptions..
790+
* @param [noDemangle=false] - If `true`, `topic` needs to be a valid middleware topic
791+
name, otherwise it should be a valid ROS topic name. Defaults to `false`.
768792
* @returns An array of subscriptions.
769793
*/
770794
getSubscriptionsInfoByTopic(

0 commit comments

Comments
 (0)