सॉफ्टवेयर सेटअप

Orca_core SDK इंस्टालेशन, USB ड्राइवर सेटअप, व्यक्तिगत फिंगर कंट्रोल API, ROS2 हैंड इंटरफ़ेस, स्पर्श सेंसर रीडिंग और MuJoCo सिमुलेशन। एक ताजा पायथन इंस्टाल से लेकर सभी 17 जोड़ों को हिलाने तक।

किसी अनुभाग पर जाएँ:

चरण 1 - एसडीके इंस्टालेशन

ओर्का_कोर एसडीके इंस्टालेशन

orca_core ओर्का हैंड के लिए आधिकारिक पायथन एसडीके है। यह पाइप के माध्यम से इंस्टॉल करने योग्य है और पायथन 3.9+ का समर्थन करता है। बुनियादी संयुक्त नियंत्रण के लिए किसी आरओएस की आवश्यकता नहीं है।

एक आभासी वातावरण बनाएँ

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

पिप के माध्यम से स्थापित करें

pip install orca-core

कविता के माध्यम से स्थापित करें (विकास के लिए अनुशंसित)

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 - फिंगर कंट्रोल एपीआई

व्यक्तिगत उंगली नियंत्रण

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()
चरण 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 हैंड इंटरफ़ेस

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]}'

समन्वित भुजा + हस्त प्रक्षेपण (ओपनआर्म के साथ)

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

यह दोनों को लॉन्च करता है openarm_ros2 आर्म ड्राइवर और orca_ros2 एकल नामस्थान के तहत हैंड ड्राइवर, MoveIt2 के माध्यम से समन्वित प्रक्षेपवक्र निष्पादन को सक्षम करता है।

चरण 5 - स्पर्श सेंसर

स्पर्श सेंसर पढ़ना

ओर्का हैंड वैकल्पिक रूप से उंगलियों के स्पर्श सेंसर (पैक्सिनी या संगत) को माउंट करता है। स्पर्शनीय डेटा एक अलग 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)
वैकल्पिक - सिमुलेशन

मुजोको सिमुलेशन

ओर्का हैंड कैलिब्रेटेड म्यूजोको एमजेसीएफ मॉडल के साथ आता है - बाएं हाथ, दाएं हाथ और एक द्वि-हाथ दृश्य। सिमुलेशन वास्तविक हार्डवेयर के साथ समान संयुक्त नाम और क्रिया स्थान साझा करता है।

सिमुलेशन स्थापित करें और चलाएं

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()
"

सिम-टू-रियल स्थानांतरण

एमजेसीएफ मॉडल में संयुक्त नाम मेल खाते हैं orca_core बिल्कुल एसडीके. ग्रैस्प प्रिमिटिव पर सिमुलेशन में प्रशिक्षित नीति को सीधे वास्तविक हार्डवेयर पर तैनात किया जा सकता है - एकमात्र अंतर यूएसबी सीरियल विलंबता (~ 3ms) बनाम भौतिकी चरण समय है।

समस्या निवारण

सामान्य मुद्दे

त्रुटि 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 ड्राइवर नोड लॉन्च हुआ लेकिन संयुक्त स्थिति प्रकाशित नहीं कर रहा है। आमतौर पर पोर्ट अनुमति समस्या या परस्पर विरोधी ऑर्का_कोर सत्र।

हल करना:

# 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 जोड़ चल रहे हों, तो अगला कदम कुशल हेरफेर एपिसोड रिकॉर्ड करना है।