Skip to content

fix python porthandler bug - #682

Merged
GyuH13 merged 2 commits into
mainfrom
feature-fix-python-porthandler-bug
May 6, 2026
Merged

GyuH13 merged 2 commits into
mainfrom
feature-fix-python-porthandler-bug

Conversation

@GyuH13

@GyuH13 GyuH13 commented May 6, 2026

Copy link
Copy Markdown
Member

In the Python PortHandler, the clearPort() function is used to clear the receive buffer before sending a new packet so that the status packet can be received cleanly. Since flush() is not intended for this purpose, we will modify the function accordingly.

@GyuH13
GyuH13 requested review from nhw-robotis and sunghowoo May 6, 2026 01:59
@GyuH13 GyuH13 self-assigned this May 6, 2026
@GyuH13 GyuH13 added the bug Something isn't working label May 6, 2026
@GyuH13 GyuH13 added this to Platform May 6, 2026
@GyuH13 GyuH13 moved this to 📝 Pull Request in Platform May 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Dynamixel SDK version to 4.0.5 across all supported platforms and languages, including C, C++, Python, and ROS packages. The primary functional change is the update of the clearPort() method in the Python PortHandler to use reset_input_buffer() instead of flush(). Review feedback suggests adding a safety check to ensure the serial port is open before attempting to clear the buffer, which would prevent potential exceptions if the method is called on a closed port.

Comment thread python/src/dynamixel_sdk/port_handler.py
Comment thread ros/dynamixel_sdk/src/dynamixel_sdk/port_handler.py

@nhw-robotis nhw-robotis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GOOD

@sunghowoo sunghowoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@GyuH13
GyuH13 merged commit 2ded684 into main May 6, 2026
3 checks passed
@GyuH13
GyuH13 deleted the feature-fix-python-porthandler-bug branch May 6, 2026 02:05
This was referenced May 6, 2026
@robotpilot robotpilot moved this from 📝 Pull Request to 🚩Done in Platform May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants