File tree Expand file tree Collapse file tree 2 files changed +15
-16
lines changed
Mapping/lidar_to_grid_map Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ def flood_fill(cpoint, pmap):
126
126
sx , sy = pmap .shape
127
127
fringe = deque ()
128
128
fringe .appendleft (cpoint )
129
- while len ( fringe ) > 0 :
129
+ while fringe :
130
130
n = fringe .pop ()
131
131
nx , ny = n
132
132
# West
Original file line number Diff line number Diff line change 18
18
},
19
19
{
20
20
"cell_type" : " code" ,
21
- "execution_count" : 2 ,
21
+ "execution_count" : 1 ,
22
22
"metadata" : {},
23
23
"outputs" : [],
24
24
"source" : [
37
37
},
38
38
{
39
39
"cell_type" : " code" ,
40
- "execution_count" : 3 ,
40
+ "execution_count" : 2 ,
41
41
"metadata" : {},
42
42
"outputs" : [],
43
43
"source" : [
66
66
},
67
67
{
68
68
"cell_type" : " code" ,
69
- "execution_count" : 4 ,
69
+ "execution_count" : 3 ,
70
70
"metadata" : {},
71
71
"outputs" : [
72
72
{
104
104
},
105
105
{
106
106
"cell_type" : " code" ,
107
- "execution_count" : 35 ,
107
+ "execution_count" : 4 ,
108
108
"metadata" : {},
109
109
"outputs" : [
110
110
{
133
133
},
134
134
{
135
135
"cell_type" : " code" ,
136
- "execution_count" : 36 ,
136
+ "execution_count" : 5 ,
137
137
"metadata" : {},
138
138
"outputs" : [
139
139
{
170
170
},
171
171
{
172
172
"cell_type" : " code" ,
173
- "execution_count" : 37 ,
173
+ "execution_count" : 6 ,
174
174
"metadata" : {},
175
175
"outputs" : [],
176
176
"source" : [
184
184
" sx, sy = pmap.shape\n " ,
185
185
" fringe = deque()\n " ,
186
186
" fringe.appendleft(cpoint)\n " ,
187
- " while len( fringe)>0 :\n " ,
187
+ " while fringe:\n " ,
188
188
" n = fringe.pop()\n " ,
189
189
" nx, ny = n\n " ,
190
190
" # West\n " ,
218
218
},
219
219
{
220
220
"cell_type" : " code" ,
221
- "execution_count" : 38 ,
221
+ "execution_count" : 7 ,
222
222
"metadata" : {},
223
223
"outputs" : [
224
224
{
243
243
]
244
244
},
245
245
{
246
- "cell_type" : " code" ,
247
- "execution_count" : null ,
246
+ "cell_type" : " markdown" ,
248
247
"metadata" : {},
249
- "outputs" : [],
250
- "source" : []
248
+ "source" : [
249
+ " Let's use this flood fill on real data:"
250
+ ]
251
251
},
252
252
{
253
253
"cell_type" : " code" ,
254
- "execution_count" : 39 ,
254
+ "execution_count" : 8 ,
255
255
"metadata" : {},
256
256
"outputs" : [
257
257
{
258
258
"name" : " stdout" ,
259
259
"output_type" : " stream" ,
260
260
"text" : [
261
- " The grid map is 150 x 100 .\n " ,
262
- " 150 100\n "
261
+ " The grid map is 150 x 100 .\n "
263
262
]
264
263
},
265
264
{
You can’t perform that action at this time.
0 commit comments