Skip to content

Link.__deepcopy__ silently drops collision geometry (coal pickling limitation) #577

Description

@petercorke

Migrated from tech-debt.md (deleted, see repo history via git log -- tech-debt.md).

Link.__deepcopy__ silently drops coal CollisionObject instances because the coal library doesn't support pickling. The current workaround warns at runtime when shapes are lost.

Root cause: a fresh DHLink can reach the coal objects of an unrelated URDF robot through shared class-level state in Link or Robot (exact attribute TBD). This means:

  • Copied DH links that happen to run after URDF robot tests lose nothing (DH links have no collision shapes), so the warning path is never exercised in isolation.
  • If the shared reference is ever followed for other purposes (iteration, serialisation) it could cause similar failures or unexpected aliasing.

Proper fix: obtain the full deepcopy traceback with --tb=long when running test_ERobot.py followed by test_Link.py::TestDHLink::test_copy, trace which attribute chain connects the fresh DHLink to a coal object, and remove or weak-ref that shared state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtKnown technical debt / deferred cleanup, not a live bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions