Skip to content
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

Merged
merged 6 commits into from
Mar 17, 2022

Conversation

Ezward
Copy link
Contributor

@Ezward Ezward commented Mar 7, 2022

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.

Ezward and others added 4 commits February 12, 2022 09:53
- 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
@Ezward Ezward self-assigned this Mar 7, 2022
@Ezward
Copy link
Contributor Author

Ezward commented Mar 7, 2022

This branch still needs have all the updated drivetrains tested.

# 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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@Ezward Ezward requested a review from DocGarbanzo March 16, 2022 17:45
Copy link
Contributor

@DocGarbanzo DocGarbanzo left a 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.

@Ezward Ezward marked this pull request as ready for review March 17, 2022 11:05
@Ezward Ezward requested a review from DocGarbanzo March 17, 2022 11:05
Copy link
Contributor

@DocGarbanzo DocGarbanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you.

@DocGarbanzo DocGarbanzo merged commit cffec78 into main Mar 17, 2022
@Ezward Ezward deleted the 989-namespace-drivetrain-configurations branch March 20, 2022 00:19
DocGarbanzo pushed a commit that referenced this pull request Apr 4, 2022
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants