-
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
399 robot is stuck in infinite loop using translate by with wait=true #417
399 robot is stuck in infinite loop using translate by with wait=true #417
Conversation
…-translate_by-with-wait=true
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
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.
I think we should change how timeouts are triggered
t1 = time.time() | ||
while not self._is_goto_finished(id): | ||
time.sleep(0.1) | ||
if time.time() - t1 > timeout: |
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.
I think timeout for the gotos should be checked once the movement has begun only.
If we do:
pose2 = get_pose_matrix([0.4, -0.2, -0.1], [0, -90, 0])
reachy.goto_posture("default")
reachy.r_arm.goto_from_matrix(pose2, wait=True)
Then the timeout is triggered, whereas the goto was just queued
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.
The timeout is now the sum of the duration of all pending movements on the part
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.
Awesome!
The bug was due to the
if wait
that was not supposed to be triggered with unreachable comment (i.e. there is nothing to wait for). It is fixed by aelif
I've added this mechanism to all goto functions, even if the goto_joints don't raise unreachable errors for now.
Also there is a timeout in the wait function to be sure that we don't wait forever if something goes bad on the server side (timeout is set to duration + 1 sec.)
+ little bit of refactoring