Problem With python drive

I’m knew to Donkeycar and need a little help. I’ve calibrated the throttle and motors, using a Sunfounder PiCar chassis and the recommended camera - Wide Angle Raspberry Pi Camera. Running python drive, this message appears shutting down the code “ZeroDivisionError: division by zero”. Any suggestions?

Also, is this the correct format for the web browser - raspberrypi.local:8887? I haven’t changed the host name.


(env) pi@raspberrypi:~ cd mycar (env) pi@raspberrypi:~/mycar python drive
using donkey v3.1.2 …
loading config file: /home/pi/mycar/
loading personal config over-rides from

config loaded
PiCamera loaded… .warming camera
Adding part PiCamera.
Starting Donkey Server… you can now go to raspberrypi.local:8887 to drive your car.
Adding part LocalWebController.
Adding part ThrottleFilter.
Adding part PilotCondition.
Adding part RecordTracker.
Adding part ImgPreProcess.
Adding part DriveMode.
Adding part AiLaunch.
Adding part AiRunCondition.
PWM Steering created
Init ESC
PWM Throttle created
Adding part PWMSteering.
Adding part PWMThrottle.
Tub does NOT exist. Creating new tub…
New tub created at: /home/pi/mycar/data/tub_5_20-07-13
Adding part TubWriter.
You can now go to :8887 to drive your car.
Starting vehicle at 20 Hz
/usr/lib/python3/dist-packages/picamera/ PiCameraResolutionRounded: frame size rounded up from 160x120 to 160x128
width, height, fwidth, fheight)))
Traceback (most recent call last):
File “/home/pi/projects/donkeycar/donkeycar/”, line 151, in start
File “/home/pi/projects/donkeycar/donkeycar/”, line 197, in update_parts
outputs = p.run_threaded(*inputs)
File “/home/pi/projects/donkeycar/donkeycar/parts/”, line 251, in run_threaded
self.min_pulse, self.zero_pulse)
File “/home/pi/projects/donkeycar/donkeycar/”, line 249, in map_range
XY_ratio = X_range/Y_range
ZeroDivisionError: division by zero
Shutting down vehicle and its parts…
Stopping PiCamera
division by zero
Part Profile Summary: (times in ms)
| part | max | min | avg | 50% | 90% | 99% | 99.9% |

BTW, camera is selected in system configuration. Also I verified the camera would take a 10 second video.


I’ve been beating my head against a wall all day and can’t solve this problem. Help please!

did you solve this problem?

That hardware platform is non-standard and requires a number of non-default configuration changes to get working including a different motor driver configuration. But you said you got it calibrated for steering and throttle so I’m guessing you figured all that out.

Are you using a rPi and what camera did you setup? My experience has been with rPi3+ and the standard v1 type of wide angle camera and it all just works with the defaults.