REF: cc/frontier#2663
Draft
TomCC7 wants to merge 130 commits into
Draft
Conversation
The FloatArray alias and its numpy.typing.NDArray import were never referenced. Remove both.
The OpenArmRSMotorSpecConfig alias for DamiaoMotorSpec was only referenced by its own __all__ entry; nothing imports it. Remove both.
Move 'import time' out of FakeState.__init__ to the module top, per the imports-at-top convention. FakeState.timestamp is still read by the adapter's staleness check, so it stays.
gravity_comp=True and canfd=True are already the OpenArmRSAdapter defaults. The blueprint should only specify what differs, so keep just gravity_model_path.
Per the imports convention, a lazy import of a heavy optional dep needs a comment saying why. Add it to both gravity-model import sites.
tick_deadline_us=1_000 and state_cache_ttl_s=0.002 were unnamed magic numbers duplicated as defaults in both the base and the openarm_rs subclass. Hoist them to _DEFAULT_TICK_DEADLINE_US and _DEFAULT_STATE_CACHE_TTL_S so the two can't drift.
The 'can0' interface name was hard-coded three times: the base constructor default, the base None-coalesce, and the openarm_rs subclass default. Collapse them onto one _DEFAULT_ADDRESS constant so the literal lives in exactly one place. The None-coalesce stays to handle a config that leaves address unset (the factory then passes address=None).
- refresh_state: build the position/velocity/torque lists with ndarray.tolist() instead of per-element float() loops. - write_mit_commands: assemble the MIT matrix with np.column_stack instead of a Python comprehension over zipped rows; this removes the now-redundant _mit_command_rows helper (validation moves to a direct _validate_command_lengths call). - read_state: look the control-mode index up in a precomputed _CONTROL_MODE_INDEX map instead of rebuilding list(ControlMode) every call.
The connect/disconnect/write_enable/write_clear_errors/write_stop paths stuffed context into f-string log lines and dropped the traceback on real failures. Switch to structlog key/value fields and use logger.exception (or warning with exc_info) so the traceback survives instead of being downgraded to an f-string error message.
When the pre-command state read fails, the adapter substitutes zero feed-forward torque. Log a warning (with traceback) so the dropped gravity term is visible instead of being silently swallowed.
The try wrapped both refresh_state and compute_gravity_torques under a broad except Exception, masking a real gravity-model error as 'invalid state'. Scope the try to refresh_state (the call that raises RuntimeError on a bad read) and let a genuine compute error propagate. Also switch the log line to structured fields with a traceback.
The **_: object catch-all silently dropped misspelled adapter kwargs. The registry factory only passes declared parameters (dof, address, hardware_id plus the blueprint adapter_kwargs), so drop the catch-all to turn config typos into a clear TypeError.
The OpenArm integration guide inlined the kp/kd preset numbers, which drift from the adapter code. Replace them with a pointer to OpenArmRSAdapter._DEFAULT_KP/_DEFAULT_KD (and the openarm adapter's own constants).
…utofixes Auto-fixes for cc/openarm-rust-adapter
…le-io feat: add configuration-resolved module io
❌ 17 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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.
opened for tracking, pls ignore