Skip to content

Use the ICRA 2019 Controller from marinholab-sas-core - #17

Merged
mmmarinho merged 1 commit into
mainfrom
use-sas-core-icra2019-controller
Sep 25, 2026
Merged

mmmarinho merged 1 commit into
mainfrom
use-sas-core-icra2019-controller

Conversation

@mmmarinho

Copy link
Copy Markdown
Contributor

The ICRA 2019 task-space controller moved out of this package into marinholab.sas.core.papers.icra2019 (shipped in marinholab-sas-core >= 26.9.8, added in MarinhoLab/sas_py#7, merged). This switches the package to use it.

Changes

  • Deleted marinholab/working/needlemanipulation/icra2019_controller.py and imported the renamed Controller from marinholab.sas.core.papers.icra2019 in __init__.py, example_load_from_file.py, needle_controller.py, and the saul/ scripts.
  • Backward-compat alias: ICRA19TaskSpaceController is kept at the package root as an alias for Controller (mirroring the existing M3_SerialManipulatorSimulatorFriendly alias), so existing from marinholab.working.needlemanipulation import ICRA19TaskSpaceController imports keep working.
  • NeedleController now subclasses the moved Controller. The parent normalizes verbose with an RCM-only category set, but the needle VFI helpers use the full 5-category set (radius/plane/orientation/insertion/rcm). NeedleController therefore re-normalizes the complete set locally, hands the parent only the rcm flag it understands, and re-sets self.verbose to the full dict after super().__init__ (the parent's normalize_verbose would otherwise overwrite it with its RCM-only dict, which would KeyError on needle_w's verbose["radius"] etc.).
  • Dependency: pinned marinholab-sas-core>=26.9.8 to guarantee the papers subpackage is present.
  • Tests: extended tests/conftest.py to mock marinholab.sas.core.papers.icra2019 (Controller = MagicMock class) so the package still imports on a bare checkout (no compiled core); gated the two tests that now exercise the real controller on core_available (matching the existing pattern).
  • Docs: updated AGENTS.md and README.md to reflect the new location.

Verification

  • The moved Controller imports and runs a full control step (no-RCM and with-RCM) through the real qpoases Solver, with the [rcm] debug line firing correctly.
  • NeedleController subclassing and the 5-category verbose plumbing verified (both verbose=True and a multi-category dict produce the correct full dict, and the radius/rcm debug output renders).
  • All changed files pass py_compile; CRLF line endings in the saul/ scripts preserved.
  • Repo test suite shows no new failures relative to main (the remaining 4 failures — 3× a needle_jacobian signature mismatch and 1× a mock-robot shape — are pre-existing on pristine main; one test that errored on main now skips cleanly via the core_available gate).

This PR was created by an AI agent (OpenHands) on behalf of the user.

The task-space controller moved out of this package into
marinholab.sas.core.papers.icra2019 (shipped in marinholab-sas-core >=
26.9.8, see MarinhoLab/sas_py#7). This switches the package to use it.

- Delete icra2019_controller.py; import the renamed Controller from
  marinholab.sas.core.papers.icra2019 in __init__.py,
  example_load_from_file.py, needle_controller.py, and the saul/ scripts.
- Keep ICRA19TaskSpaceController as a backward-compatible alias for
  Controller at the package root (mirrors the existing
  M3_SerialManipulatorSimulatorFriendly alias), so existing imports keep
  working.
- NeedleController now subclasses the moved Controller. Because the parent
  normalizes verbose with an rcm-only category set while the needle VFI
  helpers use the full 5-category set, NeedleController re-normalizes the
  complete set locally, hands the parent the rcm flag, and re-sets
  self.verbose to the full dict after super().__init__ (the parent's
  normalize_verbose would otherwise overwrite it with rcm-only).
- Pin marinholab-sas-core>=26.9.8 to guarantee the papers subpackage.
- Extend tests/conftest.py to mock marinholab.sas.core.papers.icra2019
  (Controller = MagicMock class) so the package imports on a bare checkout;
  gate the two tests that now exercise the real controller on core_available.
- Update docs (AGENTS.md, README.md) to reflect the new location.

Verified: the moved Controller imports and runs a full control step through
the real qpoases Solver; NeedleController subclassing + 5-category verbose
plumbing work; py_compile clean. The repo test suite shows no new failures
relative to main (remaining failures are pre-existing).

Co-authored-by: openhands <openhands@all-hands.dev>

@mmmarinho mmmarinho left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mmmarinho
mmmarinho merged commit c2fd326 into main Sep 25, 2026
13 checks passed
@mmmarinho
mmmarinho deleted the use-sas-core-icra2019-controller branch September 25, 2026 08:15
mmmarinho pushed a commit that referenced this pull request Sep 25, 2026
After the ICRA 2019 controller moved to marinholab-sas-core (PR #17), the
QP solver used by the controllers is marinholab.solvers.qpoases.Solver, and
nothing in this repo imports dqrobotics.solvers anymore. That made
stubs/dqrobotics/solvers/__init__.pyi (DQ_QuadraticProgrammingSolver)
orphaned, violating the documented invariant that stubs declare only the
symbols this project actually imports.

- Delete stubs/dqrobotics/solvers/__init__.pyi.
- Remove the corresponding line from the stubs tree listing in AGENTS.md.

pyright reports the same (pre-existing, environment-only) missing-import
warnings as before the change; no new diagnostics.

Co-authored-by: openhands <openhands@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant