Skip to content

Commit 76a92db

Browse files
author
Michael Koval
committed
Removed references to numpy.isclose (#63).
1 parent 0873c50 commit 76a92db

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/prpy/planning/workspace.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ def PlanWorkspacePath(self, robot, traj, timelimit=5.0,
171171
ik_options = openravepy.IkFilterOptions.CheckEnvCollisions
172172

173173
start_time = time.time()
174+
epsilon = 1e-6
175+
174176
try:
175-
while not numpy.isclose(t, traj.GetDuration()):
177+
while t < traj.GetDuration() + epsilon:
176178
# Check for a timeout.
177179
current_time = time.time()
178180
if (timelimit is not None and

src/prpy/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,11 +547,12 @@ def ComputeJointVelocityFromTwist(robot, twist,
547547
jacobian_active = jacobian[rows, :]
548548

549549
bounds = [(-x, x) for x in robot.GetActiveDOFMaxVel()]
550+
550551
# Check for joint limits
551552
q_curr = robot.GetActiveDOFValues()
552553
q_min, q_max = robot.GetActiveDOFLimits()
553-
dq_bounds = [(0, max) if (numpy.isclose(q_curr[i], q_min[i], atol=joint_limit_tolerance)) else
554-
(min, 0) if (numpy.isclose(q_curr[i], q_max[i], atol=joint_limit_tolerance)) else
554+
dq_bounds = [(0, max) if q_curr[i] <= q_min[i] + joint_limit_tolerance else
555+
(min, 0) if q_curr[i] >= q_max[i] + joint_limit_tolerance else
555556
(min, max) for i, (min, max) in enumerate(bounds)]
556557

557558
if dq_init is None:

0 commit comments

Comments
 (0)