33
33
from .. import bind , named_config , planning , util
34
34
from ..clone import Clone , Cloned
35
35
from ..tsr .tsrlibrary import TSRLibrary
36
- from ..planning .base import Sequence
36
+ from ..planning .base import Sequence , Tags
37
37
from ..planning .ompl import OMPLSimplifier
38
38
from ..planning .retimer import HauserParabolicSmoother , OpenRAVEAffineRetimer , ParabolicRetimer
39
39
from ..planning .mac_smoother import MacSmoother
40
+ from ..util import SetTrajectoryTags
40
41
41
42
logger = logging .getLogger ('robot' )
42
43
@@ -377,6 +378,7 @@ def do_execute():
377
378
378
379
with Timer () as timer :
379
380
traj = self .PostProcessPath (path , defer = False , ** kwargs )
381
+ SetTrajectoryTags (traj , {Tags .POSTPROCESS_TIME : timer .get_duration ()}, append = True )
380
382
381
383
logger .info ('Post-processing took %.3f seconds and produced a path'
382
384
' with %d waypoints and a duration of %.3f seconds.' ,
@@ -385,7 +387,10 @@ def do_execute():
385
387
traj .GetDuration ()
386
388
)
387
389
388
- return self .ExecuteTrajectory (traj , defer = False , ** kwargs )
390
+ with Timer () as timer :
391
+ exec_traj = self .ExecuteTrajectory (traj , defer = False , ** kwargs )
392
+ SetTrajectoryTags (exec_traj , {Tags .EXECUTION_TIME : timer .get_duration ()}, append = True )
393
+ return exec_traj
389
394
390
395
if defer is True :
391
396
from trollius .executor import get_default_executor
@@ -541,7 +546,10 @@ def _PlanWrapper(self, planning_method, args, kw_args):
541
546
config_spec = self .GetActiveConfigurationSpecification ('linear' )
542
547
543
548
# Call the planner.
544
- result = planning_method (self , * args , ** kw_args )
549
+ from ..util import Timer
550
+ with Timer () as timer :
551
+ result = planning_method (self , * args , ** kw_args )
552
+ SetTrajectoryTags (result , {Tags .PLAN_TIME : timer .get_duration ()}, append = True )
545
553
546
554
def postprocess_trajectory (traj ):
547
555
# Strip inactive DOFs from the trajectory.
0 commit comments