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

get_touch_sensors should only return two values for Create 3 #36

Closed
shamlian opened this issue Jan 12, 2024 · 4 comments · Fixed by #42
Closed

get_touch_sensors should only return two values for Create 3 #36

shamlian opened this issue Jan 12, 2024 · 4 comments · Fixed by #42
Assignees

Comments

@shamlian
Copy link
Collaborator

get_touch_sensors is defined in the Robot class to return four sensors, which doesn't make sense for Create 3. Someone should fix that.

See original post by @shamlian in #35 (comment)

@scottcandy34
Copy link
Contributor

NOTE: you can shorten the touch handler any operation. The not event.condition can pulled out as such...

not event.condition and (self.touch_sensors.front_left or self.touch_sensors.front_right or self.touch_sensors.back_left or self.touch_sensors.back_right)

This will fail off the start for event.condition, not having extra checks will increase speed.

@shamlian
Copy link
Collaborator Author

shamlian commented Jan 12, 2024

Good point. Would you agree that the two other checks on the value of any in the elif statements just below are redundant? I think if we make it to those elifs, any is guaranteed to be False.

@scottcandy34
Copy link
Contributor

yes I was just looking at that too. agreed

@shamlian
Copy link
Collaborator Author

All right, I'll be pushing a fix to the branch for this soon.

@shamlian shamlian self-assigned this Jan 12, 2024
@shamlian shamlian linked a pull request Jan 16, 2024 that will close this issue
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 a pull request may close this issue.

2 participants