Skip to content

fix(dm_driver): join control thread before closing the CAN bus#51

Open
Kaweees wants to merge 1 commit into
i2rt-robotics:mainfrom
Kaweees:main
Open

fix(dm_driver): join control thread before closing the CAN bus#51
Kaweees wants to merge 1 commit into
i2rt-robotics:mainfrom
Kaweees:main

Conversation

@Kaweees

@Kaweees Kaweees commented Jun 6, 2026

Copy link
Copy Markdown

DMChainCanInterface.close shuts down the CAN bus without waiting for the control thread to exit, so the thread can be mid _set_commands()bus.send() when the socket is torn down.

This pull request keeps a handle to the control thread and join()s it (1s timeout) before calling motor_interface.close(), so any in-flight _set_commands() finishes before the bus is torn down. The timeout avoids blocking shutdown if the loop is wedged.

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.

1 participant