Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 43e71290 authored by AUTERNAUD Alex's avatar AUTERNAUD Alex
Browse files

if can not find a path issue

parent af77249d
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,9 @@ class PathPlanner(): ...@@ -69,6 +69,9 @@ class PathPlanner():
dx=dx, dx=dx,
coords=(x, y), coords=(x, y),
max_distance=self.max_d) max_distance=self.max_d)
if len(xl) == 0 or len(yl) == 0 or len(vxl) == 0 or len(vyl) == 0:
return []
d_angle = np.arctan2(vxl[0], -vyl[0]) - pos[2] d_angle = np.arctan2(vxl[0], -vyl[0]) - pos[2]
if dl[0] < self.max_d_orientation: # if within range, set waypoint = target if dl[0] < self.max_d_orientation: # if within range, set waypoint = target
wpt_pos = [self.target[0], self.target[1], self.target[2]] wpt_pos = [self.target[0], self.target[1], self.target[2]]
...@@ -142,9 +145,10 @@ class PathPlanner(): ...@@ -142,9 +145,10 @@ class PathPlanner():
continue continue
wpt = self.get_next_waypoint(robot_pose) wpt = self.get_next_waypoint(robot_pose)
with lock: if wpt:
shared_waypoint[0] = True with lock:
shared_waypoint[1] = float(wpt[0]) shared_waypoint[0] = True
shared_waypoint[2] = float(wpt[1]) shared_waypoint[1] = float(wpt[0])
shared_waypoint[3] = float(wpt[2]) shared_waypoint[2] = float(wpt[1])
shared_waypoint[3] = float(wpt[2])
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment