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:
-
(Recommended) Install orca_core using pip:
infoWe are still uploading to PyPI. In the meantime please build from source!
pip install orca_core
-
(Optional) Build from source:
git clone git@github.com:orcahand/orca_core.git
cd orca_core
poetry install -
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
dangerMake sure to have the correct motors assigned to the joints in the
config.yaml
file -
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/Variable | Input Types | Output Types | Description |
---|---|---|---|
__init__ | orca_config: str = "orca_config.yaml" | None | Initializes the OrcaHand class. |
__del__ | None | None | Destructor to disconnect from the hand. |
connect | None | tuple[bool, str] | Connects to the hand with the DynamixelClient . |
disconnect | None | tuple[bool, str] | Disconnects from the hand. |
enable_torque | motor_ids: List[int] = None | None | Enables torque for the motors. |
disable_torque | motor_ids: List[int] = None | None | Disables torque for the motors. |
set_max_current | current: Union[float, List[float]] | None | Sets the maximum current for the motors. |
set_control_mode | mode: str , motor_ids: List[int] = None | None | Sets the control mode for the motors. |
get_motor_pos | None | np.ndarray | Gets the current motor positions in radians. |
get_motor_current | None | np.ndarray | Gets the current motor currents. |
get_motor_temp | None | np.ndarray | Gets the current motor temperatures. |
get_joint_pos | None | dict | Gets the current joint positions. |
set_joint_pos | joint_pos: dict | None | Sets the desired joint positions. |
init_joints | calibrate: bool = False | None | Initializes the joints and optionally calibrates the hand. |
calibrate | None | None | Calibrates the hand by moving the joints to their limits. |
_set_motor_pos | desired_pos: Union[dict, np.ndarray, list] , rel_to_current: bool = False | None | Sets the desired motor positions in radians. |
_motor_to_joint_pos | motor_pos: np.ndarray | dict | Converts motor positions into joint positions. |
_joint_to_motor_pos | joint_pos: dict | np.ndarray | Converts desired joint positions into motor commands. |
_sanity_check | None | None | Checks if the configuration is correct and the IDs are consistent. |
config_path | None | str | Path to the configuration file. |
calib_path | None | str | Path to the calibration file. |
baudrate | None | int | Baudrate for the Dynamixel communication. |
port | None | str | Port for the Dynamixel communication. |
max_current | None | int | Maximum current for the motors. |
control_mode | None | str | Control mode for the motors. |
calib_current | None | int | Calibration current for the motors. |
calib_step_size | None | float | Step size for calibration. |
calib_step_period | None | float | Step period for calibration. |
calib_threshold | None | float | Threshold for calibration. |
calib_num_stable | None | int | Number of stable steps for calibration. |
calib_sequence | None | Dict[str, Dict[str, str]] | Calibration sequence. |
calibrated | None | bool | Indicates if the hand is calibrated. |
motor_limits | None | Dict[int, List[float]] | Motor limits for calibration. |
joint_to_motor_ratios | None | Dict[int, float] | Ratios of joint to motor movements. |
motor_ids | None | List[int] | List of motor IDs. |
joint_ids | None | List[str] | List of joint IDs. |
joint_to_motor_map | None | Dict[str, int] | Mapping of joint names to motor IDs. |
motor_to_joint_map | None | Dict[int, str] | Mapping of motor IDs to joint names. |
joint_roms | None | Dict[str, List[float]] | Range of motion (ROM) for each joint. |
_dxl_client | None | DynamixelClient | Instance of the Dynamixel client. |
_motor_lock | None | RLock | Lock for motor operations. |