Skip to content

Commit dcfaec8

Browse files
committed
Expand sampling region
1 parent 25ea050 commit dcfaec8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def computepath(qinit,
9393

9494
def plane_sampler():
9595
while True:
96-
s = np.random.uniform(0.0, 1.0)
96+
s = np.random.uniform(-1.0, 2.0)
9797
t = np.random.uniform(-half_width, half_width)
9898
xy = (1.0 - s) * p0_xy + s * p1_xy + perp * t
9999
z = np.random.uniform(zmin, zmax)

rrt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from pinocchio.utils import rotate
1414

1515
from constants import EDGE_DISTANCE_TOL, DEFAULT_DISCRETISATION_STEPS, DEFAULT_CHECK_EDGE_STEPS
16-
from tools import setcubeplacement
16+
from tools import setcubeplacement, distanceToObstacle
1717
from constants import DEFAULT_VIZ_DELAY
1818
import time
1919
import sampling
@@ -192,7 +192,7 @@ def get_q_new(self,
192192
# update seed for the next interpolation step if IK succeeded
193193
if found and grasping_q is not None:
194194
seed_grasping_q = grasping_q
195-
if not found:
195+
if not found or distanceToObstacle(self.robot, grasping_q) < 0.001:
196196
# cannot progress past the previous valid step
197197
if i - 1 == 0:
198198
q_new_found = False

0 commit comments

Comments
 (0)