Joint Group Control
set_group_cmd()
Python
set_group_cmd(
position_cmd: Dict[str, list[float]],
velocity_cmd: Dict[str, list[float]] | None = None,
torque_cmd: Dict[str, list[float]] | None = None
)
Sends position, velocity, and torque commands to one or more joint groups. position_cmd is required; the others are optional. Commands take effect immediately — interpolation is recommended to avoid sudden jumps.
| Parameter | Type | Description |
|---|---|---|
position_cmd | Dict[str, list[float]] | group name → target joint position list (rad) |
velocity_cmd | Dict[str, list[float]] | None | group name → target joint velocity list (rad/s) |
torque_cmd | Dict[str, list[float]] | None | group name → target joint torque list (Nm) |
Valid group names (depends on robot model; refer to hardware.json):
left_leg, right_leg, waist, head, left_manipulator, right_manipulator, left_endeffector (or left_end_effector), right_endeffector (or right_end_effector)
Example: upper-body control with interpolation
Python
init_pose = client.get_group_state("left_manipulator", key="position")
target_pose = [0.0, 0.0, 0.0, -1.2, 0.0, 0.0, 0.0]
steps = 200
for i in range(steps):
pose = [s + (t - s) * i / steps for s, t in zip(init_pose, target_pose)]
client.set_group_cmd({"left_manipulator": pose})
time.sleep(0.01)
get_group_state()
Python
get_group_state(group_name: str, key: str = 'position') -> list[float]
Reads the current state of a specified joint group.
| Parameter | Type | Description |
|---|---|---|
group_name | str | Joint group name |
key | str | Data type to return — see table below |
key value | Description |
|---|---|
'position' | Joint positions (rad), default |
'velocity' | Joint velocities (rad/s) |
'effort' | Joint torques (Nm) |
Example
Python
pos = client.get_group_state("left_leg", key="position")
vel = client.get_group_state("left_leg", key="velocity")
get_group_motion_state()
Python
get_group_motion_state(group_name: str) -> int
Reads the current motion state of a specified joint group.
| Return value | Description |
|---|---|
0 | Idle |
1 | Moving |
2 | Stopping |
3 | Error |
Example
Python
while client.get_group_motion_state("left_manipulator") == 1:
time.sleep(0.01)
print("Motion complete")