Skip to content

Commit aad50ac

Browse files
committed
Reverted unnecessary lint fix.
1 parent 79b9350 commit aad50ac

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

src/prpy/planning/vectorfield.py

+11-18
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,8 @@ def FollowVectorField(self, robot, fn_vectorfield, fn_terminate,
437437
from .exceptions import (
438438
CollisionPlanningError,
439439
SelfCollisionPlanningError,
440-
TimeoutPlanningError
441440
)
442441
from openravepy import CollisionReport, RaveCreateTrajectory
443-
from ..util import ComputeJointVelocityFromTwist, GetCollisionCheckPts, ComputeUnitTiming
444442
import time
445443
import scipy.integrate
446444

@@ -456,9 +454,6 @@ def FollowVectorField(self, robot, fn_vectorfield, fn_terminate,
456454
env = robot.GetEnv()
457455
active_indices = robot.GetActiveDOFIndices()
458456

459-
# Get the robot's joint velocity limits
460-
qdot_limit = robot.GetDOFVelocityLimits(active_indices)
461-
462457
# Create a new trajectory matching the current
463458
# robot's joint configuration specification
464459
cspec = robot.GetActiveConfigurationSpecification('linear')
@@ -477,7 +472,6 @@ def fn_wrapper(t, q):
477472
"""
478473
# Set the joint values, without checking the joint limits
479474
robot.SetActiveDOFValues(q, CheckLimitsAction.Nothing)
480-
481475
return fn_vectorfield()
482476

483477
def fn_status_callback(t, q):
@@ -490,13 +484,12 @@ def fn_status_callback(t, q):
490484
called after each integration time step, which means we are
491485
doing more checks than required.
492486
"""
493-
if time.time() - time_start >= timelimit:
494-
raise TimeLimitError()
487+
#if time.time() - time_start >= timelimit:
488+
# raise TimeLimitError()
495489

496490
# Check joint position limits.
497491
# We do this before setting the joint angles.
498492
util.CheckJointLimits(robot, q)
499-
500493
robot.SetActiveDOFValues(q)
501494

502495
# Check collision.
@@ -528,25 +521,25 @@ def fn_callback(t, q):
528521

529522
# Run constraint checks at DOF resolution.
530523
if path.GetNumWaypoints() == 1:
524+
t_start = 0.
531525
checks = [(t, q)]
532526
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)
538531

539532
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)
541534

542535
# Record the time of this check so we continue checking at
543536
# DOF resolution the next time the integrator takes a step.
544537
nonlocals['t_check'] = t_check
545538

546-
return 0 # Keep going.
539+
return 0 # Keep going.
547540
except PlanningError as e:
548541
nonlocals['exception'] = e
549-
return -1 # Stop.
542+
return -1 # Stop.
550543

551544
# Integrate the vector field to get a configuration space path.
552545
#
@@ -567,7 +560,7 @@ def fn_callback(t, q):
567560
integrator.integrate(t=integration_time_interval)
568561

569562
t_cache = nonlocals['t_cache']
570-
exception = nonlocals['exception']
563+
exception = nonlocals['exception']
571564

572565
if t_cache is None:
573566
raise exception or PlanningError('An unknown error has occurred.')

src/prpy/util.py

+1
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,7 @@ def GetLinearCollisionCheckPts(robot, traj, norm_order=2, sampling_func=None):
17701770
waypoint = traj.GetWaypoint(i)
17711771
q1 = traj_cspec.ExtractJointValues(waypoint, robot, dof_indices)
17721772
dq = numpy.abs(q1 - q0)
1773+
max_diff_float = numpy.max( numpy.abs(q1 - q0) / q_resolutions)
17731774

17741775
# Get the number of steps (as a float) required for
17751776
# each joint at DOF resolution

0 commit comments

Comments
 (0)