Skip to content

Commit 995bbed

Browse files
authored
Add doc-string warnings for destroy methods for services. (#1205)
Signed-off-by: Tomoya Fujita <[email protected]>
1 parent f57efa5 commit 995bbed

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

rclpy/rclpy/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,10 @@ def service_name(self) -> str:
217217
return self.__client.service_name
218218

219219
def destroy(self):
220+
"""
221+
Destroy a container for a ROS service client.
222+
223+
.. warning:: Users should not destroy a service client with this destructor, instead they
224+
should call :meth:`.Node.destroy_client`.
225+
"""
220226
self.__client.destroy_when_not_in_use()

rclpy/rclpy/publisher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(
3838
"""
3939
Create a container for a ROS publisher.
4040
41-
.. warning:: Users should not create a publisher with this constuctor, instead they should
41+
.. warning:: Users should not create a publisher with this constructor, instead they should
4242
call :meth:`.Node.create_publisher`.
4343
4444
A publisher is used as a primary means of communication in a ROS system by publishing

rclpy/rclpy/service.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(
4040
"""
4141
Create a container for a ROS service server.
4242
43-
.. warning:: Users should not create a service server with this constuctor, instead they
43+
.. warning:: Users should not create a service server with this constructor, instead they
4444
should call :meth:`.Node.create_service`.
4545
4646
:param service_impl: :class:`_rclpy.Service` wrapping the underlying ``rcl_service_t``
@@ -108,4 +108,10 @@ def service_name(self) -> str:
108108
return self.__service.name
109109

110110
def destroy(self):
111+
"""
112+
Destroy a container for a ROS service server.
113+
114+
.. warning:: Users should not destroy a service server with this destructor, instead they
115+
should call :meth:`.Node.destroy_service`.
116+
"""
111117
self.__service.destroy_when_not_in_use()

0 commit comments

Comments
 (0)