Skip to content

feat: add compliant joint trajectory task#2574

Draft
TomCC7 wants to merge 11 commits into
dimensionalOS:mainfrom
TomCC7:cc/feat/compliant-control
Draft

feat: add compliant joint trajectory task#2574
TomCC7 wants to merge 11 commits into
dimensionalOS:mainfrom
TomCC7:cc/feat/compliant-control

Conversation

@TomCC7

@TomCC7 TomCC7 commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

  • add composed control task support plus joint compliance/compliant trajectory tasks
  • register compliant trajectory task and add xArm7 MuJoCo obstacle blueprint for manual testing
  • document rigid vs compliant trajectory behavior, safety bounds, and verification commands

Validation

  • uv run pytest dimos/control/test_composition.py dimos/control/tasks/compliance_task/test_compliance_task.py
  • uv run ruff check dimos/control/task.py dimos/control/composition.py dimos/control/tasks/compliance_task dimos/control/test_composition.py dimos/robot/manipulators/common/blueprints.py dimos/robot/manipulators/xarm/config.py dimos/robot/manipulators/xarm/blueprints/simulation.py dimos/robot/all_blueprints.py
  • uv run --group lint mypy dimos/control/task.py dimos/control/composition.py dimos/control/tasks/compliance_task/compliance_task.py dimos/control/tasks/compliance_task/compliant_trajectory_task.py dimos/control/tasks/compliance_task/__registry__.py dimos/control/test_composition.py dimos/control/tasks/compliance_task/test_compliance_task.py dimos/robot/manipulators/common/blueprints.py dimos/robot/manipulators/xarm/config.py dimos/robot/manipulators/xarm/blueprints/simulation.py
  • openspec validate add-compliant-joint-trajectory-task
  • CI=1 uv run pytest dimos/robot/test_all_blueprints_generation.py
  • uv run --group lint doclinks docs/capabilities/manipulation/readme.md docs/development/conventions.md

Manual MuJoCo check

  • uv run dimos --simulation run xarm7-compliant-obstacle-sim

Draft PR for review before marking ready.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1918 1 1917 159
View the top 1 failed test(s) by shortest run time
dimos.robot.test_all_blueprints::test_blueprint_is_valid[xarm7-compliant-obstacle-sim]
Stack Traces | 3.12s run time
blueprint_name = 'xarm7-compliant-obstacle-sim'

    @pytest.mark.parametrize("blueprint_name", UBUNTU_BLUEPRINTS)
    def test_blueprint_is_valid(blueprint_name: str) -> None:
        """Validate blueprints that should import on the ubuntu-latest runner."""
>       _check_blueprint(blueprint_name)

blueprint_name = 'xarm7-compliant-obstacle-sim'

dimos/robot/test_all_blueprints.py:103: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
dimos/robot/test_all_blueprints.py:79: in _check_blueprint
    blueprint = get_blueprint_by_name(blueprint_name)
        blueprint_name = 'xarm7-compliant-obstacle-sim'
        message    = "Failed to pull LFS file .../dimos/data/.lfs/xarm7.tar.gz after 3 attempts: Command '['git', 'lfs', 'pull', '--include', 'data/.lfs/xarm7.tar.gz']' returned non-zero exit status 1."
dimos/robot/get_all_blueprints.py:47: in get_blueprint_by_name
    module = __import__(module_path, fromlist=[attr])
        attr       = 'xarm7_compliant_obstacle_sim'
        module_path = 'dimos.robot.manipulators.xarm.blueprints.simulation'
        name       = 'xarm7-compliant-obstacle-sim'
.../xarm/blueprints/simulation.py:44: in <module>
    address=str(XARM7_SIM_PATH),
        MujocoSimModule = <class 'dimos.simulation.engines.mujoco_sim_module.MujocoSimModule'>
        ObjectSceneRegistrationModule = <class 'dimos.perception.object_scene_registration.ObjectSceneRegistrationModule'>
        PickAndPlaceModule = <class 'dimos.manipulation.pick_and_place_module.PickAndPlaceModule'>
        RerunBridgeModule = <class 'dimos.visualization.rerun.bridge.RerunBridgeModule'>
        XARM7_SIM_HOME = [0.0, 0.0, 0.0, 0.0, 0.0, -0.7, ...]
        XARM7_SIM_PATH = <[RuntimeError("Failed to pull LFS file .../dimos/data/.lfs/xarm7.tar.gz after 3 attempts: Command...ude', 'data/.lfs/xarm7.tar.gz']' returned non-zero exit status 1.") raised in repr()] LfsPath object at 0xffcd97ba70d0>
        __builtins__ = <builtins>
        __cached__ = '.../blueprints/__pycache__/simulation.cpython-312.pyc'
        __doc__    = 'Simulation xArm perception manipulation blueprints.'
        __file__   = '.../work/dimos/dimos/.../xarm/blueprints/simulation.py'
        __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0xffcd9645f9b0>
        __name__   = 'dimos.robot.manipulators.xarm.blueprints.simulation'
        __package__ = 'dimos.robot.manipulators.xarm.blueprints'
        __spec__   = ModuleSpec(name='dimos.robot.manipulators.xarm.blueprints.simulation', loader=<_frozen_importlib_external.SourceFileLo...ject at 0xffcd9645f9b0>, origin='.../work/dimos/dimos/.../xarm/blueprints/simulation.py')
        annotations = _Feature((3, 7, 0, 'beta', 1), None, 16777216)
        autoconnect = <function autoconnect at 0xffce470c7880>
        compliant_trajectory_task = <function compliant_trajectory_task at 0xffcd9a66e840>
        coordinator = <function coordinator at 0xffcd9a66eac0>
        make_xarm7_model_config = <function make_xarm7_model_config at 0xffcd9a66f4c0>
        make_xarm_hardware = <function make_xarm_hardware at 0xffcd9a66efc0>
        math       = <module 'math' (built-in)>
        trajectory_task = <function trajectory_task at 0xffcd9a66c860>
        xarm7_compliance_obstacle_scene_path = <function xarm7_compliance_obstacle_scene_path at 0xffcd9a66ede0>
