Stability Polygon and contacts

class stabilipy.StabilityPolygon(robotMass, dimension=3, gravity=-9.81, radius=2.0, force_lim=1.0, robust_sphere=-1, height=0.0)

Algorithm to compute stability polygon according to Bretl et al. “Testing static equilibrium of legged robots”. You need to first set some contacts and a robot mass Then call compute with desired precision. In 2D, computes a static stability polygon without discretizing cones. In 3D, computes a robust static stability polyhedron.

The default constructor to build a polygon/polyhedron.

Parameters:
  • robotMass – Mass of the robot
  • dimension (2,3) – Number of dimensions.
  • gravity (double) – Intensity of gravity given along upwards z-axis.
  • radius (double) – Radius of the CoM limitation constraint.
  • force_lim (double) – Maximum force, expressed as a factor of the robot’s weight.
  • robust_sphere (double) – Robust radius to be used with spherical criterion. Negative disables
  • height (double) – Height to be used when doing 2D robust
addCubeConstraint(origin, length)

Limit the CoM to | CoM - origin | < length

addDistConstraint(origin, radius)

Limit the CoM to || CoM - origin || < radius

addForceConstraint(contacts, limit)

Limit the sum of forces applied on contacts

addTorqueConstraint(contacts, point, ub, lb=None)

Add a limit on torque at a point over a set of contacts

clearConstraints()

Remove all constraints

make_problem()

Compute all matrices necessary to solving the problems. Only needs to be called once, because the problem shape never changes. This adds global dist constraint that should prevent CoM from going to infinity : ||com|| =< max. However, make sure you remove it between calls to compute or to set it to None when creating the polygon.

reset()

Remove all contacts, constraints and resets inner state

sample(p, plot_final=True, plot_step=False)

Test if a point is stable by iteratively refining the approximations

single_test(p)

Test if a single point is robust / non-robust without refining the approximations