@@ -437,10 +437,8 @@ def FollowVectorField(self, robot, fn_vectorfield, fn_terminate,
437
437
from .exceptions import (
438
438
CollisionPlanningError ,
439
439
SelfCollisionPlanningError ,
440
- TimeoutPlanningError
441
440
)
442
441
from openravepy import CollisionReport , RaveCreateTrajectory
443
- from ..util import ComputeJointVelocityFromTwist , GetCollisionCheckPts , ComputeUnitTiming
444
442
import time
445
443
import scipy .integrate
446
444
@@ -456,9 +454,6 @@ def FollowVectorField(self, robot, fn_vectorfield, fn_terminate,
456
454
env = robot .GetEnv ()
457
455
active_indices = robot .GetActiveDOFIndices ()
458
456
459
- # Get the robot's joint velocity limits
460
- qdot_limit = robot .GetDOFVelocityLimits (active_indices )
461
-
462
457
# Create a new trajectory matching the current
463
458
# robot's joint configuration specification
464
459
cspec = robot .GetActiveConfigurationSpecification ('linear' )
@@ -477,7 +472,6 @@ def fn_wrapper(t, q):
477
472
"""
478
473
# Set the joint values, without checking the joint limits
479
474
robot .SetActiveDOFValues (q , CheckLimitsAction .Nothing )
480
-
481
475
return fn_vectorfield ()
482
476
483
477
def fn_status_callback (t , q ):
@@ -490,13 +484,12 @@ def fn_status_callback(t, q):
490
484
called after each integration time step, which means we are
491
485
doing more checks than required.
492
486
"""
493
- if time .time () - time_start >= timelimit :
494
- raise TimeLimitError ()
487
+ # if time.time() - time_start >= timelimit:
488
+ # raise TimeLimitError()
495
489
496
490
# Check joint position limits.
497
491
# We do this before setting the joint angles.
498
492
util .CheckJointLimits (robot , q )
499
-
500
493
robot .SetActiveDOFValues (q )
501
494
502
495
# Check collision.
@@ -528,25 +521,25 @@ def fn_callback(t, q):
528
521
529
522
# Run constraint checks at DOF resolution.
530
523
if path .GetNumWaypoints () == 1 :
524
+ t_start = 0.
531
525
checks = [(t , q )]
532
526
else :
533
- # TODO: This should start at t_check. Unfortunately, a bug
534
- # in GetCollisionCheckPts causes this to enter an infinite
535
- # loop.
536
- checks = GetCollisionCheckPts (robot , path ,
537
- include_start = False ) #start_time=nonlocals['t_check'])
527
+ t_start = nonlocals ['t_check' ]
528
+ check_traj = util .GetTrajectoryTail (path , t_start )
529
+ checks = util .GetCollisionCheckPts (robot , check_traj ,
530
+ include_start = False )
538
531
539
532
for t_check , q_check in checks :
540
- fn_status_callback (t_check , q_check )
533
+ fn_status_callback (t_check + t_start , q_check )
541
534
542
535
# Record the time of this check so we continue checking at
543
536
# DOF resolution the next time the integrator takes a step.
544
537
nonlocals ['t_check' ] = t_check
545
538
546
- return 0 # Keep going.
539
+ return 0 # Keep going.
547
540
except PlanningError as e :
548
541
nonlocals ['exception' ] = e
549
- return - 1 # Stop.
542
+ return - 1 # Stop.
550
543
551
544
# Integrate the vector field to get a configuration space path.
552
545
#
@@ -567,7 +560,7 @@ def fn_callback(t, q):
567
560
integrator .integrate (t = integration_time_interval )
568
561
569
562
t_cache = nonlocals ['t_cache' ]
570
- exception = nonlocals ['exception' ]
563
+ exception = nonlocals ['exception' ]
571
564
572
565
if t_cache is None :
573
566
raise exception or PlanningError ('An unknown error has occurred.' )
0 commit comments