Skip to content

fix(zed): remove hidden realsense dependency#323

Open
alectimison-maker wants to merge 2 commits into
RobotControlStack:masterfrom
alectimison-maker:fix/zed-calibration-dependency
Open

fix(zed): remove hidden realsense dependency#323
alectimison-maker wants to merge 2 commits into
RobotControlStack:masterfrom
alectimison-maker:fix/zed-calibration-dependency

Conversation

@alectimison-maker

Copy link
Copy Markdown

Summary

  • remove rcs_zed's import-time dependency on rcs_realsense
  • let default_zed() accept an explicit per-camera CalibrationStrategy mapping
  • use ZEDCameraSet's existing DummyCalibrationStrategy fallback when no
    strategy is supplied
  • keep default_zed_dummy_calibration() as a backward-compatible wrapper
  • remove calibration-only dependencies and the RealSense source-path injection
    that masked the packaging problem
  • document the standalone calibration contract

Motivation

rcs_zed.utils imported FR3BaseArucoCalibration from
rcs_realsense.calibration, but rcs_zed did not declare rcs_realsense as a
dependency. Its local Makefile added ../rcs_realsense/src to PYTHONPATH, so
the extension appeared to work in a repository checkout while a standalone
installation could fail as soon as rcs_zed.utils was imported.

Declaring rcs_realsense as a dependency would make ZED users install the
unrelated pyrealsense2 hardware stack. Moving the FR3-specific AprilTag
implementation into rcs-core would instead add calibration dependencies to
every core installation. Explicit strategy injection keeps the hardware
extensions independent and uses the calibration protocol RCS already exposes.

Design

default_zed(name2id, calibration_strategy=None) now forwards the optional
mapping directly to ZEDCameraSet. The camera set already creates one
DummyCalibrationStrategy per camera when the mapping is omitted.

Applications that need measured extrinsics can pass any implementation of
rcs.camera.hw.CalibrationStrategy. Mapping keys correspond to the logical
camera names in name2id.

Because no code in rcs_zed uses pupil_apriltags or diskcache after the
cross-extension import is removed, those requirements are also removed from the
wheel metadata.

Testing

  • isolated pre-change import contract — reproduced
    ModuleNotFoundError: No module named 'rcs_realsense'
  • isolated post-change import/behavior contract — passed; verifies no RealSense
    module is needed, default dummy calibration, custom strategy injection, and
    None handling
  • python -m build --wheel --outdir /tmp/rcs-zed-pr-dist extensions/rcs_zed — passed
  • built-wheel METADATA inspection — passed; requirements are only
    rcs-core>=0.7.2, opencv-python~=4.10.0, and typer~=0.9
  • isort --check-only on changed Python files — passed
  • black --check on changed Python files — passed
  • ruff check on changed Python files — passed
  • python -m py_compile on changed Python files — passed
  • git diff --check — passed

The complete ZED extension test file was not run locally because published
rcs-core==0.7.2 wheels are Linux x86_64-only, while this development host is
macOS arm64. The repository tests are included for the Linux CI environment.

Compatibility and risks

The helper's original one-argument call remains valid, and
default_zed_dummy_calibration() retains its signature and behavior.

The intentional behavior correction is that default_zed() no longer silently
selects the FR3-base RealSense calibration. Callers relying on that undeclared
cross-extension behavior must pass their desired calibration strategy
explicitly. This is documented in both the extension README and the published
ZED documentation.

Scope

This PR does not move a robot-specific AprilTag calibration into core, duplicate
that implementation in the ZED extension, or add a new shared calibration
package. Those are broader architecture choices and are not required to restore
standalone installation.

Closes #287

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.

Track hidden rcs_zed dependency on rcs_realsense calibration

1 participant