Can't start drive , says "AttributeError : 'Config' object has no attribute 'DRIVE_TRAIN_TYPE'

New to donkey car, build for the school project, did every step on the doc, when comes to drive it, this shows up says I have no attribute in the manage.py last run part, so any suggestion on modifying the config files to fit different type power train or etc, really appreciate!
after using the template’s config file, still got the same error

@franklik84,

You might want to switch over to the DC Discord website to get a fast answer for your issue. However I can probably help you.
If you look in your “myconfig.py” you will see “DRIVE_TRAIN_TYPE = MOCK”. If your car configuration uses a servo for steering and an ESC for motor control, then DRIVE_TRAIN_TYPE = should be “SERVO_ESC”.
Also, you should make sure “USE_JOYSTICK_AS_DEFAULT = False” is enabled if you want to use the web controller.
I suspect that when you created your car, the create process used the “basic.py” template and not the “complete.py” template.

TCIII

Thanks, man, yep I don’t know how it happens but yes it’s missing these parameters in the config.py
and another problem I’m facing is how to set up an L298N driver to drive the motor as my car is quite a simple one without a servo and ESC controller, any suggestion on the calcu…py setup? By the way is there any other ways I can get help from you like email etc …really appreciate

oh by the way it says the invite is invalid or has expired, could you send me a new one,tks.

@franklik84,

Unfortunately I have no control over requesting membership on the Discord Donkey Car website.

What SBC are you using?

Setting up the L298N is not going to be easy.

Make “DRIVE_TRAIN_TYPE = DC_TWO_WHEEL” in your “myconfig.py”

Here are the GPIO pinouts for the L298N inputs:

#DC_TWO_WHEEL - with two wheels as drive, left and right.
#these GPIO pinouts are only used for the DRIVE_TRAIN_TYPE=DC_TWO_WHEEL
HBRIDGE_PIN_LEFT_FWD = 18
HBRIDGE_PIN_LEFT_BWD = 16
HBRIDGE_PIN_RIGHT_FWD = 15
HBRIDGE_PIN_RIGHT_BWD = 13

Unfortunately you will have no control over the speed, just direction, with this configuration as you will have to pull the PWM input of the L298N high.

TCIII

Sorry about the pain from this glitch. I’ve pushed PRs that will add the missing DRIVE_TRAIN elements from the config files. (We got stuck behind some Travis blockers before; they’re not resolved)

The PWM control of the H-bridge used to work. I built a 2wheel donkey car once and while I didn’t use the large L298N H-bridge but instead the much smaller MX1508, but full throttle and steering were working. This was working in the Donkey 3.x code.