67
continue
scan_list
= [
str
(
i
)
for
i
in
scan_list
]
scan_list
=
""
.
join
(
scan_list
)
paths
=
scan_list
.
split
(
"2"
)
length_list
= []
for
path
in
paths
:
length_list
.
append
(
len
(
path
))
if
max
(
length_list
) ==
0
:
fc
.
stop
()
else
:
i
=
length_list
.
index
(
max
(
length_list
))
pos
=
scan_list
.
index
(
paths
[
i
])
pos
+= (
len
(
paths
[
i
]) -
1
) /
2
delta
=
len
(
scan_list
) /
3
if
pos
<
delta
:
fc
.
turn_left
(
speed
)
elif
pos
>
2
*
delta
:
fc
.
turn_right
(
speed
)
else
:
if
scan_list
[
int
(
len
(
scan_list
)/
2
-
1
)] ==
"0"
:
fc
.
backward
(
speed
)
else
:
fc
.
forward
(
speed
)
if
__name__
==
"__main__"
:
try
:
main
()
finally
:
fc
.
stop
()
Содержание PiCar-4WD
Страница 6: ...1 Component List Structural Plates ...
Страница 7: ...2 Mechanical Parts ...
Страница 8: ...3 Electronic Parts ...
Страница 9: ...4 Other Parts ...
Страница 10: ...5 ...
Страница 20: ...15 Step 9 Set country region language and time zone and then click next again ...
Страница 21: ...16 Step 10 Input the new password of Raspberry Pi and click Next ...
Страница 22: ...17 Step 11 Connect the Raspberry Pi to WIFI and click Next ...
Страница 23: ...18 Step 12 Retrieve update ...
Страница 47: ...42 Assembling Nylon Standoffs M2 5 6 Screw M2 5 8 6mm Nylon Standoff ...
Страница 48: ...43 Assembling Top Plate and Bottom Plate M3 8 Screw M3 30mm Nylon Standoff M3 8 Screw ...
Страница 49: ...44 Assembling Spoiler Spoiler ...
Страница 50: ...45 Assembling Control Board 4WD Hat M2 5 11mm Nylon Standoff M2 5 6 Screw Raspberry Pi ...
Страница 53: ...48 Assembling Ultrasonic Sensor Module M1 4 8 Screw M1 4 Nut Ultrasonic Module ...
Страница 54: ...49 Assembling Wheels finished ...
Страница 56: ...51 Interface Introduction ...
Страница 63: ...58 ...
Страница 67: ...62 Python Example Code Analysis Program Structure Framework ...