Calculate the velocity based on the "map" points and other data
"""
now=time.time()
# If scan data received more than 1s ago, stop the robot
ifnow-self._previousScanTime>1:
print("STOP ROBOT")
returnTwist()# Return a zero velocity
# If it's been rotating for more than 5s, it's probably stuck in a corner, so we rotate it completely, until >3.14s which is equivalent to a rotation of >180°