Repository navigation
feat(controller): bump feetech-servo to v0.7.1; servo condition flags are data, not failed reads - #47
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
… text Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
…allers) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
Reads now return the payload alongside a condition-flag error; writes return nil on condition-only flags. No signature changes; all tests green unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
…tion flag Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
…ondition flag Both return the flags alongside the reading; WaitForServosToStop, the arm's IsMoving/dwell callers, servocmd.ServoOps and FakeServoOps adapt. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
FakeServoOps.AnyServoMoving returns no condition alongside an error, like the real handle; comment the named-return assignment; pin the rejection error text. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
SyncReadPositions, GetJointPositionsAndMovingForServos, GetJointPositions, GetJointPositionsForServos and LoadForServos keep the reading and drop the flags; nothing reads them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
Text, not a bitfield, because structpb renders numbers as float64 on a remote arm and a typed error does not survive the DoCommand boundary at all. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
v0.7.1's Bus.Ping returns the model number alongside a condition error, so a clamped gripper no longer fails arm bring-up or reads as not_responding in motor setup. The discovery service's port probe is left alone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
…UDE.md Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qv1ZbWg7v4RH7HcR6xUgAi
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.
Why
internal/controllerdiscarded a valid servo reading whenever the servo set any status flag. An overloaded servo (a gripper clamped on a part, a hot joint) was therefore unreadable, and the arm's dwell,IsMoving,JointPositions, motor-setup verification and arm bring-up all inherited that blindness.feetech-servo v0.7.0/v0.7.1 fixed the library half: reads return the payload alongside a condition error, and
feetech.ConditionStatus(err)says whether the payload is usable. This PR is the module half, extracted from #42 so the gripper grasp latch there can rebase onto it. It is wider than #42's two sites.What changed
feetech-servov0.6.1 → v0.7.1. No signature changes. v0.7.1 also makes writes return nil on condition-only flags; nothing onmaininferred "overloaded" from a write error (checked everySyncWrite/WriteRegister/RegWrite/SetGoals/gain/torque write), so this is strictly fewer spurious failures. One visible effect:applyServoGainsnow completes D→I→P on a flagged servo instead of aborting mid-sequence.tolerateCondition(err) (feetech.StatusError, error), is the single place the policy lives. Nine read paths inmanager.goroute through it right after their bus read:ServoPositionPercent,AnyServoMoving,SyncReadPositions,GetJointPositionsAndMovingForServos(the dwell's read),GetJointPositions,GetJointPositionsForServos,LoadForServos,Ping,PingServo. Only the first two expose the flags, because only they have a consumer;Pinglogs them.ReadServoRegisterandconfig.go's calibration reads are deliberately left intolerant.servo_position/servo_movingcarryconditionas text (servo status error: [overload]), absent when clear. Text because a protobufStructturns every number into a float64 on a remote arm; a field because a typed error does not survive the DoCommand boundary at all. No consumer onmainuntil Latch the grasp instead of inferring it, and add servo_load #42 lands — it is the wire contract Latch the grasp instead of inferring it, and add servo_load #42 rebases onto.testfake.FakeTransport.SetStatusinjects a status byte through the real protocol, so every path above is unit-tested without hardware via a clean-vs-flagged handle pair.docs/arm.mdresponse samples; one CLAUDE.md gotcha.Hardware behaviour changes to know about
doServoInitialization→Ping) or reads asnot_respondinginmotor_setup_verify.feetech.Discovernow includes condition-flagged servos (newFoundServo.Status), sodiscoverOneMotorsees a hot motor it previously dropped. Direction is right; untested here.services/discovery's port probe still treats any ping error as "no servo" — it holds no handle. Follow-up.WaitForServosToStopon an overloaded-but-stopped servo now returns whenMoving = 0instead of erroring (tested against the real fake-bus path).Testing
go test ./...,-raceoninternal/...andcomponents/...,go vet,gofmt -sclean. Mutation checks executed: stubbing the helper fails all seven position/moving/load subtests plus three helper cases; un-wiring one site fails exactly that site's subtest.Hardware test: clamp the gripper by hand, then (1)
servo_positionon the arm returns a reading withconditionset, (2) restart the arm component with the gripper still clamped and confirm it comes up.🤖 Generated with Claude Code