1#ifndef ROBOTOC_CONSTRAINTS_IMPL_HPP_ 
    2#define ROBOTOC_CONSTRAINTS_IMPL_HPP_ 
   15namespace constraintsimpl {
 
   21template <
typename Constra
intComponentBaseTypePtr>
 
   22void clear(std::vector<ConstraintComponentBaseTypePtr>& constraints);
 
   29template <
typename Constra
intComponentBaseTypePtr>
 
   31    const std::vector<ConstraintComponentBaseTypePtr>& constraints, 
 
   32    std::vector<ConstraintComponentData>& data);
 
   43template <
typename Constra
intComponentBaseTypePtr, 
typename ContactStatusType>
 
   44bool isFeasible(
const std::vector<ConstraintComponentBaseTypePtr>& constraints,
 
   45                Robot& robot, 
const ContactStatusType& contact_status, 
 
   46                std::vector<ConstraintComponentData>& data, 
 
   57template <
typename Constra
intComponentBaseTypePtr, 
typename ContactStatusType>
 
   59    const std::vector<ConstraintComponentBaseTypePtr>& constraints,
 
   60    Robot& robot, 
const ContactStatusType& contact_status, 
 
   61    std::vector<ConstraintComponentData>& data, 
const SplitSolution& s);
 
   72template <
typename Constra
intComponentBaseTypePtr, 
typename ContactStatusType>
 
   74    const std::vector<ConstraintComponentBaseTypePtr>& constraints,
 
   75    Robot& robot, 
const ContactStatusType& contact_status, 
 
   76    std::vector<ConstraintComponentData>& data, 
const SplitSolution& s);
 
   88template <
typename Constra
intComponentBaseTypePtr, 
typename ContactStatusType>
 
   90    const std::vector<ConstraintComponentBaseTypePtr>& constraints,
 
   91    Robot& robot, 
const ContactStatusType& contact_status, 
 
   92    std::vector<ConstraintComponentData>& data, 
const SplitSolution& s, 
 
  106template <
typename Constra
intComponentBaseTypePtr, 
typename ContactStatusType>
 
  108    const std::vector<ConstraintComponentBaseTypePtr>& constraints, 
 
  109    const ContactStatusType& contact_status,
 
  110    std::vector<ConstraintComponentData>& data, 
SplitKKTMatrix& kkt_matrix, 
 
  121template <
typename ConstraintComponentBaseTypePtr, 
typename ContactStatusType,
 
  122          typename SplitDirectionType>
 
  124    const std::vector<ConstraintComponentBaseTypePtr>& constraints,
 
  125    const ContactStatusType& contact_status, 
 
  126    std::vector<ConstraintComponentData>& data, 
const SplitDirectionType& d);
 
  134template <
typename Constra
intComponentBaseTypePtr>
 
  136    const std::vector<ConstraintComponentBaseTypePtr>& constraints,
 
  137    const std::vector<ConstraintComponentData>& data);
 
  145template <
typename Constra
intComponentBaseTypePtr>
 
  147    const std::vector<ConstraintComponentBaseTypePtr>& constraints,
 
  148    const std::vector<ConstraintComponentData>& data);
 
  155void updateSlack(std::vector<ConstraintComponentData>& data, 
 
  156                 const double step_size);
 
  163void updateDual(std::vector<ConstraintComponentData>& data, 
 
  164                const double step_size);
 
  171template <
typename Constra
intComponentBaseTypePtr>
 
  172void setBarrierParam(std::vector<ConstraintComponentBaseTypePtr>& constraints, 
 
  173                const double barrier_param);
 
  181template <
typename Constra
intComponentBaseTypePtr>
 
  183    std::vector<ConstraintComponentBaseTypePtr>& constraints,
 
  184    const double fraction_to_boundary_rule);
 
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
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
void expandSlackAndDual(const std::vector< ConstraintComponentBaseTypePtr > &constraints, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitDirectionType &d)
Expands the slack and dual, i.e., computes the directions of the slack and dual variables from the di...
Definition: constraints_impl.hxx:118
void setBarrierParam(std::vector< ConstraintComponentBaseTypePtr > &constraints, const double barrier_param)
Sets the barrier parameter.
Definition: constraints_impl.hxx:186
void condenseSlackAndDual(const std::vector< ConstraintComponentBaseTypePtr > &constraints, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, SplitKKTMatrix &kkt_matrix, SplitKKTResidual &kkt_residual)
Condenses the slack and dual variables. linearizeConstraints() must be called before this function.
Definition: constraints_impl.hxx:101
double maxSlackStepSize(const std::vector< ConstraintComponentBaseTypePtr > &constraints, const std::vector< ConstraintComponentData > &data)
Computes and returns the maximum step size by applying fraction-to-boundary-rule to the direction of ...
Definition: constraints_impl.hxx:132
void setFractionToBoundaryRule(std::vector< ConstraintComponentBaseTypePtr > &constraints, const double fraction_to_boundary_rule)
Sets the parameter of the fraction-to-boundary-rule.
Definition: constraints_impl.hxx:195
void createConstraintsData(const std::vector< ConstraintComponentBaseTypePtr > &constraints, std::vector< ConstraintComponentData > &data)
Creates constraints data.
Definition: constraints_impl.hxx:19
void evalConstraint(const std::vector< ConstraintComponentBaseTypePtr > &constraints, Robot &robot, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitSolution &s)
Computes the primal residual, residual in the complementary slackness, and the log-barrier_param func...
Definition: constraints_impl.hxx:66
void updateSlack(std::vector< ConstraintComponentData > &data, const double step_size)
Updates the slack variables according to the step size.
Definition: constraints_impl.hxx:167
double maxDualStepSize(const std::vector< ConstraintComponentBaseTypePtr > &constraints, const std::vector< ConstraintComponentData > &data)
Computes and returns the maximum step size by applying fraction-to-boundary-rule to the direction of ...
Definition: constraints_impl.hxx:150
bool isFeasible(const std::vector< ConstraintComponentBaseTypePtr > &constraints, Robot &robot, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitSolution &s)
Checks whether the current solution s is feasible or not.
Definition: constraints_impl.hxx:33
void clear(std::vector< ConstraintComponentBaseTypePtr > &constraints)
Clears the vector of the constraints.
Definition: constraints_impl.hxx:13
void linearizeConstraints(const std::vector< ConstraintComponentBaseTypePtr > &constraints, Robot &robot, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitSolution &s, SplitKKTResidual &kkt_residual)
Evaluates the constraints (i.e., calls evalConstraint()) and adds the products of the Jacobian of the...
Definition: constraints_impl.hxx:82
void setSlackAndDual(const std::vector< ConstraintComponentBaseTypePtr > &constraints, Robot &robot, const ContactStatusType &contact_status, std::vector< ConstraintComponentData > &data, const SplitSolution &s)
Sets the slack and dual variables of each constraint components.
Definition: constraints_impl.hxx:51
void updateDual(std::vector< ConstraintComponentData > &data, const double step_size)
Updates the dual variables according to the step size.
Definition: constraints_impl.hxx:176
Definition: constraint_component_base.hpp:17