From bf210bb20271ce307b960864f3bbe2abb75a926f Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Mon, 14 Oct 2024 18:57:56 -0700 Subject: [PATCH] Typo and unused import removal Signed-off-by: Shane Loretz --- .../Migrating-from-ROS1/Migrating-Python-Package-Example.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst b/source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst index 2f109176f0..0a076454b4 100644 --- a/source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst +++ b/source/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Package-Example.rst @@ -645,7 +645,7 @@ Start with getting the time. ROS 2 nodes have a ``Clock`` instance. Replace the call to ``rospy.get_time()`` with ``node.get_clock().now()`` to get the current time from the node's clock. -Next, replace the use of ``%`` with an f-string: ``f'hello world {self.get_clock().now()}'``. +Next, replace the use of ``%`` with an f-string: ``f'hello world {node.get_clock().now()}'``. Finally, instantiate a ``std_msgs.msg.String()`` instance and assign the above to the ``data`` attribute of that instance. Your final code should look like this: @@ -826,8 +826,6 @@ Your refactored code might look like this: .. code-block:: Python - import threading - import rclpy from rclpy.node import Node from rclpy.executors import ExternalShutdownException