Human-robot load sharing

Human skeleton and Panda robot lifting a box, with their force polytopes at the hand

A human and a Panda robot lift a box together. The human should stay below 30 % of their maximal muscle forces (MOBL-ARMS model, biorbd), the robot within its joint torques, and the robot should help as little as possible. Both force polytopes (pycapacity.human.force_polytope(), pycapacity.robot.force_polytope()) go into one QP:

\[\min_{f_h, f_r} ~\|f_r\|^2 \quad \text{s.t.} \quad f_h + f_r = f_{box}, \quad H_h f_h \leq d_h, \quad H_r f_r \leq d_r\]

The human lifts boxes up to 5 kg alone; from 10 kg the robot helps, and at 50 kg the two together cannot hold the box. In the animation, the human raises a 15 kg box by 30 cm and lowers it again, the robot following the hand: the human’s force polytope changes with the posture of the arm, and the robot gives 30 N when the arm is high and up to 48 N when it is low.

python examples/control/human_robot_load_sharing.py   # run from the folder containing pyomeca_models

Minimal version, with two random arms instead of the human and the Panda, examples/control/minimal/load_sharing.py:

# Minimal: a human and a robot hold a box; the robot helps as little as possible
import numpy as np
from qpsolvers import solve_qp
from pycapacity.robot import force_polytope

np.random.seed(0)
# two force polytopes  H f <= d  (here two random arms; in the example: pycapacity.human.force_polytope for the human)
P_h = force_polytope(np.random.randn(3, 7), np.full(7, 20.0), -np.full(7, 20.0))
P_r = force_polytope(np.random.randn(3, 7), np.full(7, 50.0), -np.full(7, 50.0))
P_h.find_halfplanes()
P_r.find_halfplanes()

f_box = np.array([0, 0, 3 * 9.81])                     # a 3 kg box
# QP in (f_h, f_r):  min ||f_r||^2   s.t.   f_h + f_r = f_box,   H_h f_h <= d_h,   H_r f_r <= d_r
P = np.diag([1e-6] * 3 + [1.0] * 3)
A = np.hstack([np.eye(3), np.eye(3)])
G = np.block([[P_h.H, np.zeros((len(P_h.H), 3))], [np.zeros((len(P_r.H), 3)), P_r.H]])
h = np.r_[P_h.d.ravel(), P_r.d.ravel()]
f = solve_qp(P, np.zeros(6), G, h, A, f_box, solver="proxqp")
print("human", f[:3].round(1), "N, robot", f[3:].round(1), "N")