Skip to main content

Motor Configuration

set_motor_cfg_pd()​

Python
set_motor_cfg_pd(
kp_config: Dict[str, list[float]],
kd_config: Dict[str, list[float]]
)

Configures PD mode gain parameters for specified joint groups. Typically set before entering UserCmd or UpperBodyUserCmd state to match the desired control stiffness.

ParameterTypeDescription
kp_configDict[str, list[float]]group name → proportional gain (Kp) list per joint
kd_configDict[str, list[float]]group name → derivative gain (Kd) list per joint

Each list length must match the number of joints in the corresponding group.

Example

Python
client.set_motor_cfg_pd(
kp_config={
"left_leg": [400, 200, 200, 400, 200, 26],
"right_leg": [400, 200, 200, 400, 200, 26],
"left_manipulator": [400, 200, 200, 200, 50, 50, 50],
"right_manipulator": [400, 200, 200, 200, 50, 50, 50],
},
kd_config={
"left_leg": [20, 20, 20, 20, 20, 2.6],
"right_leg": [20, 20, 20, 20, 20, 2.6],
"left_manipulator": [20, 10, 10, 10, 2.5, 2.5, 2.5],
"right_manipulator": [20, 10, 10, 10, 2.5, 2.5, 2.5],
},
)

set_motor_cfg_pos()​

Python
set_motor_cfg_pos(
kp_config: Dict[str, list[float]],
ki_config: Dict[str, list[float]],
kd_config: Dict[str, list[float]]
)

Configures position mode PID gain parameters for specified joint groups.

ParameterTypeDescription
kp_configDict[str, list[float]]group name → proportional gain (Kp) list per joint
ki_configDict[str, list[float]]group name → integral gain (Ki) list per joint
kd_configDict[str, list[float]]group name → derivative gain (Kd) list per joint

get_group_motor_cfg()​

Python
get_group_motor_cfg(group_name: str, key: str = 'pd_kp') -> list[float]

Reads the current motor configuration for a specified joint group.

ParameterTypeDescription
group_namestrJoint group name
keystrConfiguration item — see table below
key valueDescription
'pd_kp'PD mode proportional gain, default
'pd_kd'PD mode derivative gain
'pos_kp'Position mode proportional gain
'pos_ki'Position mode integral gain
'pos_kd'Position mode derivative gain

Example

Python
kp = client.get_group_motor_cfg("left_leg", key="pd_kp")
kd = client.get_group_motor_cfg("left_leg", key="pd_kd")
print(f"left_leg PD gains: kp={kp}, kd={kd}")