constraint_group.cpp
Go to the documentation of this file.
00001 
00028 #include "constrained_ik/constraint_group.h"
00029 #include "constrained_ik/constrained_ik.h"
00030 #include <ros/ros.h>
00031 
00032 namespace constrained_ik
00033 {
00034 
00035 using namespace Eigen;
00036 
00037 // initialize limits/tolerances to default values
00038 ConstraintGroup::ConstraintGroup() : Constraint()
00039 {
00040 }
00041 
00042 void ConstraintGroup::add(Constraint* constraint)
00043 {
00044   if (initialized_)
00045     constraint->init(ik_);
00046 
00047   constraints_.push_back(constraint);
00048 }
00049 
00050 constrained_ik::ConstraintResults ConstraintGroup::evalConstraint(const SolverState &state) const
00051 {
00052   constrained_ik::ConstraintResults output;
00053   for (size_t i=0; i<constraints_.size(); ++i)
00054     output.append(constraints_[i].evalConstraint(state));
00055 
00056   return output;
00057 }
00058 
00059 void ConstraintGroup::init(const Constrained_IK* ik)
00060 {
00061   Constraint::init(ik);
00062 
00063   for (size_t i=0; i<constraints_.size(); ++i)
00064     constraints_[i].init(ik);
00065 }
00066 
00067 } // namespace constrained_ik
00068 


constrained_ik
Author(s): Chris Lewis , Jeremy Zoss , Dan Solomon
autogenerated on Sat Jun 8 2019 19:23:45