Skip to content
Snippets Groups Projects
Commit d85fcc25 authored by Patrick Simmel's avatar Patrick Simmel
Browse files

changed stuff

parent be448df2
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ class Tb3(Node):
self.lin_vel_percent = 0
self.safe_distance = 0.4
self.drive_allowed = True
self.turn_allowed = False
self.turn_allowed = True
def vel(self, lin_vel_percent, ang_vel_percent=0):
""" publishes linear and angular velocities in percent
......@@ -52,13 +52,13 @@ class Tb3(Node):
if msg.ranges[0] > self.safe_distance:
self.vel(80, 0)
else:
if msg.intensities[0] == 2.0 and not self.turn_allowed:
if msg.intensities[0] == 2.0 and self.turn_allowed:
self.vel(0, 0)
print("Red wall found! \nTurning...")
self.vel(0, 85)
sleep(1)
self.vel(0, 0)
self.turn_allowed = True
self.turn_allowed = False
pass
elif msg.intensities[0] != 2.0:
print("Wall found!")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment