Repository navigation
Name the motor a failed sync read stopped at; release 1.12.0 - #153
Merged
Merged
Conversation
A sync read asks every motor at once, and its error said the bus failed
without saying where. The error is now a `SyncReadError { id, cause }`.
A plain sync read names the motor whose status packet did not come back.
A fast sync read names the first motor whose block is not there as
asked. The packet is now read without `read_exact`, which threw away
the bytes that arrived before a timeout -- and those bytes are what say
where the packet stopped. Missing, cut short, out of order and failing
its CRC all name that block's motor.
Assisted-by: Claude:claude-opus-5-5
Bump the crate version and turn the Unreleased changelog section into the 1.12.0 release notes: a failed sync read names the motor it stopped at (SyncReadError), and the Feetech STS3036 is registered under the STS3215 definition (#150). A fast sync read that times out now reports TimeoutError inside a SyncReadError, where it used to return the port's io::Error. Assisted-by: Claude:claude-opus-5-5
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.
A sync read asks every motor at once, and its error said only that the bus failed. On a bus of fifteen servos, that means checking every cable instead of one.
A failed sync read now returns
SyncReadError { id, cause }, reached withdowncast_refand printed asmotor 4: Timeout error.idis the motor whose own status packet did not come back.idis the first motor whose block in the combined packet is not there as asked. That covers a block that is missing, cut short, out of order (Incorrect id) or failing its running CRC. The packet is no longer read withread_exact, which threw away the bytes that arrived before a timeout; those bytes show where the packet stopped. If nothing at all comes back, the error names the first motor, because the header goes out with its block.A motor behind a gap that answers in the missing motor's slot still has a valid CRC, since its CRC covers what it heard on the bus. The ID check catches it, so the error still names the missing motor. A test covers this case.
Behaviour change: a fast sync read that times out now reports
CommunicationErrorKind::TimeoutErroras the cause. It used to return the port'sio::Error. Any other I/O error from the port is still returned unchanged, without a motor ID, because it is the port's fault and not a motor's.Limit: the motors after the named one are not known to be fine. A cable that breaks at that motor silences everything past it as well.
Motivation:
microduck'srobotdreports "motor bus: N read failures running" with no way to say which servo. This is the first step toward reporting that.Release: the second commit bumps the version to 1.12.0 and turns the Unreleased changelog section into the 1.12.0 notes, which also cover the STS3036 entry (#150). Tagging
v1.12.0after the merge publishes it to crates.io and PyPI.🤖 Generated with Claude Code