The ApexHand Python SDK uses a set of enums and structured types to represent hardware entities and parameters.
Knowing these types makes your code safer and more readable.
All of them are exported from the native _dexcelbot_sdk module and re‑exposed by dexcelbot_apexhand_sdk.py, so you can inspect them directly in Python.
LogLevelLogging level enum (documented here for completeness; in the current Python wrapper the level is fixed to INFO internally):
LOG_LEVEL_DEBUGLOG_LEVEL_INFOLOG_LEVEL_WARNLOG_LEVEL_ERRORLOG_LEVEL_FATAL
set_log_path()always uses INFO internally; user code cannot change the log level.
ConnectionTypeCONNECTION_TYPE_RS485: RS485 serial connectionCONNECTION_TYPE_ETHERNET: Ethernet connectionUsed by DexcelBot.connect(address, connection_type).
ErrorCodeAll SDK functions that can fail return ErrorCode:
ERROR_CODE_OK: successERROR_CODE_COMM_ERROR: communication errorERROR_CODE_TIMEOUT: timeoutERROR_CODE_OUT_OF_RANGE: parameter out of allowed rangeERROR_CODE_OTHER_ERROR: any other errorYou should always check the return value for safety‑critical operations:
result = bot.move_joint(cmds)
if result != ErrorCode.ERROR_CODE_OK:
print("move_joint failed:", result)
FingerIdFinger indices:
FINGER_ID_THUMBFINGER_ID_INDEXFINGER_ID_MIDDLEFINGER_ID_RINGFINGER_ID_PINKYUsed by:
set_finger_enabled(fingers: List[FingerId])set_finger_disabled(fingers: List[FingerId])MaxFingerTorque.finger_idMotorIdMotor indices (16 total), grouped by finger, e.g.:
MOTOR_ID_THUMB_CMC_0, MOTOR_ID_THUMB_CMC_1, MOTOR_ID_THUMB_CMC_2, MOTOR_ID_THUMB_MCPMOTOR_ID_INDEX_MCP_0, MOTOR_ID_INDEX_MCP_1, MOTOR_ID_INDEX_PIPMOTOR_ID_MIDDLE_MCP_0, MOTOR_ID_MIDDLE_MCP_1, MOTOR_ID_MIDDLE_PIPMOTOR_ID_RING_MCP_0, MOTOR_ID_RING_MCP_1, MOTOR_ID_RING_PIPMOTOR_ID_PINKY_MCP_0, MOTOR_ID_PINKY_MCP_1, MOTOR_ID_PINKY_PIPUsed by MotorState.motor_id.
JointIdJoint indices (21 total), such as:
JOINT_ID_THUMB_CMC_0, JOINT_ID_THUMB_CMC_1, JOINT_ID_THUMB_CMC_2, JOINT_ID_THUMB_MCP, JOINT_ID_THUMB_IPJOINT_ID_INDEX_MCP_0, JOINT_ID_INDEX_MCP_1, JOINT_ID_INDEX_PIP, JOINT_ID_INDEX_DIPJOINT_ID_MIDDLE_MCP_0, JOINT_ID_MIDDLE_MCP_1, JOINT_ID_MIDDLE_PIP, JOINT_ID_MIDDLE_DIPJOINT_ID_RING_MCP_0, JOINT_ID_RING_MCP_1, JOINT_ID_RING_PIP, JOINT_ID_RING_DIPJOINT_ID_PINKY_MCP_0, JOINT_ID_PINKY_MCP_1, JOINT_ID_PINKY_PIP, JOINT_ID_PINKY_DIPUsed by:
JointState.joint_idJointControlParam.joint_idMoveJPositionFollowParam.idMaxJointSpeed.joint_idMaxJointAccel.joint_idVersionInfotouch_sensor_version: touch sensor firmware versionhand_firmware_version: hand firmware versionsdk_version: SDK library versionReturned by get_version_info():
info = bot.get_version_info()
print(info.touch_sensor_version, info.hand_firmware_version, info.sdk_version)
ParamInfomax_speed: List[float]: per‑joint max speed (rad/s)max_accel: List[float]: per‑joint max acceleration (rad/s²)max_current: List[float]: per‑finger max current/torque (%)Returned by get_parameters().
JointState & JointStatesJointState:
joint_id: JointIdposition: float (rad)velocity: float (rad/s)acceleration: float (rad/s²)JointStates:
timestampjoint_states: List[JointState]Used by get_joint_states() and joint state callbacks:
def on_joint_states(states):
print("timestamp:", states.timestamp)
for js in states.joint_states:
print(js.joint_id, js.position)
bot.register_joint_states_callback(on_joint_states, freq_hz=100)
JointControlParamjoint_id: JointIdposition: float target position (rad)velocity: float target velocity (rad/s)acceleration: float target acceleration (rad/s²)Best created with the helper:
from dexcelbot_apexhand_sdk import JointId, create_joint_control_param
cmd = create_joint_control_param(
joint_id=JointId.JOINT_ID_THUMB_MCP,
position=0.5,
velocity=0.2,
acceleration=0.0,
)
MoveJPositionFollowParamFor follow control:
id: JointIdposition: float target position (rad)Used with move_j_position_follow() for smooth trajectories.
MotorState & MotorStatesMotorState:
motor_id: MotorIdtemperature: floatcurrent: floatMotorStates:
timestampmotors: List[MotorState]Returned by get_motor_states() and used in motor state callbacks.
MaxJointSpeedjoint_id: JointIdspeed: float max speed (rad/s)from dexcelbot_apexhand_sdk import MaxJointSpeed, JointId
limits = []
for jid in JointId:
s = MaxJointSpeed()
s.joint_id = jid
s.speed = 1.0
limits.append(s)
bot.set_max_joint_speed(limits)
MaxJointAcceljoint_id: JointIdaccel: float max acceleration (rad/s²)Configured via set_max_joint_accel() in the same pattern as MaxJointSpeed.
MaxFingerTorquefinger_id: FingerIdtorque: float max torque (0–100%)from dexcelbot_apexhand_sdk import MaxFingerTorque, FingerId
torques = []
for fid in FingerId:
t = MaxFingerTorque()
t.finger_id = fid
t.torque = 80.0 # limit to 80%
torques.append(t)
bot.set_max_finger_torque(torques)
With these enums and structures in mind, you will find the motion, sensing and callback APIs in the next sections much easier to read and use.