diff --git a/pyproject.toml b/pyproject.toml index bd2ed4d..ebf707d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,11 @@ Changelog = "https://github.com/enactic/dora-openarm/releases" Issues = "https://github.com/enactic/dora-openarm/issues" Repository = "https://github.com/enactic/dora-openarm.git" +[tool.setuptools.package-data] +"dora_openarm" = [ + "*.yaml", +] + [tool.ruff.lint] extend-select = [ "D", # pydocstyle diff --git a/src/dora_openarm/main.py b/src/dora_openarm/main.py index ba6acca..06959d6 100644 --- a/src/dora_openarm/main.py +++ b/src/dora_openarm/main.py @@ -76,6 +76,7 @@ def _env_flag(name, default=False): def main(): """Move to the given position and output the current position.""" parser = argparse.ArgumentParser(description="Control OpenArm") + base_dir = os.path.dirname(__file__) parser.add_argument( "--side", choices=["right", "left"], @@ -84,7 +85,7 @@ def main(): ) parser.add_argument( "--config", - default="openarm_cell.yaml", + default=f"{base_dir}/openarm_cell.yaml", help="The configuration file for this OpenArm", type=pathlib.Path, ) diff --git a/src/dora_openarm/openarm_cell.yaml b/src/dora_openarm/openarm_cell.yaml new file mode 100644 index 0000000..18ced41 --- /dev/null +++ b/src/dora_openarm/openarm_cell.yaml @@ -0,0 +1,98 @@ +# Copyright 2026 Enactic, 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. + +# OpenArm Driver Configuration + +# Joint limits for right and left arms [min, max] in radians +joint_limits: + right_arm: + - [-1.3, 2.0] # joint1 + - [-0.174533, 2.0] # joint2 + - [-1.570796, 1.570796] # joint3 + - [0.0, 2.443461] # joint4 + - [-1.570796, 1.570796] # joint5 + - [-0.785398, 0.785398] # joint6 + - [-1.570796, 1.570796] # joint7 + - [-1.047198, 0.4] # joint8 + + left_arm: + - [-2.0, 1.396263] # joint1 + - [-2.0, 0.174533] # joint2 + - [-1.570796, 1.570796] # joint3 + - [0.0, 2.443461] # joint4 + - [-1.570796, 1.570796] # joint5 + - [-0.785398, 0.785398] # joint6 + - [-1.570796, 1.570796] # joint7 + - [-0.4, 1.047198] # joint8 + +joint_offsets: + right_arm: [0.0, -0.506145, 1.570796, -1.745329, 0.0, 0.331612, -1.570796, 0.0] + left_arm: [0.0, 0.506145, -1.570796, -1.745329, 0.0, -0.331612, 1.570796, 0.0] + +# Joint delta position limits (rad/s). +joint_delta_position_limits: + - 1.8 # J0 + - 1.8 # J1 + - 3.3 # J2 + - 2.3 # J3 + - 3.5 # J4 + - 3.5 # J5 + - 3.5 # J6 + - 3.5 # J7 + +# CAN interface +can_interface: + right_arm: "can0" + left_arm: "can1" + +# Motor configuration +motor_config: + types: ['DM8009', 'DM8009', 'DM4340', 'DM4340', 'DM4310', 'DM4310', 'DM4310', 'DM3507'] + send_ids: [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08] + recv_ids: [0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18] + +# IF using POS_FORCE gripper, set to "POS_FORCE" +# If POS_FORCE mode is used, you can set force limits here. and control gains will be ignored. +# If MIT mode is used, control gains will be applied. +gripper_posforce: true +# This value will be used only if gripper_control_mode is "POS_FORCE" +# index 0: max rad/s index 1: max force (Nm) +gripper_posforce_limits: [50.0, 1.0] + +# Default PD control gains +control_gains: + kps: [230.0, 230.0, 190.0, 190.0, 30.0, 30.0, 30.0, 10.0] + kds: [2.7, 2.7, 2.2, 2.2, 1.5, 1.5, 1.5, 0.2] + # kps: [80.0, 80.0, 80.0, 80.0, 20.0, 20.0, 20.0, 10.0] + # kds: [2.7, 2.7, 2.2, 2.2, 1.5, 1.5, 1.5, 0.2] + +# Start configuration +start: + moves: + - name: "initial" + position: + right_arm: [0.0, 0.0, -0.0, 1.5707963267948966, 0.0, 0.0, 0.0, 0.0] + left_arm: [-0.0, 0.0, 0.0, 1.5707963267948966, 0.0, 0.0, 0.0, 0.0] + hz: 50 + duration: 2 + +# Stop configuration +stop: + moves: + - name: "initial" + position: + right_arm: [0.0, 0.0, -0.0, 1.5707963267948966, 0.0, 0.0, 0.0, 0.0] + left_arm: [-0.0, 0.0, 0.0, 1.5707963267948966, 0.0, 0.0, 0.0, 0.0] + hz: 50 + duration: 2