Skip to main content

ORCA Core

Abstracts hardware and control with simple high level control methods in joint space.

warning

This package is still under development and is not yet fully tested.

Get Started

To get started with orca_core, follow these steps:

  1. (Recommended) Install orca_core using pip:

    info

    We are still uploading to PyPI. In the meantime please build from source!

    pip install orca_core
  2. (Optional) Build from source:

    git clone git@github.com:orcahand/orca_core.git
    cd orca_core
    poetry install
  3. Download the orca_config.yaml file (e.g. orca_v1):

    curl -o orca_config.yaml https://raw.githubusercontent.com/orcahand/orca_models/main/orca_v1/orca_config.yaml
    danger

    Make sure to have the correct motors assigned to the joints in the config.yaml file

  4. Connect the hand and run the example usage:

    # Example usage
    from orca_core import OrcaHand

    hand = OrcaHand(orca_config="orca_config.yaml")
    status = hand.connect()
    print(status)
    hand.calibrate()

    # Set the desired joint positions to 0
    hand.set_joint_pos({joint: 0 for joint in hand.joint_ids})
    hand.disconnect()

Reference

Functions and Member Variables of OrcaHand

Function/VariableInput TypesOutput TypesDescription
__init__orca_config: str = "orca_config.yaml"NoneInitializes the OrcaHand class.
__del__NoneNoneDestructor to disconnect from the hand.
connectNonetuple[bool, str]Connects to the hand with the DynamixelClient.
disconnectNonetuple[bool, str]Disconnects from the hand.
enable_torquemotor_ids: List[int] = NoneNoneEnables torque for the motors.
disable_torquemotor_ids: List[int] = NoneNoneDisables torque for the motors.
set_max_currentcurrent: Union[float, List[float]]NoneSets the maximum current for the motors.
set_control_modemode: str, motor_ids: List[int] = NoneNoneSets the control mode for the motors.
get_motor_posNonenp.ndarrayGets the current motor positions in radians.
get_motor_currentNonenp.ndarrayGets the current motor currents.
get_motor_tempNonenp.ndarrayGets the current motor temperatures.
get_joint_posNonedictGets the current joint positions.
set_joint_posjoint_pos: dictNoneSets the desired joint positions.
init_jointscalibrate: bool = FalseNoneInitializes the joints and optionally calibrates the hand.
calibrateNoneNoneCalibrates the hand by moving the joints to their limits.
_set_motor_posdesired_pos: Union[dict, np.ndarray, list], rel_to_current: bool = FalseNoneSets the desired motor positions in radians.
_motor_to_joint_posmotor_pos: np.ndarraydictConverts motor positions into joint positions.
_joint_to_motor_posjoint_pos: dictnp.ndarrayConverts desired joint positions into motor commands.
_sanity_checkNoneNoneChecks if the configuration is correct and the IDs are consistent.
config_pathNonestrPath to the configuration file.
calib_pathNonestrPath to the calibration file.
baudrateNoneintBaudrate for the Dynamixel communication.
portNonestrPort for the Dynamixel communication.
max_currentNoneintMaximum current for the motors.
control_modeNonestrControl mode for the motors.
calib_currentNoneintCalibration current for the motors.
calib_step_sizeNonefloatStep size for calibration.
calib_step_periodNonefloatStep period for calibration.
calib_thresholdNonefloatThreshold for calibration.
calib_num_stableNoneintNumber of stable steps for calibration.
calib_sequenceNoneDict[str, Dict[str, str]]Calibration sequence.
calibratedNoneboolIndicates if the hand is calibrated.
motor_limitsNoneDict[int, List[float]]Motor limits for calibration.
joint_to_motor_ratiosNoneDict[int, float]Ratios of joint to motor movements.
motor_idsNoneList[int]List of motor IDs.
joint_idsNoneList[str]List of joint IDs.
joint_to_motor_mapNoneDict[str, int]Mapping of joint names to motor IDs.
motor_to_joint_mapNoneDict[int, str]Mapping of motor IDs to joint names.
joint_romsNoneDict[str, List[float]]Range of motion (ROM) for each joint.
_dxl_clientNoneDynamixelClientInstance of the Dynamixel client.
_motor_lockNoneRLockLock for motor operations.