Skip to content

Commit 40f7894

Browse files
committed
Merge pull request #110 from personalrobotics/bugfix/NumPyIsClose
Removed references to numpy.isclose.
2 parents 200e9ec + 76a92db commit 40f7894

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
@@ -599,11 +599,12 @@ def ComputeJointVelocityFromTwist(robot, twist,
599599
jacobian_active = jacobian[rows, :]
600600

601601
bounds = [(-x, x) for x in robot.GetActiveDOFMaxVel()]
602+
602603
# Check for joint limits
603604
q_curr = robot.GetActiveDOFValues()
604605
q_min, q_max = robot.GetActiveDOFLimits()
605-
dq_bounds = [(0, max) if (numpy.isclose(q_curr[i], q_min[i], atol=joint_limit_tolerance)) else
606-
(min, 0) if (numpy.isclose(q_curr[i], q_max[i], atol=joint_limit_tolerance)) else
606+
dq_bounds = [(0, max) if q_curr[i] <= q_min[i] + joint_limit_tolerance else
607+
(min, 0) if q_curr[i] >= q_max[i] + joint_limit_tolerance else
607608
(min, max) for i, (min, max) in enumerate(bounds)]
608609

609610
if dq_init is None:

0 commit comments

Comments
 (0)