Skip to content

Commit 39a4842

Browse files
committed
change Planner class to PlannerBase
1 parent 4e6c880 commit 39a4842

File tree

11 files changed

+226
-127
lines changed

11 files changed

+226
-127
lines changed

roboticstoolbox/mobile/Bug2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
from matplotlib import cm
1414
import matplotlib.pyplot as plt
1515
from matplotlib import animation
16-
from roboticstoolbox.mobile.Planner import Planner
16+
from roboticstoolbox.mobile.PlannerBase import PlannerBase
1717

18-
class Bug2(Planner):
18+
class Bug2(PlannerBase):
1919
"""
2020
Construct a Bug2 reactive navigator
2121

roboticstoolbox/mobile/CurvaturePolyPlanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy as np
66
import matplotlib.pyplot as plt
77
from collections import namedtuple
8-
from roboticstoolbox.mobile.Planner import Planner
8+
from roboticstoolbox.mobile.PlannerBase import PlannerBase
99

1010

1111
def solvepath(poly, s_f, x0=[0, 0, 0], **kwargs):
@@ -44,7 +44,7 @@ def costfunc(unknowns, start, goal, curvature):
4444
e += 0.1 * (maxcurvature - curvature)
4545
# print(e, path[:, -1], np.r_[goal])
4646
return e
47-
class CurvaturePolyPlanner(Planner):
47+
class CurvaturePolyPlanner(PlannerBase):
4848

4949
r"""
5050
Curvature polynomial planner

roboticstoolbox/mobile/DistanceTransformPlanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
from scipy.ndimage import *
1616
import matplotlib.pyplot as plt
1717
from matplotlib import cm
18-
from roboticstoolbox.mobile.Planner import Planner
18+
from roboticstoolbox.mobile.PlannerBase import PlannerBase
1919

2020

21-
class DistanceTransformPlanner(Planner):
21+
class DistanceTransformPlanner(PlannerBase):
2222
r"""
2323
Distance transform path planner
2424

roboticstoolbox/mobile/DstarPlanner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
import matplotlib.pyplot as plt
1616
import numpy as np
1717
import matplotlib.cm as cm
18-
from roboticstoolbox.mobile.Planner import Planner
18+
from roboticstoolbox.mobile.PlannerBase import PlannerBase
1919
from roboticstoolbox.mobile.OccGrid import OccupancyGrid
2020
import heapq
21+
import bisect
2122
import math
2223

2324
show_animation = True
@@ -287,7 +288,7 @@ def modify_cost(self, x, newcost):
287288
# print(f"({par.x},{par.y}) ", end='')
288289
# print()
289290
# print()
290-
class DstarPlanner(Planner):
291+
class DstarPlanner(PlannerBase):
291292
r"""
292293
D* path planner
293294

roboticstoolbox/mobile/DubinsPlanner.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"""
2222
import math
2323
from collections import namedtuple
24-
from roboticstoolbox.mobile.Planner import Planner
24+
from roboticstoolbox.mobile import PlannerBase
2525

2626
import matplotlib.pyplot as plt
2727
import numpy as np
@@ -87,7 +87,6 @@ def left_straight_right(alpha, beta, d):
8787

8888
return t, p, q, mode
8989

90-
9190
def right_straight_left(alpha, beta, d):
9291
sa = math.sin(alpha)
9392
sb = math.sin(beta)
@@ -305,7 +304,7 @@ def path_planning(start, goal, curvature, step_size=0.1):
305304
return path, length, mode, lengths
306305

307306
# ============================================================================
308-
class DubinsPlanner(Planner):
307+
class DubinsPlanner(PlannerBase):
309308
r"""
310309
Dubins path planner
311310

roboticstoolbox/mobile/LatticePlanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from spatialmath import SE2
44
import matplotlib.pyplot as plt
55
import itertools
6-
from roboticstoolbox.mobile.Planner import Planner
76
from roboticstoolbox.mobile.OccGrid import OccupancyGrid
7+
from roboticstoolbox.mobile.PlannerBase import PlannerBase
88
from collections import namedtuple
99

1010
def make_arc(dir, radius=1, npoints=20):
@@ -57,7 +57,7 @@ def plot(self, **kwargs):
5757
plt.plot(xy[0, :], xy[1, :], **kwargs)
5858

5959

60-
class LatticePlanner(Planner):
60+
class LatticePlanner(PlannerBase):
6161
"""
6262
Lattice planner
6363

roboticstoolbox/mobile/PRMPlanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
from spatialmath.base import animate
1616
from scipy.ndimage import *
1717
from matplotlib import cm, pyplot as plt
18-
from roboticstoolbox.mobile.Planner import Planner
18+
from roboticstoolbox.mobile.PlannerBase import PlannerBase
1919
from pgraph import UGraph
2020

2121

22-
class PRMPlanner(Planner):
22+
class PRMPlanner(PlannerBase):
2323
r"""
2424
Distance transform path planner
2525

0 commit comments

Comments
 (0)