# An iterative Convex Hull Method

## On-line feasible wrench polytope evaluation based on human musculoskeletal models

### by Antun Skuric, Vincent Padois, Nasser Rezzoug, David Daney

#### Published in IEEE ICRA2022 & IEEE RA-L 2022

Iterative convex hull is a polytope evaluation algorithm developed for the generic class of the linear algebra problems: $$A\bm{x} = B\bm{y},\qquad \bm{y} \in [\bm{y} _{min}, \bm{y} _{max}]$$

This type of problems can be found in many different domains, one of them being the wrench capacity analysis of the human musculoskeletal models. In this paper the method overview is given as well as the verified on the assistive robotics scenario.

## Paper Abstract

Many recent human-robot collaboration strategies, such as Assist-As-Needed (AAN), are promoting humancentered robot control, where the robot continuously adapts its assistance level based on the real-time need of its human counterpart. One of the fundamental assumptions of these approaches is the ability to measure or estimate the physical capacity of humans in real-time. In this work, we propose an algorithm for the feasibility set analysis of a generic class of linear algebra problems. This novel iterative convex-hull method is applied to the determination of the feasible Cartesian wrench polytope associated to a musculoskeletal model of the human upper limb. The method is capable of running in real-time and allows the user to define the desired estimation accuracy. The algorithm performance analysis shows that the execution time has near-linear relationship to the considered number of muscles, as opposed to the exponential relationship of the conventional methods. Finally, real-time robot control application of the algorithm is demonstrated in a Collaborative carrying experiment, where a human operator and a Franka Emika Panda robot jointly carry a 7kg object. The robot is controlled in accordance to the AAN paradigm maintaining the load carried by the human operator at 30% of its carrying capacity.

## Getting started

Matlab and python code and more documentation about practical implementation of this method can be found on our gitlab.

Additionally the full algorithm has been implemented in the python pip package pycapacity which enables calculating different task-space capacity metrics for robots and human manipulators in real-time.

 1 pip install pycapacity

## Example code

Example code for randomised 30 muscle human musculoskeltal model

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 """ A simple example program for 3d force polytope evaluation of a randomised 30 muscle 7dof human musculoskeletal model """ import pycapacity.human as capacity # robot capacity module import numpy as np import time L = 30 # number of muscles m = 3 # 3d forces n = 6 # number of joints - dof J = np.array(np.random.rand(m,n))*2-1 # random jacobian matrix N = np.array(np.random.rand(n,L))*2-1 # random moment arm matrix F_max = 100*np.ones(L) # muscle forces limits max and min F_min = np.zeros(L) start = time.time() vertices, H,d, face_indexes = capacity.force_polytope(J,N, F_min, F_max, 0.1) # calculate the polytope vertices and faces faces = capacity.face_index_to_vertex(vertices, face_indexes) print("Precision: {} N, time {}, number of vertices {}".format(0.1, time.time()-start, len(vertices.T))) start = time.time() vertices1, H1,d1, face_indexes1 = capacity.force_polytope(J,N, F_min, F_max, 100) # calculate the polytope vertices and faces faces1 = capacity.face_index_to_vertex(vertices1, face_indexes1) print("Precision: {} N, time {}, number of vertices {}".format(100, time.time()-start, len(vertices1.T))) # plotting the polytope import matplotlib.pyplot as plt from pycapacity.visual import plot_polytope_faces, plot_polytope_vertex # pycapacity visualisation tools fig = plt.figure(4) # draw faces and vertices ax = plot_polytope_faces(plt=plt, faces=faces, face_color='blue', edge_color='blue', label='$\delta$=0.1', alpha=0.15) plot_polytope_vertex(ax=ax, vertex=vertices1, color='red') plot_polytope_faces(ax=ax, faces=faces1, face_color='red', edge_color='red',label='$\delta$=10', alpha=0.2) plt.tight_layout() plt.legend() plt.show()

The code output will be something similar to:

 1 2 Precision: 0.1 N, time 3.02033996582, number of vertices 1695 Precision: 100 N, time 0.0223658084869, number of vertices 18

And when executed you’ll be able to see the 3D plot of the plot of two polytopes calculated witht the iterative convex hull method for two different precision values.