Skip to content

Commit 150f28e

Browse files
committed
Merge pull request #277 from personalrobotics/bugfix/hauser_timelimit
Fixed HauserParabolicSmoother overriding timelimit
2 parents 62cec7a + fbd5b42 commit 150f28e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/prpy/planning/retimer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import logging
3232
import openravepy
33+
from copy import deepcopy
3334
from ..util import (CreatePlannerParametersString, CopyTrajectory,
3435
SimplifyTrajectory, HasAffineDOFs, IsTimedTrajectory)
3536
from base import (BasePlanner, PlanningError, PlanningMethod,
@@ -156,11 +157,9 @@ def __init__(self, do_blend=True, do_shortcut=True, blend_radius=0.5,
156157

157158
@PlanningMethod
158159
def RetimeTrajectory(self, robot, path, options=None, **kw_args):
159-
from copy import deepcopy
160-
if options is None:
161-
options = {}
162-
new_options = deepcopy(options)
163-
new_options['time_limit'] = kw_args.get('timelimit', 3.)
160+
new_options = deepcopy(options) if options else dict()
161+
if 'timelimit' in kw_args:
162+
new_options['time_limit'] = kw_args['timelimit']
164163
return super(HauserParabolicSmoother, self).RetimeTrajectory(
165164
robot, path, options=new_options, **kw_args)
166165

0 commit comments

Comments
 (0)