dimos/utils/data.py:369: in __str__
    return str(self._ensure_downloaded())
        self       = <[RuntimeError("Failed to pull LFS file .../dimos/data/.lfs/xarm7.tar.gz after 3 attempts: Command...ude', 'data/.lfs/xarm7.tar.gz']' returned non-zero exit status 1.") raised in repr()] LfsPath object at 0xffcd97ba70d0>
dimos/utils/data.py:347: in _ensure_downloaded
    cache = get_data(filename)
        cache      = None
        filename   = 'xarm7/scene.xml'
        self       = <[RuntimeError("Failed to pull LFS file .../dimos/data/.lfs/xarm7.tar.gz after 3 attempts: Command...ude', 'data/.lfs/xarm7.tar.gz']' returned non-zero exit status 1.") raised in repr()] LfsPath object at 0xffcd97ba70d0>
dimos/utils/data.py:304: in get_data
    archive_path = _decompress_archive(_pull_lfs_archive(archive_name))
        archive_name = 'xarm7'
        data_dir   = PosixPath('.../dimos/dimos/data')
        file_path  = PosixPath('.../dimos/dimos/data/xarm7/scene.xml')
        name       = 'xarm7/scene.xml'
        nested_path = PosixPath('scene.xml')
        path_parts = ('xarm7', 'scene.xml')
dimos/utils/data.py:248: in _pull_lfs_archive
    _lfs_pull(file_path, repo_root)
        file_path  = PosixPath('.../dimos/data/.lfs/xarm7.tar.gz')
        filename   = 'xarm7'
        repo_root  = PosixPath('.../work/dimos/dimos')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

file_path = PosixPath('.../dimos/data/.lfs/xarm7.tar.gz')
repo_root = PosixPath('.../work/dimos/dimos')

    def _lfs_pull(file_path: Path, repo_root: Path, *, retries: int = 2) -> None:
        relative_path = file_path.relative_to(repo_root)
    
        env = os.environ.copy()
        env["GIT_LFS_FORCE_PROGRESS"] = "1"
    
        last_err: subprocess.CalledProcessError | None = None
        for attempt in range(1, retries + 2):  # retries + 1 total attempts
            try:
                subprocess.run(
                    ["git", "lfs", "pull", "--include", str(relative_path)],
                    cwd=repo_root,
                    check=True,
                    env=env,
                )
                return
            except subprocess.CalledProcessError as e:
                last_err = e
                if attempt <= retries:
                    time.sleep(attempt)  # 1s, 2s backoff
    
>       raise RuntimeError(
            f"Failed to pull LFS file {file_path} after {retries + 1} attempts: {last_err}"
        )
E       RuntimeError: Failed to pull LFS file .../dimos/data/.lfs/xarm7.tar.gz after 3 attempts: Command '['git', 'lfs', 'pull', '--include', 'data/.lfs/xarm7.tar.gz']' returned non-zero exit status 1.

attempt    = 3
env        = {'ACCEPT_EULA': 'Y', 'ACTIONS_ORCHESTRATION_ID': '690b3ce1-84a2-4786-bac5-22e47fa3d75b.tests.ubuntu-24_04-arm_3_14_fal...TIONS_RUNNER_ACTION_ARCHIVE_CACHE': '/opt/actionarchivecache', 'ACTIONS_RUNNER_RETURN_JOB_RESULT_FOR_HOSTED': '1', ...}
file_path  = PosixPath('.../dimos/data/.lfs/xarm7.tar.gz')
last_err   = CalledProcessError(1, ['git', 'lfs', 'pull', '--include', 'data/.lfs/xarm7.tar.gz'])
relative_path = PosixPath('data/.lfs/xarm7.tar.gz')
repo_root  = PosixPath('.../work/dimos/dimos')
retries    = 2

dimos/utils/data.py:216: RuntimeError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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