Skip to content

Commit

Permalink
Typo and unused import removal
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Loretz <[email protected]>
  • Loading branch information
sloretz committed Oct 15, 2024
1 parent f6f6602 commit bf210bb
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bf210bb

Please sign in to comment.