Skip to main content
mit_params adjusts MIT impedance-control stiffness and damping, not the position control loop. effort_limit applies in MIT, MIT_V2, and Position control mode. For mode switching, see Whole-Hand Control Mode.

effort_limit (SET/GET)

Effort limit: read or write per-joint limits. Deprecated MIT uses effort limits (A). MIT_V2 and Position mode use joint-side torque (N·m) and share the same limit. Read the current mode before choosing a value. The following examples show the deprecated MIT effort limit (A) for existing applications. For new MIT_V2 code, use the migration procedure.
The SDK validates all inputs before sending. Any NaN, infinity, or negative value rejects the entire request without writing to the device.
  • Deprecated MIT: each joint rejects an above-ceiling value and keeps its previous limit. Other joints in a whole-hand request may still accept their values. The call reports an error, with WUJI_STATUS_ERR_INTERNAL in C. Read back the limits after an error rather than assuming a whole-hand rollback.
  • MIT_V2 and Position mode: firmware clamps above-ceiling values, and reads return the effective limits. Ceilings differ by joint. To adjust them, read the current values in this mode and scale each joint’s value.
For a NaN slot from get(), Python returns None, and C clears the corresponding validity bit. This doesn’t necessarily mean the joint is offline. Don’t write the slot back. Invalid joint_states.effort feedback is separate. See Joint State Fields. MIT_V2 and Position share torque limits. Exiting an example, disabling, or disconnecting doesn’t restore the previous values. Values already written aren’t rolled back if configuration fails. To restore previous limits, disable the joints, write the saved values, and read them back to verify. For mode switching and limit restoration, see Control Modes and Effort Limits. For common errors and remedies, see Script Throws an Exception. Thermal derating lowers the actual total current ceiling without changing the configured effort_limit value or its readback. For thresholds and recovery, see Thermal Protection.

mit_params (SET/GET)

MIT impedance parameters: read / write per-joint kp / kd. Select the mode before writing gains. In MIT_V2, kp uses N·m/rad and kd uses N·m·s/rad. These gains are independent of deprecated MIT. Values must be finite and nonnegative. For configuration and restart handling, see the migration procedure.
Writes reject NaN, infinity, and negative values. After connecting, the SDK reads back all 20 joints’ kp / kd and writes one info-level log line (joints labeled {finger}/S{1..4}, offline joints as offline). On failure it logs a warn and the connection continues. Check this line first when troubleshooting control response. For log levels and location, see SDK Log Level.

Asynchronous Writes

The synchronous set() waits for the device reply and releases the Python GIL while waiting. Use set_async() when other tasks in the event loop must continue:
set_async() checks the arguments and submits an asynchronous write when called. Invalid arguments raise an exception immediately. Await the returned Future directly to get the write result or an exception. Don’t pass it to asyncio.create_task(). The write continues even if you don’t await it, and write failures are recorded in the SDK log. Call set_async() from a running asyncio event loop. Otherwise, it raises RuntimeError. Use set() in synchronous code. To avoid blocking the calling thread, run set() in a separate thread. In C, use wuji_hand_2_set_all_mit_params_async(dev, kp, kd) for asynchronous writes. Arguments and validation follow the synchronous interface. Invalid arguments immediately return WUJI_STATUS_ERR_INVALID_ARG without writing. WUJI_STATUS_OK means the asynchronous write request was accepted, not applied by the device. When Python or C submits asynchronous writes on the same device connection, only the latest parameters submitted while a write is running are retained for the next write. Replaced parameters aren’t written to the device. In Python, a replaced call’s Future resolves with the result of the write that replaces it. If every set of parameters must be written, await the previous Future before calling again in Python, or use the synchronous C interface. The order of asynchronous writes relative to other calls on the device can vary. A C asynchronous write failure is recorded only in the SDK log, not through wuji_last_error(). Use the synchronous C interface when you need the write result before enabling or making another change.

User Origin

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

Data Types

MitParam

MIT parameters: element of mit_params().get().
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.