dqrobotics / python

The DQ Robotics library in Python
https://dqrobotics.github.io
GNU Lesser General Public License v3.0
24 stars 9 forks source link

[Request] Adding equality constraints for current implimentation of DQ_QuadprogSolver #34

Closed qlin960618 closed 2 years ago

qlin960618 commented 2 years ago

Issue

Current implimentation of the DQ_QuadprogSolver simplly ignore the equality constraints and solve only for the inequality. However, in anticipation of the need for equality constraints functionality in the near future, this addition is needed. After brief discuession with @mmmarinho on this topic, he suggested the use of a pair of Anti-reflexive inequality constrains for constraining the upper and lower-bound for equality.

implimentation

Pull Request #33 Two methods were added to the DQ_QuadprogSolver class specifically for operating with the allow torelence for equality constraints listed below.

def set_equality_constraints_tolarence(tolarence):
def get_equality_constraints_tolarence():

When instantiating the class, the variable equality_constraints_tolarence will be assign the eps of numpy.float64. this could then be modify or read with methods described earlier. Additionally, under the original method solve_quadratic_program reshapping of the input array on b and beq is added for safe concatinating. and check for Aeqor beq equal to None to skip the equality constrain entirely when unused.