Skip to content

Commit fd47077

Browse files
committed
Removing unneeded util function to set timing tags in favor of directly calling SetTrajectoryTags
1 parent 546e231 commit fd47077

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

src/prpy/base/robot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from ..planning.ompl import OMPLSimplifier
3838
from ..planning.retimer import HauserParabolicSmoother, OpenRAVEAffineRetimer, ParabolicRetimer
3939
from ..planning.mac_smoother import MacSmoother
40-
from ..util import CopyTrajectory, GetTrajectoryTags, SetTrajectoryTags, TagTrajectoryTiming
40+
from ..util import SetTrajectoryTags
4141

4242
logger = logging.getLogger('robot')
4343

@@ -378,7 +378,7 @@ def do_execute():
378378

379379
with Timer() as timer:
380380
traj = self.PostProcessPath(path, defer=False, **kwargs)
381-
TagTrajectoryTiming(traj, Tags.POSTPROCESS_TIME, timer.get_duration())
381+
SetTrajectoryTags(traj, {Tags.POSTPROCESS_TIME: timer.get_duration()}, append=True)
382382

383383
logger.info('Post-processing took %.3f seconds and produced a path'
384384
' with %d waypoints and a duration of %.3f seconds.',
@@ -389,7 +389,7 @@ def do_execute():
389389

390390
with Timer() as timer:
391391
exec_traj = self.ExecuteTrajectory(traj, defer=False, **kwargs)
392-
TagTrajectoryTiming(exec_traj, Tags.EXECUTION_TIME, timer.get_duration())
392+
SetTrajectoryTags(exec_traj, {Tags.EXECUTION_TIME: timer.get_duration()}, append=True)
393393
return exec_traj
394394

395395
if defer is True:
@@ -549,7 +549,7 @@ def _PlanWrapper(self, planning_method, args, kw_args):
549549
from ..util import Timer
550550
with Timer() as timer:
551551
result = planning_method(self, *args, **kw_args)
552-
TagTrajectoryTiming(result, Tags.PLAN_TIME, timer.get_duration())
552+
SetTrajectoryTags(result, {Tags.PLAN_TIME: timer.get_duration()}, append=True)
553553

554554
def postprocess_trajectory(traj):
555555
# Strip inactive DOFs from the trajectory.

src/prpy/util.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -693,14 +693,3 @@ def FindCatkinResource(package, relative_path):
693693
else:
694694
raise IOError('Loading resource "{:s}" failed.'.format(
695695
relative_path))
696-
697-
def TagTrajectoryTiming(traj, tag, timedata):
698-
"""
699-
Tag a trajectory with timing metadata
700-
@param traj The trajectory to tag
701-
@param tag The name of the tag to add
702-
@param timedata The timing data to put in the tag (usually time in seconds)
703-
"""
704-
tags = GetTrajectoryTags(traj)
705-
tags.setdefault(tag, timedata)
706-
SetTrajectoryTags(traj, tags, append=False)

0 commit comments

Comments
 (0)