[ROS2] time.sleep() in a node [closed]
Basically, I want to do the same thing as described in this other question but in ROS2: https://answers.ros.org/question/2333...
In ROS1 I would just use
do_something()
rospy.sleep(1)
do_something_else()
In ROS 2 we have rclpy.timer.Timer and rclpy.timer.Rate. However, Timer needs a callback and both need a node attached. Is there anything as simple as rclpy.sleep(1)?
Yes there is something like
rate = node.create_timer(1)
andrate.sleep()
exist in the rclpy. Please refer this answer.Duplicate https://answers.ros.org/question/3583...