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

fix turn ?

parent bafac0ce
No related branches found
No related tags found
No related merge requests found
......@@ -147,8 +147,16 @@ class CoordinatorNode():
while theta_accum < abs(theta):
dTheta = ((360 - abs(self.theta - last_theta)) if theta <
0 else abs(self.theta - last_theta)) % (2 * pi)
if theta > 0:
if self.theta < last_theta:
dTheta = abs(2 * pi + self.theta - last_theta)
else:
dTheta = abs(self.theta - last_theta)
else:
if self.theta > last_theta:
dTheta = abs(2 * pi - self.theta - last_theta)
else:
dTheta = abs(self.theta - last_theta)
theta_accum = theta_accum + dTheta
if abs(theta_accum - abs(theta)) <= radians(3):
......@@ -184,8 +192,6 @@ class CoordinatorNode():
self.brake_for_n_seconds(5)
self.turn(radians(-45))
self.brake_for_n_seconds(5)
self.turn(radians(0))
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