Esempio n. 1
0
 def replan(self, restarts=RRT_RESTARTS, iterations=RRT_ITERATIONS, smooth=RRT_SMOOTHING):
   body = self.cspace.body
   with body:
     self.cspace.set_active()
     path = birrt(self.start(), self.end(), distance_fn(body), sample_fn(body), extend_fn(body), collision_fn(get_env(), body),
                  restarts=restarts, iterations=iterations, smooth=smooth)
     if path is None: return None
     return PathTrajectory(self.cspace, path)
Esempio n. 2
0
 def shortcut(self):
   with self.cspace.body:
     self.cspace.set_active()
     return PathTrajectory(self.cspace, smooth_path(self.path(), extend_fn(self.cspace.body),
                                                    collision_fn(get_env(), self.cspace.body)))