Skip to content

Commit 485808e

Browse files
committed
Various fixes/enhancements: 1. Base planners no longer add non-PlanningMethod functions as attributes to robot, 2. Removed double call to SimplifyTrajectory in retimer.py, 3. Changed default smoother to HauserParabolicSmoother, 4. Changed default simplifier to None
1 parent 56d5ebf commit 485808e

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/prpy/base/robot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from ..tsr.tsrlibrary import TSRLibrary
3636
from ..planning.base import Sequence
3737
from ..planning.ompl import OMPLSimplifier
38-
from ..planning.retimer import ParabolicRetimer, ParabolicSmoother
38+
from ..planning.retimer import HauserParabolicSmoother, ParabolicRetimer
3939
from ..planning.mac_smoother import MacSmoother
4040

4141
logger = logging.getLogger('robot')
@@ -67,10 +67,10 @@ def __init__(self, robot_name=None):
6767
# Path post-processing for execution. This includes simplification of
6868
# the geometric path, retiming a path into a trajectory, and smoothing
6969
# (joint simplificaiton and retiming).
70-
self.simplifier = OMPLSimplifier()
70+
self.simplifier = None
7171
self.retimer = ParabolicRetimer()
7272
self.smoother = Sequence(
73-
ParabolicSmoother(),
73+
HauserParabolicSmoother(),
7474
self.retimer
7575
)
7676

src/prpy/planning/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def meta_wrapper(*args, **kw_args):
183183
meta_wrapper.__name__ = method_name
184184
docstrings = list()
185185
for planner in self.get_planners_recursive(method_name):
186-
if hasattr(planner, method_name):
186+
if planner.has_planning_method(method_name):
187187
planner_method = getattr(planner, method_name)
188188
docstrings.append((planner, planner_method))
189189

@@ -225,7 +225,7 @@ def __str__(self):
225225

226226
def get_planners(self, method_name):
227227
return [planner for planner in self._planners
228-
if hasattr(planner, method_name)]
228+
if planner.has_planning_method(method_name)]
229229

230230
def plan(self, method, args, kw_args):
231231
from ..util import Timer
@@ -234,7 +234,7 @@ def plan(self, method, args, kw_args):
234234

235235
for planner in self._planners:
236236
try:
237-
if hasattr(planner, method):
237+
if planner.has_planning_method(method):
238238
logger.info('Sequence - Calling planner "%s".', str(planner))
239239
planner_method = getattr(planner, method)
240240
kw_args['defer'] = False
@@ -268,7 +268,7 @@ def __str__(self):
268268

269269
def get_planners(self, method_name):
270270
return [planner for planner in self._planners
271-
if hasattr(planner, method_name)]
271+
if planner.has_planning_method(method_name)]
272272

273273
def plan(self, method, args, kw_args):
274274
all_planners = self._planners
@@ -277,7 +277,7 @@ def plan(self, method, args, kw_args):
277277

278278
# Find only planners that support the required planning method.
279279
for index, planner in enumerate(all_planners):
280-
if not hasattr(planner, method):
280+
if not planner.has_planning_method(method):
281281
results[index] = PlanningError(
282282
"{:s} does not implement method {:s}."
283283
.format(planner, method)
@@ -337,7 +337,7 @@ def __str__(self):
337337

338338
def get_planners(self, method_name):
339339
return [planner for planner in self._planners
340-
if hasattr(planner, method_name)]
340+
if planner.has_planning_method(method_name)]
341341

342342
def plan(self, method, args, kw_args):
343343
for planner in self._planners:

src/prpy/planning/retimer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,15 @@ def RetimeTrajectory(self, robot, path, options=None, **kw_args):
101101
robot.SetActiveDOFs(dof_indices)
102102

103103
# Compute the timing. This happens in-place.
104-
output_traj = SimplifyTrajectory(input_path, robot)
105104
self.planner.InitPlan(None, params_str)
106105

107106

108107
with CollisionOptionsStateSaver(self.env.GetCollisionChecker(),
109108
CollisionOptions.ActiveDOFs):
109+
logging.info('Retiming with %s' % self.algorithm)
110+
logging.info('Retiming trajectory with %d waypoints' % output_traj.GetNumWaypoints())
110111
status = self.planner.PlanPath(output_traj, releasegil=True)
111-
112+
112113
if status not in [ PlannerStatus.HasSolution,
113114
PlannerStatus.InterruptedWithSolution ]:
114115
raise PlanningError(

0 commit comments

Comments
 (0)