Настройка программного обеспечения
Установка orca_core SDK, настройка USB-драйвера, API индивидуального управления пальцами, ручной интерфейс ROS2, считывание тактильных датчиков и моделирование MuJoCo. От новой установки Python до перемещения всех 17 суставов.
Перейти в раздел:
Установка orca_core SDK
orca_core — официальный Python SDK для Orca Hand. Он устанавливается через pip и поддерживает Python 3.9+. Для базового совместного контроля не требуется ROS.
Создайте виртуальную среду
python -m venv ~/.venvs/orca
source ~/.venvs/orca/bin/activate # Windows: .venvs\orca\Scripts\activate
Установить через пип
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)
"
Индивидуальное управление пальцами
The 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()
Встроенные примитивы Grasp
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
The 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 Hand Driver в едином пространстве имен, что позволяет скоординировать выполнение траектории с помощью 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)
Симуляторы 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-to-real
Имена суставов в модели MJCF соответствуют orca_core СДК точно. Политика, обученная моделированию примитивов захвата, может быть развернута непосредственно на реальном оборудовании — единственная разница — это задержка последовательного порта USB (~ 3 мс) и время физического шага.
Общие проблемы
Обычно кабель шлейфового подключения не полностью входит в место соединения между пальчиковыми модулями. Шина 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