fix(liconic): wait for the z-lift to reach the read position before scanning a barcode#1116
Merged
rickwierenga merged 1 commit intoJun 26, 2026
Conversation
scan_barcode sent ST 1910 to move the lift to the read position and then fired the scan immediately, without waiting for the move to finish. The beam latched on while the lift was still travelling and decoded whichever plate it passed en route — requesting a scan of level 5 with a plate at level 10 returned level 10's barcode. Await _wait_ready() after ST 1910, matching every other motion method in the backend (open_door, take_in_plate, move_position_to_position, and the sibling read_barcode_inline). Fixes PyLabRobot#1115 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
|
thanks! |
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.
Summary:
What
ExperimentalLiconicBackend.scan_barcode()sent theST 1910move command to position the z-lift at the read height and then immediately triggered the scan, without waiting for the move to finish. The beam latched on while the lift wasstill travelling, so it decoded whichever plate it passed en route instead of the requested level — e.g. on an STX220 with plates at levels 22 and 10, Scanning level 5 returned level 10's barcode.
This adds
await self._wait_ready()betweenST 1910and the scan, matching every other motion-issuing method in the backend (open_door,close_door,initialize,take_in_plate,move_position_to_position) and the siblingread_barcode_inline(), which already pair theirSTcommand with_wait_ready().scan_barcode()was the only one missing it.Fixes #1115
Test
Added
TestScanBarcodetoliconic_backend_tests.py: it assertsST 1910is sent and_wait_readyis awaited. Verified it fails against the pre-fix code.Also verified on hardware (STX220): plates loaded at two levels, scanning a lower third level now returns the requested level's barcode rather than one the lift passes on the way down.
Happy to make any changes upon reviewing