ソフトウェアのセットアップ

orca_core SDK のインストール、USB ドライバーのセットアップ、個別の指制御 API、ROS2 ハンド インターフェイス、触覚センサーの読み取り、および MuJoCo シミュレーション。 Python の新規インストールから 17 個のジョイントすべての動作まで。

セクションにジャンプします:

ステップ 1 — SDK のインストール

orca_core SDK のインストール

orca_core Orca Hand の公式 Python SDK です。 pip 経由でインストールでき、Python 3.9 以降をサポートします。 基本的なジョイント制御には ROS は必要ありません。

仮想環境を作成する

python -m venv ~/.venvs/orca
source ~/.venvs/orca/bin/activate   # Windows: .venvs\orca\Scripts\activate

pip経由でインストール

pip install orca-core

Poetry 経由でインストール (開発に推奨)

git clone https://github.com/orcahand/orca_core.git
cd orca_core
poetry install

インストールを確認して最適なツールを見つけてください

python -c "from orca_core import OrcaHand; print('orca_core installed OK')"

# Find the USB serial port
python -c "
from orca_core import OrcaHand
# Lists available ports
import serial.tools.list_ports
ports = list(serial.tools.list_ports.comports())
for p in ports:
    print(p)
"
ステップ 2 — フィンガーコントロール API

個別のフィンガーコントロール

OrcaHand クラスは、名前付きのフィンガーおよびジョイント アクセサーを介して 17 個のジョイントすべてを公開します。 制御モードのデフォルトは current_based_position.

すべての関節位置を接続して読み取ります

from orca_core import OrcaHand

hand = OrcaHand(port="/dev/ttyUSB0", handedness="right")
hand.connect()

# Read all joint positions (returns dict of joint_name: position_deg)
positions = hand.get_positions()
print(positions)
# e.g. {'thumb_abduct': 0.0, 'thumb_mcp': 15.2, ...}

hand.disconnect()

個々の関節を動かす

from orca_core import OrcaHand
import time

hand = OrcaHand(port="/dev/ttyUSB0", handedness="right")
hand.connect()
hand.enable_all()

# Move thumb MCP joint to 45 degrees
hand.set_position("thumb_mcp", 45.0)
time.sleep(0.5)

# Move index finger MCP to 60 degrees
hand.set_position("index_mcp", 60.0)
time.sleep(0.5)

# Open all fingers
hand.open_all()
time.sleep(1.0)

hand.disable_all()
hand.disconnect()

複数の関節を同時に設定する

from orca_core import OrcaHand

hand = OrcaHand(port="/dev/ttyUSB0", handedness="right")
hand.connect()
hand.enable_all()

# Command all 17 joints at once (dict of joint_name: target_deg)
pose = {
    "thumb_abduct": 30.0,
    "thumb_mcp":    45.0,
    "thumb_pip":    30.0,
    "thumb_dip":    20.0,
    "index_mcp":    70.0,
    "index_pip":    60.0,
    "index_dip":    40.0,
    # ... remaining joints
}
hand.set_positions(pose)

hand.disable_all()
hand.disconnect()
ステップ 3 — プリミティブを把握する

組み込みの把握プリミティブ

orca_core 一般的な操作タスク用に調整された把握プリミティブが付属しています。 これらは、カスタム ポリシーを実装する前に、基本的な把握をテストする最も速い方法です。

把握プリミティブの使用

from orca_core import OrcaHand
from orca_core.grasps import GraspLibrary
import time

hand = OrcaHand(port="/dev/ttyUSB0", handedness="right")
hand.connect()
hand.enable_all()
grasps = GraspLibrary()

# Open hand
hand.execute_grasp(grasps.open)
time.sleep(1.0)

# Power grasp (whole-hand wrap)
hand.execute_grasp(grasps.power_grasp)
time.sleep(1.0)

# Precision pinch (thumb + index tip)
hand.execute_grasp(grasps.precision_pinch)
time.sleep(1.0)

# Tripod grasp (thumb + index + middle)
hand.execute_grasp(grasps.tripod)
time.sleep(1.0)

# Lateral pinch (thumb side against index lateral)
hand.execute_grasp(grasps.lateral_pinch)
time.sleep(1.0)

hand.open_all()
hand.disable_all()
hand.disconnect()

グリップ間を補間する

from orca_core import OrcaHand
from orca_core.grasps import GraspLibrary
import time, numpy as np

hand = OrcaHand(port="/dev/ttyUSB0", handedness="right")
hand.connect()
hand.enable_all()
grasps = GraspLibrary()

# Smoothly interpolate from open to power grasp over 30 steps
for alpha in np.linspace(0, 1, 30):
    pose = grasps.interpolate(grasps.open, grasps.power_grasp, alpha)
    hand.set_positions(pose)
    time.sleep(0.05)

hand.disable_all()
hand.disconnect()
ステップ 4 — ROS2 の統合

ROS2ハンドインターフェース

orca_ros2 パッケージは、アームとハンドを調整して制御するための完全な ROS2 インターフェイスを提供します。 ジョイントの状態を公開し、ジョイント軌道コマンドを受け入れます。

orca_ros2 をインストールする

mkdir -p ~/orca_ws/src && cd ~/orca_ws/src
git clone https://github.com/orcahand/orca_ros2.git
cd ~/orca_ws
source /opt/ros/humble/setup.bash
colcon build --symlink-install

ハンドドライバーノードを起動する

source ~/orca_ws/install/setup.bash
ros2 launch orca_ros2 orca_hand.launch.py \
  port:=/dev/ttyUSB0 \
  handedness:=right

共同状態トピックを購読する

ros2 topic echo /orca_hand/joint_states

関節位置コマンドの送信

ros2 topic pub /orca_hand/joint_command \
  sensor_msgs/msg/JointState \
  '{name: ["index_mcp", "index_pip"], position: [1.22, 1.05]}'

アーム + ハンドランチの連携 (OpenArm を使用)

ros2 launch orca_ros2 openarm_orca.launch.py \
  arm_can_interface:=can0 \
  hand_port:=/dev/ttyUSB0 \
  handedness:=right

これにより、両方の openarm_ros2 アームドライバーと orca_ros2 単一の名前空間の下にあるハンド ドライバーにより、MoveIt2 を介して調整された軌道の実行が可能になります。

ステップ 5 — 触覚センサー

触覚センサーの読み取り

Orca Hand には、オプションで指先触覚センサー (Paxini または互換品) が取り付けられます。 触覚データは、別の USB 接続を介して独立してストリーミングされます。

指先接触力の読み取り

from orca_core import OrcaHand
from orca_core.sensors import TactileSensorArray

hand = OrcaHand(port="/dev/ttyUSB0", handedness="right")
tactile = TactileSensorArray(port="/dev/ttyUSB1")  # separate USB port

hand.connect()
tactile.connect()
hand.enable_all()

import time
for _ in range(100):
    # Returns dict of finger_name: contact_force_N
    forces = tactile.read_forces()
    positions = hand.get_positions()
    print(f"Index force: {forces.get('index', 0):.3f} N | "
          f"Index MCP: {positions['index_mcp']:.1f} deg")
    time.sleep(0.01)

hand.disable_all()
hand.disconnect()
tactile.disconnect()

接触検知閾値

from orca_core.sensors import TactileSensorArray

tactile = TactileSensorArray(port="/dev/ttyUSB1")
tactile.connect()

# Set contact detection threshold per finger (in N)
tactile.set_threshold(finger="index", threshold_n=0.1)
tactile.set_threshold(finger="thumb", threshold_n=0.15)

# Returns True when contact exceeds threshold
in_contact = tactile.is_in_contact("index")
print("Index in contact:", in_contact)
オプション - シミュレーション

MuJoCoシミュレーション

Orca Hand には、調整済みの MuJoCo MJCF モデル (左手、右手、および両手シーン) が同梱されています。 シミュレーションは、実際のハードウェアと同一のジョイント名とアクション スペースを共有します。

シミュレーションをインストールして実行する

pip install mujoco
pip install orca-core[sim]  # or: pip install orca-mujoco

# Clone the MuJoCo model package
git clone https://github.com/orcahand/orcahand_description.git

# Launch the right-hand sim
python -c "
import mujoco, mujoco.viewer
import numpy as np

model = mujoco.MjModel.from_xml_path('orcahand_description/mjcf/orca_right.xml')
data = mujoco.MjData(model)

with mujoco.viewer.launch_passive(model, data) as viewer:
    while viewer.is_running():
        mujoco.mj_step(model, data)
        viewer.sync()
"

Sim から Real への転送

MJCF モデルのジョイント名は、 orca_core まさにSDK。 把握プリミティブのシミュレーションでトレーニングされたポリシーは、実際のハードウェアに直接展開できます。唯一の違いは、USB シリアル レイテンシ (~3ms) と物理ステップ タイミングです。

トラブルシューティング

よくある問題

エラー1 一部の指が反応しない - 部分的なサーボ スキャン

通常、デイジーチェーン ケーブルはフィンガー モジュール間の接合部に完全に装着されていません。 STS バスはチェーンであり、1 つの接続不良により下流のすべてのサーボが切断されます。

修理:

# Scan to see which servo IDs are found
python -c "
from orca_core import OrcaHand
hand = OrcaHand(port='/dev/ttyUSB0', handedness='right')
hand.connect()
ids = hand.scan_motors()
print('Found IDs:', ids)  # should be 1..17
hand.disconnect()
"
エラー2 指が厳しい限界に達している - 腱の過緊張

指を完全に伸ばしたり曲げたりすることはできません。 片側の腱のルーティングがきつすぎる。 再組み立て後に最もよく発生します。

修理:

# Check joint limits — move each joint to its range manually
python -c "
from orca_core import OrcaHand
hand = OrcaHand(port='/dev/ttyUSB0')
hand.connect()
# Enable compliance mode — move finger by hand to feel the limits
hand.set_compliance_mode(finger='index', enabled=True)
"
# If finger hits hard limit below expected range,
# loosen the extensor tendon by 0.5 turns at the tendon anchor
エラー3 ROS2 Joint_states トピックが公開されない

orca_ros2 ドライバー ノードが起動されましたが、ジョイント状態が公開されていません。 通常は、ポート権限の問題、または orca_core セッションの競合です。

修理:

# 1. Ensure no other orca_core session has the port open
# Close any Python scripts using the hand first

# 2. Add USB serial permissions (Linux)
sudo usermod -aG dialout $USER  # log out and back in

# 3. Re-launch with explicit port
ros2 launch orca_ros2 orca_hand.launch.py port:=/dev/ttyUSB0

# 4. Check topic
ros2 topic hz /orca_hand/joint_states   # should be ~100 Hz

ソフトウェアは動作していますか? データの収集を開始します。

17 個すべての関節が動くようになったら、次のステップは器用な操作エピソードを記録することです。