Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/.lfs/dual_openyam_abc_box_v2.tar.gz
Git LFS file not shown
1 change: 1 addition & 0 deletions dimos/hardware/test_adapter_registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"unitree_go2",
},
"whole_body": {
"dual_openyam_damiao",
"mock_whole_body",
"openarm_damiao",
"openyam_damiao",
Expand Down
19 changes: 19 additions & 0 deletions dimos/hardware/whole_body/dual_openyam_damiao/_registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2026 Dimensional Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ADAPTER_FACTORIES = {
"dual_openyam_damiao": (
"dimos.hardware.whole_body.dual_openyam_damiao.adapter:DualOpenYamDamiaoAdapter"
),
}
98 changes: 98 additions & 0 deletions dimos/hardware/whole_body/dual_openyam_damiao/adapter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Copyright 2026 Dimensional Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Dual OpenYAM bimanual physical topology for the Damiao whole-body adapter."""

from __future__ import annotations

from pathlib import Path

import can_motor_control
from can_motor_control import damiao

from dimos.hardware.whole_body.damiao.adapter import DamiaoWholeBodyAdapter
from dimos.robot.manipulators.dual_openyam.config import DUAL_OPENYAM_URDF_ARM_JOINTS
from dimos.robot.manipulators.dual_openyam.model import DUAL_OPENYAM_MODEL_PATH


def _arm_motors(side: str) -> list[can_motor_control.MotorSpec]:
return [
can_motor_control.MotorSpec(f"{side}_joint1", damiao.MotorType.DM4340, 0x01, 0x11),
can_motor_control.MotorSpec(f"{side}_joint2", damiao.MotorType.DM4340, 0x02, 0x12),
can_motor_control.MotorSpec(f"{side}_joint3", damiao.MotorType.DM4340, 0x03, 0x13),
can_motor_control.MotorSpec(f"{side}_joint4", damiao.MotorType.DM4310, 0x04, 0x14),
can_motor_control.MotorSpec(f"{side}_joint5", damiao.MotorType.DM4310, 0x05, 0x15),
can_motor_control.MotorSpec(f"{side}_joint6", damiao.MotorType.DM4310, 0x06, 0x16),
]


def _gripper_motor(side: str) -> can_motor_control.MotorSpec:
return can_motor_control.MotorSpec(
f"{side}_gripper",
damiao.MotorType.DM4310,
0x08,
0x18,
)


class DualOpenYamDamiaoAdapter(DamiaoWholeBodyAdapter):
"""Two standard YAM follower arms and linear grippers, one bus per side."""

arm_joints = {
"left_arm": tuple(f"left_arm/joint{index}" for index in range(1, 7)),
"right_arm": tuple(f"right_arm/joint{index}" for index in range(1, 7)),
}
gripper_joints = {
"left_gripper": "left_arm/gripper",
"right_gripper": "right_arm/gripper",
}
bus_defaults = {"left": "", "right": ""}
kinematic_joint_names = tuple(DUAL_OPENYAM_URDF_ARM_JOINTS)

@property
def kinematic_model_path(self) -> Path:
"""Return the authoritative dual copy of the verified OpenYAM URDF."""
return DUAL_OPENYAM_MODEL_PATH

def _build_robot(self) -> can_motor_control.Robot:
return (
can_motor_control.Robot.builder()
.add_bus(
"left",
can_motor_control.SocketCanBus(self.bus_address("left")),
damiao.DamiaoCodec(),
)
.add_bus(
"right",
can_motor_control.SocketCanBus(self.bus_address("right")),
damiao.DamiaoCodec(),
)
.add_arm("left_arm", bus="left", motors=_arm_motors("left"))
.add_arm("right_arm", bus="right", motors=_arm_motors("right"))
.add_gripper(
"left_gripper",
bus="left",
motor=_gripper_motor("left"),
opening_direction="decreasing_position",
default_current=0.15,
)
.add_gripper(
"right_gripper",
bus="right",
motor=_gripper_motor("right"),
opening_direction="decreasing_position",
default_current=0.15,
)
.build()
)
57 changes: 57 additions & 0 deletions dimos/hardware/whole_body/dual_openyam_damiao/test_adapter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2026 Dimensional Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from collections.abc import Iterator

import can_motor_control
import pytest
from pytest_mock import MockerFixture

from dimos.hardware.whole_body.damiao.config import DamiaoRuntimeConfig
from dimos.hardware.whole_body.dual_openyam_damiao.adapter import (
DualOpenYamDamiaoAdapter,
)
from dimos.robot.manipulators.dual_openyam.config import DUAL_OPENYAM_JOINTS


@pytest.fixture
def adapter(mocker: MockerFixture) -> Iterator[DualOpenYamDamiaoAdapter]:
mocker.patch.object(can_motor_control, "SocketCanBus", can_motor_control.MockCanBus)
result = DualOpenYamDamiaoAdapter(
runtime_config=DamiaoRuntimeConfig(
bus_addresses={"left": "can8", "right": "can9"},
gravity_comp=False,
)
)
yield result
result.disconnect()


def test_adapter_connects_complete_dual_yam_topology(
adapter: DualOpenYamDamiaoAdapter,
) -> None:
assert adapter.connect()

robot = adapter._robot
assert robot.bus_names() == ["left", "right"]
assert robot.group_names() == ["left_arm", "right_arm", "left_gripper", "right_gripper"]
assert len(robot["left_arm"]) == 6
assert len(robot["right_arm"]) == 6
assert list(adapter.joint_names) == DUAL_OPENYAM_JOINTS
assert adapter._pin_model.nq == 12
assert adapter._pin_model.nv == 12
assert tuple(str(name) for name in adapter._pin_model.names[1:]) == (
*[f"left_joint{index}" for index in range(1, 7)],
*[f"right_joint{index}" for index in range(1, 7)],
)
4 changes: 4 additions & 0 deletions dimos/robot/all_blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"coordinator-cartesian-ik-piper": "dimos.robot.manipulators.piper.blueprints.teleop:coordinator_cartesian_ik_piper",
"coordinator-combined-xarm6": "dimos.robot.manipulators.xarm.blueprints.teleop:coordinator_combined_xarm6",
"coordinator-dual-mock": "dimos.robot.manipulators.common.mock:coordinator_dual_mock",
"coordinator-dual-openyam": "dimos.robot.manipulators.dual_openyam.blueprints.basic:coordinator_dual_openyam",
"coordinator-dual-xarm": "dimos.robot.manipulators.xarm.blueprints.basic:coordinator_dual_xarm",
"coordinator-flowbase": "dimos.control.blueprints.mobile:coordinator_flowbase",
"coordinator-flowbase-keyboard-teleop": "dimos.control.blueprints.mobile:coordinator_flowbase_keyboard_teleop",
Expand Down Expand Up @@ -60,6 +61,7 @@
"desk-marker-tf": "dimos.perception.fiducial.blueprints.desk_marker_tf:desk_marker_tf",
"drone-agentic": "dimos.robot.drone.blueprints.agentic.drone_agentic:drone_agentic",
"drone-basic": "dimos.robot.drone.blueprints.basic.drone_basic:drone_basic",
"dual-openyam-planner-coordinator": "dimos.robot.manipulators.dual_openyam.blueprints.basic:dual_openyam_planner_coordinator",
"dual-xarm6-planner-coordinator": "dimos.robot.manipulators.xarm.blueprints.basic:dual_xarm6_planner_coordinator",
"go2-zenoh-basic": "dimos.robot.unitree.go2.zenoh.blueprints:go2_zenoh_basic",
"go2-zenoh-htc": "dimos.robot.unitree.go2.zenoh.blueprints:go2_zenoh_htc",
Expand Down Expand Up @@ -98,6 +100,7 @@
"teleop-phone-go2-fleet": "dimos.teleop.phone.blueprints:teleop_phone_go2_fleet",
"teleop-quest-a1z": "dimos.teleop.quest.blueprints:teleop_quest_a1z",
"teleop-quest-dual": "dimos.teleop.quest.blueprints:teleop_quest_dual",
"teleop-quest-dual-openyam": "dimos.robot.manipulators.dual_openyam.blueprints.teleop:teleop_quest_dual_openyam",
"teleop-quest-go2": "dimos.teleop.quest.blueprints:teleop_quest_go2",
"teleop-quest-hand-xarm7": "dimos.teleop.quest.blueprints:teleop_quest_hand_xarm7",
"teleop-quest-openarm": "dimos.robot.manipulators.openarm.blueprints.teleop:teleop_quest_openarm",
Expand Down Expand Up @@ -193,6 +196,7 @@
"drone-camera-module": "dimos.robot.drone.camera_module.DroneCameraModule",
"drone-connection-module": "dimos.robot.drone.connection_module.DroneConnectionModule",
"drone-tracking-module": "dimos.robot.drone.drone_tracking_module.DroneTrackingModule",
"dual-open-yam-coordinator": "dimos.robot.manipulators.dual_openyam.blueprints.basic.DualOpenYamCoordinator",
"emitter-module": "dimos.utils.demo_image_encoding.EmitterModule",
"episode-monitor-module": "dimos.imitation.collection.episode_monitor.EpisodeMonitorModule",
"eval-module": "dimos.evals.module.EvalModule",
Expand Down
70 changes: 70 additions & 0 deletions dimos/robot/manipulators/dual_openyam/blueprints/basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright 2026 Dimensional Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Dual OpenYAM coordinator and planning blueprints."""

from dimos.control.coordinator import ControlCoordinatorConfig, TaskConfig
from dimos.control.tasks.trajectory_task.trajectory_task import JOINT_TRAJECTORY_TASK_NAME
from dimos.control.teleop_coordinator import TeleopControlCoordinator
from dimos.core.coordination.blueprints import autoconnect
from dimos.robot.manipulators.common.blueprints import planner
from dimos.robot.manipulators.dual_openyam.config import (
DUAL_OPENYAM_ARM_JOINTS,
dual_openyam_hardware,
dual_openyam_model_config,
)


def dual_openyam_trajectory_task(*, priority: int = 20) -> TaskConfig:
return TaskConfig(
name=JOINT_TRAJECTORY_TASK_NAME,
type="trajectory",
joint_names=list(DUAL_OPENYAM_ARM_JOINTS),
priority=priority,
params={"start_position_tolerance": 0.05},
)


class DualOpenYamCoordinatorConfig(ControlCoordinatorConfig):
"""Dual OpenYAM deployment configuration."""

left_can_port: str | None = None
right_can_port: str | None = None


class DualOpenYamCoordinator(TeleopControlCoordinator):
"""Select mock or explicit dual-CAN hardware during coordinator setup."""

config: DualOpenYamCoordinatorConfig

def _setup_from_config(self) -> None:
self.config.hardware = [
dual_openyam_hardware(
left_can_port=self.config.left_can_port,
right_can_port=self.config.right_can_port,
)
]
super()._setup_from_config()


coordinator_dual_openyam = DualOpenYamCoordinator.blueprint(
tasks=[dual_openyam_trajectory_task()],
)

dual_openyam_planner_coordinator = autoconnect(
planner(robots=[dual_openyam_model_config()]),
DualOpenYamCoordinator.blueprint(
tasks=[dual_openyam_trajectory_task()],
),
)
105 changes: 105 additions & 0 deletions dimos/robot/manipulators/dual_openyam/blueprints/teleop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Copyright 2026 Dimensional Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Coupled Quest teleoperation for the complete Dual OpenYAM entity."""

from dimos.core.coordination.blueprints import autoconnect
from dimos.manipulation.manipulation_module import ManipulationModule
from dimos.manipulation.planning.kinematics.config import PinkKinematicsConfig
from dimos.robot.manipulators.common.blueprints import teleop_ik_task
from dimos.robot.manipulators.dual_openyam.blueprints.basic import (
DualOpenYamCoordinator,
dual_openyam_trajectory_task,
)
from dimos.robot.manipulators.dual_openyam.config import (
DUAL_OPENYAM_ARM_JOINTS,
DUAL_OPENYAM_GRIPPER_JOINTS,
dual_openyam_hardware,
dual_openyam_model_config,
)
from dimos.robot.manipulators.dual_openyam.teleop_ik import (
DualOpenYamPinkPoseTargetSolver,
)
from dimos.teleop.quest.quest_extensions import ArmTeleopModule

DUAL_OPENYAM_QUEST_TASK_NAME = "teleop_dual_openyam"

_dual_openyam_quest_pink = PinkKinematicsConfig(
Comment thread
TomCC7 marked this conversation as resolved.
dt=0.01,
position_cost=8.0,
orientation_cost=2.0,
posture_cost=0.01,
joint_limit_posture_margin=0.3,
lm_damping=0.01,
gain=1.0,
)
_dual_openyam_quest_hardware = dual_openyam_hardware()
_dual_openyam_quest_model = dual_openyam_model_config()
_dual_openyam_quest_task = teleop_ik_task(
_dual_openyam_quest_hardware,
robot_model=_dual_openyam_quest_model,
name=DUAL_OPENYAM_QUEST_TASK_NAME,
joint_names=DUAL_OPENYAM_ARM_JOINTS,
priority=10,
solver_type=DualOpenYamPinkPoseTargetSolver,
bindings=[
{
"hand": "left",
"target_frame": "left_grasp_frame",
"gripper_joint": DUAL_OPENYAM_GRIPPER_JOINTS[0],
"gripper_open_position": 1.0,
"gripper_closed_position": 0.0,
},
{
"hand": "right",
"target_frame": "right_grasp_frame",
"gripper_joint": DUAL_OPENYAM_GRIPPER_JOINTS[1],
"gripper_open_position": 1.0,
"gripper_closed_position": 0.0,
},
],
params={
"pink": _dual_openyam_quest_pink,
"timeout": 0.5,
"max_command_tracking_error_deg": 10.0,
"max_joint_velocity_rad_s": 2.0,
"joint_command_filter_cutoff_hz": 30.0,
},
)

teleop_quest_dual_openyam = autoconnect(
ArmTeleopModule.blueprint(
task_names={
"left": DUAL_OPENYAM_QUEST_TASK_NAME,
"right": DUAL_OPENYAM_QUEST_TASK_NAME,
}
),
DualOpenYamCoordinator.blueprint(
instance_name="ControlCoordinator",
tasks=[
_dual_openyam_quest_task,
dual_openyam_trajectory_task(priority=20),
],
),
ManipulationModule.blueprint(
robots=[_dual_openyam_quest_model],
kinematics=_dual_openyam_quest_pink,
visualization={"backend": "viser"},
),
).remappings(
[
(ArmTeleopModule, "left_controller_output", "left_cartesian_command"),
(ArmTeleopModule, "right_controller_output", "right_cartesian_command"),
]
)
Loading
Loading