Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prevent Movement after Auto #98

Merged
merged 5 commits into from
Nov 22, 2023

Conversation

Technologyman00
Copy link
Collaborator

Add code to prevent the robot from moving after auto as the robot will attempt to rotate back to the initial heading as desired by the default command

@thenetworkgrinch
Copy link
Contributor

Great idea! I disagree with the implementation though. I try to "Do not repeat yourself" as much as possible. Perhaps a bool attribute (see debounce) instead so execute pulls the current orientation instead of using the controller after initialize sets the debounce and execute unsets it.

@Technologyman00
Copy link
Collaborator Author

I changed it around. I don't know that I love this option but it doesn't repeat code.

@Technologyman00
Copy link
Collaborator Author

Alright should be good now

@thenetworkgrinch
Copy link
Contributor

It may look uglier but it follows more rules than it breaks. This also uses less lines and less cycles so it is more performant.

@thenetworkgrinch
Copy link
Contributor

You did forget to set firstLoop to true in initialize however. initialize will run every time the commabd is loaded.

@Technologyman00
Copy link
Collaborator Author

Ok I can fix that. Should I set it to private or public?

@Technologyman00
Copy link
Collaborator Author

I set it to private based on the minimal amount of research I did.

@thenetworkgrinch
Copy link
Contributor

Private is correct.

@thenetworkgrinch thenetworkgrinch merged commit 12c9744 into BroncBotz3481:main Nov 22, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants