Exemplo n.º 1
0
 def is_free_motion(self, obstacles, x1, x2, resolution = np.pi/6):
     pts = path_sample(x1, x2, self.turning_radius, self.turning_radius*resolution)[0]
     pts.append(x2)
     for i in range(len(pts) - 1):
         for line in obstacles:
             if line_line_intersection([pts[i][:2], pts[i+1][:2]], line):
                 return False
     return True
Exemplo n.º 2
0
 def is_free_motion(self, obstacles, x1, x2):
     motion = np.array([x1, x2])
     # print "motion = ", motion
     for line in obstacles:
         if line_line_intersection(motion, line):
             # print "False"
             return False
     # print "True"
     return True
Exemplo n.º 3
0
 def is_free_motion(self, obstacles, x1, x2):
     motion = np.array([x1, x2])
     for line in obstacles:
         if line_line_intersection(motion, line):
             return False
     return True