1#ifndef ROBOTOC_IMPACT_CONSTRAINT_COMPONENT_BASE_HPP_ 
    2#define ROBOTOC_IMPACT_CONSTRAINT_COMPONENT_BASE_HPP_ 
   35                                const double fraction_to_boundary_rule=0.995);
 
  220      const 
double fraction_to_boundary_rule) final;
 
  228  template <typename Derived>
 
  248                                     const 
int size) const;
 
  259                                     const 
int start) const;
 
  269                                       const 
double dual) const;
 
  284                                          const 
int start, const 
int size);
 
  307                                            const 
double residual, 
 
  325                                   const 
int start, const 
int size);
 
  348                                     const 
double dslack, const 
double cmpl);
 
  355  template <typename VectorType>
 
  356  double logBarrier(const Eigen::MatrixBase<VectorType>& slack) const;
 
  359  double barrier_, fraction_to_boundary_rule_;
 
  365#include "robotoc/constraints/impact_constraint_component_base.hxx" 
Data used in constraint components. Composed by slack, dual (Lagrange multiplier),...
Definition: constraint_component_data.hpp:17
Base class for impact constraint components.
Definition: impact_constraint_component_base.hpp:24
static void computeDualDirection(ConstraintComponentData &data)
Computes the direction of the dual variable from slack, primal residual, complementarity slackness,...
Definition: impact_constraint_component_base.hxx:100
virtual void condenseSlackAndDual(const ImpactStatus &impact_status, ConstraintComponentData &data, SplitKKTMatrix &kkt_matrix, SplitKKTResidual &kkt_residual) const =0
Condenses the slack and dual variables, i.e., factorizes the   condensed Hessians and KKT residuals....
virtual bool isFeasible(Robot &robot, const ImpactStatus &impact_status, ConstraintComponentData &data, const SplitSolution &s) const =0
Checks whether the current solution s is feasible or not.
static void computeCondensingCoeffcient(ConstraintComponentData &data)
Computes the coefficient of the condensing.
Definition: impact_constraint_component_base.hxx:74
virtual void evalConstraint(Robot &robot, const ImpactStatus &impact_status, ConstraintComponentData &data, const SplitSolution &s) const =0
Computes the primal residual, residual in the complementary slackness, and the log-barrier function o...
virtual void setSlack(Robot &robot, const ImpactStatus &impact_status, ConstraintComponentData &data, const SplitSolution &s) const =0
Sets the slack variables of each constraint components.
virtual double getBarrierParam() const final
Returns the barrier parameter.
virtual double getFractionToBoundaryRule() const final
Returns the parameter of the fraction-to-boundary-rule.
virtual void setFractionToBoundaryRule(const double fraction_to_boundary_rule) final
Sets the parameter of the fraction-to-boundary-rule.
double maxSlackStepSize(const ConstraintComponentData &data) const
Computes and returns the maximum step size by applying fraction-to-boundary-rule to the direction of ...
Definition: impact_constraint_component_base.hxx:12
ImpactConstraintComponentBase & operator=(const ImpactConstraintComponentBase &)=default
Default copy operator.
void setSlackAndDualPositive(ConstraintComponentData &data) const
Sets the slack and dual variables positive.
void computeComplementarySlackness(ConstraintComponentData &data) const
Computes the residual in the complementarity slackness between   the slack and dual variables.
Definition: impact_constraint_component_base.hxx:49
ImpactConstraintComponentBase(ImpactConstraintComponentBase &&) noexcept=default
Default move constructor.
double logBarrier(const Eigen::MatrixBase< VectorType > &slack) const
Computes the log barrier function of the slack variable.
Definition: impact_constraint_component_base.hxx:127
ImpactConstraintComponentBase(const ImpactConstraintComponentBase &)=default
Default copy constructor.
double maxDualStepSize(const ConstraintComponentData &data) const
Computes and returns the maximum step size by applying fraction-to-boundary-rule to the direction of ...
Definition: impact_constraint_component_base.hxx:18
virtual void expandSlackAndDual(const ImpactStatus &impact_status, ConstraintComponentData &data, const SplitDirection &d) const =0
Expands the slack and dual, i.e., computes the directions of the slack and dual variables from the di...
virtual int dimc() const =0
Returns the size of the constraint.
ImpactConstraintComponentBase(const double barrier=1.0e-03, const double fraction_to_boundary_rule=0.995)
Constructor.
virtual void allocateExtraData(ConstraintComponentData &data) const =0
Allocates extra data in ConstraintComponentData.
static void updateSlack(ConstraintComponentData &data, const double step_size)
Updates the slack variable according to the step size.
Definition: impact_constraint_component_base.hxx:24
static void updateDual(ConstraintComponentData &data, const double step_size)
Updates the dual variable according to the step size.
Definition: impact_constraint_component_base.hxx:31
virtual void setBarrierParam(const double barrier_param) final
Sets the barrier parameter.
virtual KinematicsLevel kinematicsLevel() const =0
Checks the kinematics level of the constraint component.
virtual void evalDerivatives(Robot &robot, const ImpactStatus &impact_status, ConstraintComponentData &data, const SplitSolution &s, SplitKKTResidual &kkt_residual) const =0
Computes the derivatives of the priaml residual, i.e., the Jacobian of the inequality constraint,...
std::shared_ptr< Derived > as_shared_ptr()
Gets the shared ptr of this object as the specified type. If this fails in dynamic casting,...
Definition: impact_constraint_component_base.hxx:39
virtual ~ImpactConstraintComponentBase()
Destructor.
Definition: impact_constraint_component_base.hpp:40
Impact status of robot model. Wrapper of ContactStatus to treat impacts.
Definition: impact_status.hpp:21
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Newton direction of the solution to the optimal control problem split into a time stage.
Definition: split_direction.hpp:20
The KKT matrix split into a time stage.
Definition: split_kkt_matrix.hpp:18
KKT residual split into each time stage.
Definition: split_kkt_residual.hpp:18
Solution to the optimal control problem split into a time stage.
Definition: split_solution.hpp:20
Definition: constraint_component_base.hpp:17
KinematicsLevel
Kinematics level of the constraint component used in ConstraintComponentBase.
Definition: constraint_component_base.hpp:24