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

Fix "txpacket() randomly gets stuck on Linux" #621

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fujimotos
Copy link

This fixes the issue "Python SDK randomly gets stuck on txpacket()".

  • It turned out that Python SDK calls termios.tcdrain() to clear remaining
    data in the serial port.
  • Since tcdrain() is a blocking operation, it can paralyze the Python
    interpreter for a few seconds.

On the other hand, C/C++ SDK uses tcflush() for the same purpose, so
simply dicards the data not transmitted yet. Fix Python SDK to do the same.

Related: See pyserial/pyserial#625 for related discussion in pyserial/pyserial.

It turned out that Python SDK calls termios.tcdrain() to clear remaining data
in the serial port. Since tcdrain() is a blocking operation, it can paralyze
the Python interpreter execution for a few seconds.

On the other hand, C/C++ SDK uses `tcflush()` for the same purpose, so simply
dicards the data not transmitted yet. Fix Python SDK to do the same.

Signed-off-by: Fujimoto Seiji <[email protected]>
@robotpilot robotpilot deleted the branch ROBOTIS-GIT:master December 4, 2024 10:44
@robotpilot robotpilot closed this Dec 4, 2024
@fujimotos
Copy link
Author

@robotpilot I'm wondering why this PR gets closed?

We've been using a forked version for this issue. It would
be nice if you can merge this fix into the main line.

@robotpilot
Copy link
Member

robotpilot commented Dec 5, 2024

@fujimotos I'm sorry for the unintended situation. This issue arose as we switched the default branch from "master" to "main." If you could modify the PR to target the "main" branch or re-register it, we will make sure to reflect it in the upcoming update. We apologize for the inconvenience and thank you for your understanding.

@robotpilot robotpilot reopened this Dec 5, 2024
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