@@ -40,7 +40,7 @@ class DistanceTransformPlanner(PlannerBase):
40
40
41
41
The map is described by a 2D occupancy ``occgrid`` whose elements are zero
42
42
if traversable of nonzero if untraversable, ie. an obstacle.
43
-
43
+
44
44
The cells are assumed to be unit squares. Crossing the cell horizontally or
45
45
vertically is a travel distance of 1, and for the Euclidean distance
46
46
measure, the crossing the cell diagonally is a distance of :math:`\sqrt{2}`.
@@ -106,7 +106,7 @@ def __str__(self):
106
106
107
107
return s
108
108
109
- def plan (self , goal = None , animate = False , verbose = False ):
109
+ def plan (self , goal = None , animate = False , summary = False ):
110
110
r"""
111
111
Plan path using distance transform
112
112
@@ -135,7 +135,8 @@ def plan(self, goal=None, animate=False, verbose=False):
135
135
self .occgrid .grid ,
136
136
goal = self ._goal ,
137
137
metric = self ._metric ,
138
- animate = animate
138
+ animate = animate ,
139
+ summary = summary ,
139
140
)
140
141
141
142
def next (self , position ):
@@ -147,7 +148,7 @@ def next(self, position):
147
148
:raises RuntimeError: no plan has been computed
148
149
:return: next robot position
149
150
:rtype: ndarray(2)
150
-
151
+
151
152
Return the robot position that is one step closer to the goal. Called
152
153
by :meth:`query` to find a path from start to goal.
153
154
@@ -215,7 +216,7 @@ def plot_3d(self, path=None, ls=None):
215
216
line/surface handling.
216
217
"""
217
218
fig = plt .figure ()
218
- ax = fig .gca ( projection = "3d" )
219
+ ax = fig .add_subplot ( 111 , projection = "3d" )
219
220
220
221
distance = self ._distancemap
221
222
X , Y = np .meshgrid (np .arange (distance .shape [1 ]), np .arange (distance .shape [0 ]))
@@ -273,7 +274,7 @@ def distancexform(occgrid, goal, metric="cityblock", animate=False, summary=Fals
273
274
# - other cells are inf
274
275
# - goal is zero
275
276
276
- goal = base .getvector (goal , 2 , dtype = np . int )
277
+ goal = base .getvector (goal , 2 , dtype = int )
277
278
278
279
distance = occgrid .astype (np .float32 )
279
280
distance [occgrid > 0 ] = np .nan # assign nan to obstacle cells
0 commit comments