dynamics_heuristic.cpp
Go to the documentation of this file.
00001 #include <vigir_footstep_planning_default_plugins/heuristics/dynamics_heuristic.h>
00002 
00003 
00004 
00005 namespace vigir_footstep_planning
00006 {
00007 DynamicsHeuristic::DynamicsHeuristic()
00008   : HeuristicPlugin("dynamics_heuristic")
00009 {
00010 }
00011 
00012 bool DynamicsHeuristic::loadParams(const vigir_generic_params::ParameterSet& params)
00013 {
00014   if (!HeuristicPlugin::loadParams(params))
00015     return false;
00016 
00017   params.getParam("dynamics/body/max_acc", max_body_acc_, 0.0);
00018   return true;
00019 }
00020 
00021 double DynamicsHeuristic::getHeuristicValue(const State& from, const State& to, const State& /*start*/, const State& /*goal*/) const
00022 {
00023   if (from == to)
00024     return 0.0;
00025 
00026   if (max_body_acc_ <= 0.0)
00027     return 0.0;
00028 
00029   // check if we can still retard in time
00030   const geometry_msgs::Vector3& v = from.getBodyVelocity();
00031   double d_min = (v.x*v.x + v.y*v.y + v.z*v.z)/(2.0*max_body_acc_);
00032 
00033   // if planner has issues finding a solution, increase the scaling of d_min or decrease cell size
00034   if (d_min*1.2 > euclidean_distance(from.getX(), from.getY(), from.getZ(), to.getX(), to.getY(), to.getZ()))
00035     return max_heuristic_value_;
00036 
00037   return 0.0;
00038 }
00039 }
00040 
00041 #include <pluginlib/class_list_macros.h>
00042 PLUGINLIB_EXPORT_CLASS(vigir_footstep_planning::DynamicsHeuristic, vigir_footstep_planning::HeuristicPlugin)


vigir_footstep_planning_default_plugins
Author(s): Alexander Stumpf
autogenerated on Fri Apr 7 2017 02:59:40