if(notself._firstPointSeen):#If you were previously moving straight without obstacles
self._firstPointSeen=(x,y)
...
...
@@ -98,22 +104,22 @@ class ReactiveMove(Node):
ifxandy:# If there is a point in front at the moment
# Linear movement
ifx<self.MIN_DIST_MOVE_FORWARD:
ifx<self.paramDouble('MIN_DIST_MOVE_FORWARD'):
velocity.linear.x=0.0#If the wall is too close, don't go forward, only rotate
else:
coefficient=(x-self.MIN_DIST_MOVE_FORWARD)/(self.MAX_DIST_MOVE_FORWARD-self.MIN_DIST_MOVE_FORWARD)#linear between 0 (MIN_DIST_MOVE_FORWARD) and 1 (MAX_DIST_MOVE_FORWARD)
coefficient=(x-self.paramDouble('MIN_DIST_MOVE_FORWARD'))/(self.paramDouble('MAX_DIST_MOVE_FORWARD')-self.paramDouble('MIN_DIST_MOVE_FORWARD'))#linear between 0 (MIN_DIST_MOVE_FORWARD) and 1 (MAX_DIST_MOVE_FORWARD)