Spaces:
Running
Running
- modules/toXML.py +0 -19
modules/toXML.py
CHANGED
@@ -665,25 +665,6 @@ def add_curve(waypoints, pos_source, pos_target, threshold=30):
|
|
665 |
return curved_waypoints
|
666 |
|
667 |
|
668 |
-
def check_for_obstacles(waypoints, data, margin=10):
|
669 |
-
"""
|
670 |
-
Check if the curved path intersects with any existing elements.
|
671 |
-
"""
|
672 |
-
object_boxes = []
|
673 |
-
for idx, element in enumerate(data['boxes']):
|
674 |
-
if idx >= len(data['labels']):
|
675 |
-
continue
|
676 |
-
if data['labels'][idx] <= 12 and data['labels'][idx] != 7 and data['labels'][idx] != 6:
|
677 |
-
object_boxes.append(element)
|
678 |
-
|
679 |
-
for box in object_boxes:
|
680 |
-
x1, y1, x2, y2 = box
|
681 |
-
for point in waypoints:
|
682 |
-
x, y = point
|
683 |
-
if (x1 - margin < x < x2 + margin) and (y1 - margin < y < y2 + margin):
|
684 |
-
return True
|
685 |
-
return False
|
686 |
-
|
687 |
def calculate_waypoints(data, size, current_idx, source_id, target_id):
|
688 |
best_points = data['best_points'][current_idx]
|
689 |
pos_source = best_points[0]
|
|
|
665 |
return curved_waypoints
|
666 |
|
667 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
668 |
def calculate_waypoints(data, size, current_idx, source_id, target_id):
|
669 |
best_points = data['best_points'][current_idx]
|
670 |
pos_source = best_points[0]
|