Skip to content

Vibration occurs when self collision constraint enabled #7

@yanghanjiang

Description

@yanghanjiang

Environment:

  • placo version: 0.6.2
  • placo installation type: installed from source
  • python version: 3.8.10
  • eigen version: 3.4.0
  • OS version: ubuntu 20.04

Issue Details:
I'm trying to control a humanoid's upper body motion using PlaCo. To avoid self-collisions between the arms, I enabled the self-collision constraint. However, vibrations occur when the arms get close enough to trigger the self-collision constraint. When this happens, the joint accelerations show significant fluctuations, as depicted below:
screenshot-20240828-204824

In order to suppress these vibrations, I implemented acceleration limits based on velocity limits which already available in KinematicsSolver. Below are the code details:

  if (acceleration_limits)
  {
    problem.add_constraint(qd->expr(6) <= (dt * Eigen::VectorXd::Ones(N - 6) * 100.0 + robot.state.qd.bottomRows(N - 6)) * dt);
    problem.add_constraint((-dt * Eigen::VectorXd::Ones(N - 6) * 100.0 + robot.state.qd.bottomRows(N - 6)) * dt <= qd->expr(6));
  }

Math principle:

$$\frac{\left(\frac{\delta q}{dt}-v_{last}\right)}{dt} < a_u$$

$$\frac{\left(\frac{\delta q}{dt}-v_{last}\right)}{dt} > -a_u$$

It seems acceleration limits make effective, as the accelerations are clamped to 100.0.
screenshot-20240828-213020

However, an error occurs when I attempt to reduce the acceleration threshold from 100.0 to 10.0. The error log is as follows:

You can open the visualizer by visiting the following URL:
http://127.0.0.1:7000/static/
Viewer URL: http://127.0.0.1:7000/static/
Traceback (most recent call last):
  File "tora_one_cartesian_regularization_collision.py", line 136, in <module>
    run_loop()
  File "/usr/local/lib/python3.8/dist-packages/ischedule/ischedule.py", line 107, in run_loop
    run_pending()
  File "/usr/local/lib/python3.8/dist-packages/ischedule/ischedule.py", line 80, in run_pending
    task.func()
  File "tora_one_cartesian_regularization_collision.py", line 112, in loop
    solver.solve(True)
RuntimeError: QPError: Problem: Infeasible QP (check your hard inequality constraints)

How to explain this error from a math perspective? The issue persists even after I changed the priorities of all tasks, such as the frame task and self-collision task, from hard to soft.
Is there a better solution to suppress these vibration? Should I consider adding a joint acceleration task, similar to the existing joint task? Any hints or suggestions would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions