giskardpy.qp.constraint
=======================

.. py:module:: giskardpy.qp.constraint

.. autoapi-nested-parse::

   Constraint description classes for the QP controller (:class:`GiskardConstraint` and subclasses).



Attributes
----------

.. autoapisummary::

   giskardpy.qp.constraint.LargeNumber


Classes
-------

.. autoapisummary::

   giskardpy.qp.constraint.GiskardConstraint
   giskardpy.qp.constraint.GiskardEqualityConstraint
   giskardpy.qp.constraint.GiskardInequalityConstraint


Module Contents
---------------

.. py:data:: LargeNumber
   :value: 10000.0


.. py:class:: GiskardConstraint

   Bases: :py:obj:`abc.ABC`


   Defines a (slack-relaxed) constraint on expression for a quadratic program.


   .. py:attribute:: name
      :type:  str

      Human readable name of the constraint, used for debugging.



   .. py:attribute:: expression
      :type:  krrood.symbolic_math.symbolic_math.Scalar

      The expression that is being constrained.



   .. py:attribute:: quadratic_weight
      :type:  krrood.symbolic_math.symbolic_math.ScalarData

      The quadratic weight of this constraint. Describes how expensive it is to violate.



   .. py:attribute:: linear_weight
      :type:  krrood.symbolic_math.symbolic_math.ScalarData
      :value: 0


      The linear weight of this constraint. It is only here for completeness, no use case has been found for it yet.



   .. py:attribute:: normalization_factor
      :type:  float

      This value is important to make constraints with different units comparable.
      The meaning depends on derivative.
      If the derivative is position, the normalization factor is rough velocity with which the expression can change.
      For example:
          - If you have a joint position constraint, the normalization factor should be the joint velocity limit.
          - If you have a cartesian position constraint, the normalization factor should be the cartesian velocity limit.
      In practice, use joint limits from the URDF for joint space constraints and define two values for cartesian constraints:
          - a m/s limit for translation
          - a rad/s value for rotation



   .. py:attribute:: enforcement_strategy
      :type:  type[giskardpy.qp.enforcement_strategy.EnforcementStrategy]

      The strategy used to enforce this constraint within the QP.



   .. py:attribute:: lower_slack_limit
      :type:  krrood.symbolic_math.symbolic_math.ScalarData
      :value: -10000.0


      How far the constraint may be violated below its bound.



   .. py:attribute:: upper_slack_limit
      :type:  krrood.symbolic_math.symbolic_math.ScalarData
      :value: 10000.0


      How far the constraint may be violated above its bound.



.. py:class:: GiskardEqualityConstraint

   Bases: :py:obj:`GiskardConstraint`


   A constraint that drives the expression to a single target value.


   .. py:attribute:: bound
      :type:  krrood.symbolic_math.symbolic_math.Scalar

      The target value the expression should reach.



   .. py:attribute:: bound_cap
      :type:  giskardpy.qp.bound_cap.BoundCap

      How the bound is limited to what may be demanded within the control horizon.



.. py:class:: GiskardInequalityConstraint

   Bases: :py:obj:`GiskardConstraint`


   A constraint that keeps the expression between a lower and upper bound.


   .. py:attribute:: lower_bound
      :type:  krrood.symbolic_math.symbolic_math.Scalar

      The lowest allowed value of the expression.



   .. py:attribute:: upper_bound
      :type:  krrood.symbolic_math.symbolic_math.Scalar

      The highest allowed value of the expression.



