-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
989 namespace drivetrain configurations #994
Conversation
- There is one configuration for choosing the drivetrain. - However, each drivetrain has it's own lengthy set of configurations. - Some of these are shared among several drivetrains OR to avoid that they are prefixed and so identifiers become very long. - This commit moves each drivetrain's configuration into a python dict, effectively namespacing the configuration. - This allowed me to shorten the names of some configs since a prefix is not needed to disambiguate them. So some config names have changed - The bigger issue for users is that now, if they want to change any drivetrain config, they will need to uncomment the entire dictionary block, not just a single line of configuration. That should be obvious when looking at the code, but it could trick a newbie that does not understand python. I would say that is fine, because they will learn something important from it. - If you look at the resulting config.py you will see that it is much cleaner.
- so I updated the configuration to reflect this - removed the DRIVETRAIN_TYPE configuration, since it is not used - removed the other drivetrain configurations which are not used
This branch still needs have all the updated drivetrains tested. |
donkeycar/templates/cfg_complete.py
Outdated
# and glide to a stop. | ||
# - both pwms are full duty cycle (100% HIGH) to brake | ||
# | ||
HBRIDGE_PIN_FWD = 18, ß# provides forward duty cycle to motor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an unintentional beta
as well as some unintentional commas here and below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you.
* Use python dict to namespace the various drivetrain configurations - There is one configuration for choosing the drivetrain. - However, each drivetrain has it's own lengthy set of configurations. - Some of these are shared among several drivetrains OR to avoid that they are prefixed and so identifiers become very long. - This commit moves each drivetrain's configuration into a python dict, effectively namespacing the configuration. - This allowed me to shorten the names of some configs since a prefix is not needed to disambiguate them. So some config names have changed - The bigger issue for users is that now, if they want to change any drivetrain config, they will need to uncomment the entire dictionary block, not just a single line of configuration. That should be obvious when looking at the code, but it could trick a newbie that does not understand python. I would say that is fine, because they will learn something important from it. - If you look at the resulting config.py you will see that it is much cleaner. * path_follow.py only support I2C_SERVO drivetrain - so I updated the configuration to reflect this - removed the DRIVETRAIN_TYPE configuration, since it is not used - removed the other drivetrain configurations which are not used * Change webui info log to debug log * Put drivetrain config in dictionary to address isssue #989 * remove spurious beta character and extra commas. * version="4.3.6" Co-authored-by: Ezward <Ezward@github.com> (cherry picked from commit cffec78)
Addresses Issue #989
The PWM_STEERING_PIN configuration values are used in several DRIVETRAIN_TYPE configurations, each with a different default value. If you just set the DRIVETRAIN_TYPE = "PWM_STEERING_THROTTLE", but don't uncomment the PWM_STEERING_PIN value, then the default of a different drivetrain get's used.
So a workaround is to just uncomment PWM_STEERING_PIN in the PWM_STEERING_THROTTLE sections.
This fix changes the newer drivetrain configuration into python dictionaries so all configuration are namespaced.