[Bug Fix] fix: initialize CAN channel and prevent duplicate DM control-loop thread start#31
Open
whats2000 wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to improve robot startup stability by fixing CAN interface initialization state and adjusting YAM motor-chain initialization in get_yam_robot to avoid unintended side effects from repeated initialization/startup patterns.
Changes:
- Initialize
CanInterface.channelin the constructor to ensure consistent object state. - Change YAM real-hardware motor-chain creation to start the control thread immediately and remove the later manual
start_thread()call. - Update comments/logging around the YAM initialization sequence.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| i2rt/robots/get_robot.py | Changes motor-chain startup timing and wrap-around offset correction flow for real hardware initialization. |
| i2rt/motor_drivers/can_interface.py | Sets self.channel during construction so the interface has a defined channel attribute immediately. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…licate control-loop startups patch comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR fixes two initialization and runtime stability issues in the robot stack:
These changes improve startup reliability and prevent duplicate control-loop startup.
Why is this needed?
What files are changed?
can_interface.pydm_driver.pyHow was this tested?
Manual QA
Local validation
QA Result
PASS on Yam Ultra hardware and integration flows above.
No regressions observed in startup/control-loop behavior during these runs.
Risks and mitigations
Checklist
Related commits