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

Move adding camera, controller, drivetrain into functions #1042

Merged
merged 1 commit into from
Oct 8, 2022

Conversation

Ezward
Copy link
Contributor

@Ezward Ezward commented Sep 16, 2022

This is the first step in updating the path_follow.py template to use GPS. This step is just to make the same sensor available in complete.py available to any template, and to simplify the complete.py template as well. The full process for merging in the GPS branch can be found in [Issue 991}(https://github.com//issues/991#issuecomment-1242763724)

  • refactored complete.py to move adding of common parts into functions that can be shared with other templates (path follow in particular).
    • add_drivetrain() adds the configured drive train to the vehicle.
    • add_odometry() adds configured encoders to the vehicle.
    • get_camera()/add_camera() adds configured camera(s) to the vehicle.
    • add_simulator() adds donkey gym if it is configured.
    • add_user_controller() adds the webui and any configured game controller, or the donkey hat.

- refactored complete.py to move adding of common parts
  into functions that can be shared with other templates
@Ezward Ezward requested review from DocGarbanzo and zlite September 16, 2022 23:28
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. It's probably hard to test, because you can have all possible combinations of controllers, drive-trains, cameras, etc. Did you test some of the common combinations?

@Ezward
Copy link
Contributor Author

Ezward commented Sep 26, 2022

I am going to run this branch this weekend at the diyrobocars race and if all goes well I will merge. Thank you for the approval @DocGarbanzo

@Ezward Ezward merged commit a37c0e2 into main Oct 8, 2022
@Ezward Ezward deleted the Refactor-templates-to-share-common-parts branch October 8, 2022 01:42
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