-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fixed touch detection #27
Conversation
@chshong: can you check if this PR also fixes 7.8? I believe it does. |
I have checked the program and found an issue that when robot's 'touch' is set to True, it never returns back to False even if the robot is not in touch anymore. I fixed this issue. |
In investigating this issue, I found another issue that, the participant programs are receiving more packets than they supposed to. Since the supervisor's PERIOD_MS is 50 ms, the participant programs should received a packet (thus a call to update()) in 50 ms period. However, it looks like the packet is sent in each of Webots's basic time step, which is 10 ms period. I will add this to issue list since this is not directly related to touch detection |
Thank for the fix. If you agree, I will remove the debug code (print statements) that you added. |
May I let you check my two commits (they shouldn't affect functionality) and re-approve this PR if you agree? |
controllers/supervisor/supervisor.py
Outdated
for team in constants.TEAMS: | ||
for id in range(constants.NUMBER_OF_ROBOTS): | ||
if touch[team][id]: | ||
if touch[team][id]: # if any of the robots has touched the ball at this frame, update touch status | ||
self.recent_touch = touch | ||
break |
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.
This changes the behavior of the program because if one if touch[team][id]
is True, the loop will stop immediately and statuses of remaining robots will not be updated.
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.
You are correct. I will fix this...
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.
Simplification made around line 1000 changes the behavior of the loop
I just fixed the problem you reported. Can you confirm it looks good to you now? |
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.
Yes, it looks fine
This PR fixes 7.7 on aiwc#58
👍