Repository navigation
diagnose: accept --id in any order - #177
Open
pradeepsuryad wants to merge 1 commit into
Open
pradeepsuryad wants to merge 1 commit into
pradeepsuryad wants to merge 1 commit into
Conversation
run_diagnose() took each row's id from the command line and its statistics from get_link_stats(i), so the two only matched when the ids were given in the order the library holds the motors in. With --id 8,1 the rows, the (2b) boundary and the --explain advice named the wrong motors, and --id 1,1 added a second row for a motor registered once. Sort the ids and drop repeats as soon as they are parsed: the report is then in ascending order, which section (2b) and explain() read as the daisy-chain order. Take each row's id from the motors the library registered, so a row's label and its statistics come from one place. Fixes enactic#161.
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
This branch has not been deployed
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.
Fixes #161.
This does both parts of the proposal in #161:
run_diagnose()sortssend_idsand drops repeats right after parsing them. The report is then in ascending order, which section (2b) andexplain()read as the daisy-chain order.openarm.get_arm().get_motors()rather than from the command line, so a row's label and itsget_link_stats(i)come from the same place.With today's library, (1) alone is enough; (2) keeps the labels right however the library orders its motors.
--arm, and--idlists that are already ascending, give the same report as before. This doesn't depend on #176.While testing, I found that
--id 1,1onmaindoes more than leave an empty row. It prints the empty row in (1) and (2), then stops at (2b) with exit status 1:The repeated id gets a second row, but the library registered only one motor, so
get_link_stats(1)is out of range.Test
No motors needed. On
vcan0(GitHub Actions, Ubuntu 22.04 and 24.04), a small script answers as motor 0x01. It replies to enable, disable and refresh with a state frame on 0x11. Nothing answers as 0x08, as if the chain were broken between them.diagnoseruns onmainand on this branch:main--id 8,1 --explain--explainsay the axes answer up to 0x08 and stop from 0x01--explainput the break between 0x01 and 0x08--id 1,8 --explainmain--id 1,1Run: https://github.com/pradeepsuryad/openarm_can/actions/runs/42080497698
The fake motor and the check script are on a separate branch of my fork. I can add them to the repository as a test if you'd like one.