TrajOptResultPtr OptimizeProblem(TrajOptProbPtr prob, bool plot) {
  RobotBase::RobotStateSaver saver = prob->GetRAD()->Save();
  BasicTrustRegionSQP opt(prob);
  opt.max_iter_ = 40;
  opt.min_approx_improve_frac_ = .001;
  opt.merit_error_coeff_ = 20;
  if (plot) opt.addCallback(PlotCallback(*prob));
  //  opt.addCallback(boost::bind(&PlotCosts, boost::ref(prob->getCosts()),boost::ref(*prob->GetRAD()), boost::ref(prob->GetVars()), _1));
  opt.initialize(trajToDblVec(prob->GetInitTraj()));
  opt.optimize();
  return TrajOptResultPtr(new TrajOptResult(opt.results(), *prob));
}
TrajOptResultPtr OptimizeProblem(TrajOptProbPtr prob, bool plot) {
  Configuration::SaverPtr saver = prob->GetRAD()->Save();
  BasicTrustRegionSQP opt(prob);
  opt.max_iter_ = 40;
  opt.min_approx_improve_frac_ = .001;
  opt.improve_ratio_threshold_ = .2;
  opt.merit_error_coeff_ = 20;
  if (plot) {
    SetupPlotting(*prob, opt);
  }
  opt.initialize(trajToDblVec(prob->GetInitTraj()));
  opt.optimize();
  return TrajOptResultPtr(new TrajOptResult(opt.results(), *prob));
}
示例#3
0
 void SetRobotActiveDOFs() {
   m_prob->GetRAD()->SetRobotActiveDOFs();
 }
示例#4
0
 py::list GetDOFIndices() {
   vector<int> inds = m_prob->GetRAD()->GetJointIndices();
   return toPyList(inds);
 }
示例#5
0
 void SetRobotActiveDOFs() {
   RobotAndDOFPtr rad = boost::dynamic_pointer_cast<RobotAndDOF>(m_prob->GetRAD());
   if (!rad) PRINT_AND_THROW("can only call SetRobotActiveDOFs on a robot");
   rad->SetRobotActiveDOFs();
 }
示例#6
0
 py::list GetDOFIndices() {
   RobotAndDOFPtr rad = boost::dynamic_pointer_cast<RobotAndDOF>(m_prob->GetRAD());
   if (!rad) PRINT_AND_THROW("can only call GetDOFIndices on a robot");
   vector<int> inds = rad->GetJointIndices();
   return toPyList(inds);
 }