Skip to content
Snippets Groups Projects
Commit c51fd54d authored by Charles Javerliat's avatar Charles Javerliat Committed by Charles JAVERLIAT
Browse files

Add brake for n seconds method

parent 55b50107
No related branches found
No related tags found
No related merge requests found
......@@ -155,6 +155,14 @@ class CoordinatorNode():
last_theta = self.theta
time.sleep(send_interval)
def brake_for_n_seconds(self, secs):
start = rospy.get_rostime().secs
while rospy.get_rostime().secs - start < secs:
self.set_speed(0, 0)
time.sleep(send_interval)
def run(self):
self.change_pwm(True)
......@@ -169,11 +177,11 @@ class CoordinatorNode():
# self.move(0.8, forward=True)
self.turn(radians(45))
rospy.sleep(5)
self.brake_for_n_seconds(5)
self.turn(radians(-45))
rospy.sleep(5)
self.brake_for_n_seconds(5)
self.turn(radians(0))
rospy.sleep(5)
self.brake_for_n_seconds(5)
self.turn(radians(180))
# self.move(0.4, forward=False)
# self.turn(radians(-90))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment