소프트웨어 설정
orca_core SDK 설치, USB 드라이버 설정, 개별 손가락 제어 API, ROS2 핸드 인터페이스, 촉각 센서 판독 및 MuJoCo 시뮬레이션. 새로운 Python 설치부터 17개 관절 모두 이동까지.
섹션으로 이동:
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)
"
개별 손가락 제어
그만큼 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()
내장 파악 프리미티브
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()
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를 통해 조정된 궤적 실행이 가능합니다.
촉각 센서 판독
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)
무조코 시뮬레이션
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()
"
시뮬레이션에서 실제로의 전송
MJCF 모델의 공동 이름은 다음과 일치합니다. orca_core SDK가 맞습니다. 파악 기본 요소에 대한 시뮬레이션으로 훈련된 정책은 실제 하드웨어에 직접 배포될 수 있습니다. 유일한 차이점은 USB 직렬 대기 시간(~3ms)과 물리 단계 타이밍입니다.
일반적인 문제
일반적으로 데이지 체인 케이블은 핑거 모듈 사이의 접합부에 완전히 장착되지 않습니다. STS 버스는 체인입니다. 연결이 잘못되면 모든 다운스트림 서보가 중단됩니다.
고치다:
# 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()
"
손가락이 완전히 펴지거나 구부러지지 않습니다. 힘줄 라우팅이 한쪽에서 너무 빡빡합니다. 재조립 후에 가장 흔히 발생합니다.
고치다:
# 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
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