Skip to content

Commit afbadce

Browse files
committed
Modify OptimizeTrajectory in chomp to catch generic exceptions and raise them as PlanningError
1 parent 2234aff commit afbadce

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/prpy/planning/chomp.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,13 @@ def OptimizeTrajectory(self, robot, traj, lambda_=100.0, n_iter=50, **kw_args):
187187
cspec.InsertDeltaTime(waypoint, .1)
188188
traj.Insert(i, waypoint, True)
189189

190-
run = self.module.create(robot=robot, starttraj=traj, lambda_=lambda_)
191-
self.module.iterate(n_iter=n_iter, run=run)
192-
self.module.destroy(run=run)
193-
return traj
190+
try:
191+
run = self.module.create(robot=robot, starttraj=traj, lambda_=lambda_)
192+
self.module.iterate(n_iter=n_iter, run=run)
193+
self.module.destroy(run=run)
194+
return traj
195+
except Exception as e:
196+
raise PlanningError(str(e))
194197

195198
@PlanningMethod
196199
def PlanToConfiguration(self, robot, goal, lambda_=100.0, n_iter=15, **kw_args):

0 commit comments

Comments
 (0)