HumansXDocumentation Center 日本語Website ↗

Effort and MIT Parameters

SDK Reference

The device runs in MIT control mode by default — the control mode isn’t set from the Python API.

effort_limit (SET/GET)

Effort limit: read / write the per-joint torque cap (A).

hand.effort_limit().set(1.5) # set all joints to 1.5 A
limits = hand.effort_limit().get() # → list[Optional[float]]

Writes reject NaN, Inf, negative values, and values above the device ceiling — whole-hand and per-joint writes validate the same way. A rejected write fails with an error and leaves the current value unchanged. The firmware sets the ceiling. For common errors and remedies, see Script Throws an Exception.

mit_params (SET/GET)

MIT impedance parameters: read / write per-joint kp / kd.

hand.mit_params().set((1.0, 0.05)) # same kp / kd for all joints
hand.mit_params().set([(1.0, 0.05)] * 20) # list of 20, per joint
mp = hand.mit_params().get() # → list[Optional[MitParam]]; offline joints are None

Writes reject NaN, Inf, and negative values.

After connecting, Wuji SDK reads back the kp / kd of all 20 joints once and writes one info-level line to the SDK log. You don’t need to call an API. The log lists joints with {finger}/S{1..4} labels, such as thumb/S1 through pinky/S4. These labels correspond to the SDK joint labels {finger}_S{1..4}. An offline joint is logged as offline.

The logged values are the ones in effect on the device at connection time. If the readback fails, the SDK writes one warn-level line, and the connection completes as usual. When you troubleshoot control response or unexpected joint behavior, check this line first. For log levels and the log file location, see SDK Log Level.

User Origin

Calibrate the current physical position as the joint-side zero. If a joint is moving, it takes effect at the next IDLE.

hand.set_origin() # whole hand: refresh the user origin of all joints
hand.clear_origin() # whole hand: clear the user origin of all joints
hand.set_origin(joints=mask) # optional: 0/1 mask of length 20 — only joints with a 1 are affected

Data Types

MitParam

MIT parameters: element of mit_params().get().

class MitParam:
    kp: float
    kd: float

set accepts a single (kp, kd) (applied to all joints) or a list of 20 (per joint). get returns 20 entries — offline joints are None.

  • Python

  • C

Python: See the Python API examples earlier on this page.

The C API matches the Python API on this page and uses the wuji_hand_2_ prefix. For initialization conventions, memory management, error codes, and build setup, see the C API Reference.

MIT Params and Effort Limit (With Online Bitmap)

Whole-hand configuration writes support both a uniform value and per-joint arrays:

// Uniform effort_limit = 1.5 A
wuji_hand_2_set_all_effort_limit(dev, 1.5f);

// Per-joint write (flat-20, finger-major)
float limits[20] = { /* ... */ };
wuji_hand_2_set_all_effort_limit_per_joint(dev, limits);

float kp[20] = { /* ... */ }, kd[20] = { /* ... */ };
wuji_hand_2_set_all_mit_params(dev, kp, kd);

Reads return a flat-20 array plus an online bitmap. Offline joint slots are zero (or NaN for mit_params):

float read_back[20];
uint32_t online = 0;
wuji_hand_2_get_all_effort_limit(dev, read_back, &online);
for (int i = 0; i < 20; i++) {
    if (WUJI_JOINT_ONLINE(online, i)) {
        printf("joint %d: limit=%.2fA\n", i, read_back[i]);
    }
}

Writes reject NaN / infinity / negative values with WUJI_STATUS_ERR_INVALID_ARG. Filter invalid values before writing.