From a3272a5ef711cdf581c70e01f10e6a6c98a85452 Mon Sep 17 00:00:00 2001 From: Miaofei Date: Sat, 18 Jan 2020 10:34:10 -0800 Subject: [PATCH] fix doc strings Signed-off-by: Miaofei --- rclpy/rclpy/node.py | 34 ++++++++++++++++++---------------- rclpy/src/rclpy/_rclpy.c | 8 ++++---- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/rclpy/rclpy/node.py b/rclpy/rclpy/node.py index 3e1d930b1..5a871726e 100644 --- a/rclpy/rclpy/node.py +++ b/rclpy/rclpy/node.py @@ -1665,17 +1665,18 @@ def get_publishers_info_by_topic( The returned parameter is a list of dictionaries, where each dictionary will contain the node name, node namespace, topic type, participant's GID and its QoS profile. - 'topic_name' may be a relative, private or fully qualified topic name. - A relative or private topic will be expanded using this node's namespace and name, if - the 'no_mangle' param is set to false. + When the `no_mangle` parameter is `true`, the provided `topic_name` should be a valid topic + name for the middleware (useful when combining ROS with native middleware (e.g. DDS) apps). + When the `no_mangle` parameter is `false`, the provided `topic_name` should follow + ROS topic name conventions. - The queried topic name is not remapped. - - 'no_mangle' defaults to false. + `topic_name` may be a relative, private, or fully qualified topic name. + A relative or private topic will be expanded using this node's namespace and name. + The queried `topic_name` is not remapped. :param topic_name: the topic_name on which to find the publishers. - :param no_mangle: if false, the given topic name will be expanded - to its fully qualified name. + :param no_mangle: no_mangle if `true`, `topic_name` needs to be a valid middleware topic + name, otherwise it should be a valid ROS topic name. Defaults to `false`. :return: a list of dictionaries representing all the publishers on this topic. """ return self._get_info_by_topic( @@ -1691,17 +1692,18 @@ def get_subscriptions_info_by_topic( The returned parameter is a list of dictionaries, where each dictionary will contain the node name, node namespace, topic type, participant's GID and its QoS profile. - 'topic_name' may be a relative, private or fully qualified topic name. - A relative or private topic will be expanded using this node's namespace and name, if - the 'no_mangle' param is set to false. - - The queried topic name is not remapped. + When the `no_mangle` parameter is `true`, the provided `topic_name` should be a valid topic + name for the middleware (useful when combining ROS with native middleware (e.g. DDS) apps). + When the `no_mangle` parameter is `false`, the provided `topic_name` should follow + ROS topic name conventions. - 'no_mangle' defaults to false. + `topic_name` may be a relative, private, or fully qualified topic name. + A relative or private topic will be expanded using this node's namespace and name. + The queried `topic_name` is not remapped. :param topic_name: the topic_name on which to find the subscriptions. - :param no_mangle: if false, the given topic name will be expanded - to its fully qualified name. + :param no_mangle: no_mangle if `true`, `topic_name` needs to be a valid middleware topic + name, otherwise it should be a valid ROS topic name. Defaults to `false`. :return: a list of dictionaries representing all the subscriptions on this topic. """ return self._get_info_by_topic( diff --git a/rclpy/src/rclpy/_rclpy.c b/rclpy/src/rclpy/_rclpy.c index 0ab61dcc3..ace646d5b 100644 --- a/rclpy/src/rclpy/_rclpy.c +++ b/rclpy/src/rclpy/_rclpy.c @@ -917,8 +917,8 @@ _get_info_by_topic( * * \param[in] pynode Capsule pointing to the node to get the namespace from. * \param[in] topic_name the topic name to get the publishers for. - * \param[in] no_mangle if true the given topic name will be - * expanded to its fully qualified name. + * \param[in] no_mangle if `true`, `topic_name` needs to be a valid middleware topic name, + * otherwise it should be a valid ROS topic name. * \return list of publishers */ static PyObject * @@ -934,8 +934,8 @@ rclpy_get_publishers_info_by_topic(PyObject * Py_UNUSED(self), PyObject * args) * * \param[in] pynode Capsule pointing to the node to get the namespace from. * \param[in] topic_name the topic name to get the subscriptions for. - * \param[in] no_mangle if true the given topic name will be - * expanded to its fully qualified name. + * \param[in] no_mangle if `true`, `topic_name` needs to be a valid middleware topic name, + * otherwise it should be a valid ROS topic name. * \return list of subscriptions. */ static PyObject *