Skip to content

Commit c644cc3

Browse files
optimise fastpathplanner
1 parent 39d9341 commit c644cc3

File tree

6 files changed

+307
-253
lines changed

6 files changed

+307
-253
lines changed

conftest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ def pytest_generate_tests(metafunc):
5959

6060

6161
# temporarily excludes the motion planning tests until the motion planning algorithms are working
62-
def pytest_collection_modifyitems(config, items):
63-
if config.getoption("--include-motion-planning"):
64-
return
62+
# def pytest_collection_modifyitems(config, items):
63+
# if config.getoption("--include-motion-planning"):
64+
# return
6565

66-
skip_mp = pytest.mark.skip(reason="motion planning not ready")
67-
for item in items:
68-
if "motion_planning" in item.keywords:
69-
item.add_marker(skip_mp)
66+
# skip_mp = pytest.mark.skip(reason="motion planning not ready")
67+
# for item in items:
68+
# if "motion_planning" in item.keywords:
69+
# item.add_marker(skip_mp)
7070

7171

7272
@pytest.fixture

utama_core/global_utils/math_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ def segments_intersect(
288288
p2 = np.asarray(seg2_start)
289289
q2 = np.asarray(seg2_end)
290290

291-
o1 = orientation(p1, q1, p2)
292-
o2 = orientation(p1, q1, q2)
293-
o3 = orientation(p2, q2, p1)
294-
o4 = orientation(p2, q2, q1)
291+
o1 = point_orientation(p1, q1, p2)
292+
o2 = point_orientation(p1, q1, q2)
293+
o3 = point_orientation(p2, q2, p1)
294+
o4 = point_orientation(p2, q2, q1)
295295

296296
if o1 != o2 and o3 != o4:
297297
return True
@@ -308,7 +308,7 @@ def segments_intersect(
308308
return False
309309

310310

311-
def orientation(p_1: np.ndarray, p_2: np.ndarray, p_3: np.ndarray) -> int:
311+
def point_orientation(p_1: np.ndarray, p_2: np.ndarray, p_3: np.ndarray) -> int:
312312
"""Calculate the orientation of 3 points (e.g. on a line or in a triangle).
313313
314314
Args:

utama_core/motion_planning/src/fastpathplanning/config.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@
33

44
class fastpathplanningconfig:
55
ROBOT_DIAMETER = 2 * ROBOT_RADIUS
6-
OBSTACLE_CLEARANCE = ROBOT_DIAMETER * 1.1
7-
SUBGOAL_DISTANCE = OBSTACLE_CLEARANCE * 1.1
6+
7+
# how fat is the danger zone around obstacles, in multiples of robot diameter
8+
CLEARANCE_MULTIPLIER = 1.5
9+
OBSTACLE_CLEARANCE = ROBOT_DIAMETER * CLEARANCE_MULTIPLIER
10+
11+
# How far outside the danger zone shold the waypoint be
12+
SUBGOAL_MULTIPLIER = 1.2
13+
SUBGOAL_DISTANCE = OBSTACLE_CLEARANCE * SUBGOAL_MULTIPLIER
14+
815
LOOK_AHEAD_RANGE = 3
916
MAXRECURSION_LENGTH = 3
10-
PROJECTEDFRAMES = 15
11-
PROJECTION_DISTANCE = OBSTACLE_CLEARANCE * 4
17+
PROJECTEDFRAMES = 20
18+
PROJECTION_DISTANCE = 1

0 commit comments

Comments
 (0)