dynamics_heuristic.cpp
Go to the documentation of this file.
2 
3 
4 
6 {
8  : HeuristicPlugin("dynamics_heuristic")
9 {
10 }
11 
12 bool DynamicsHeuristic::loadParams(const vigir_generic_params::ParameterSet& params)
13 {
14  if (!HeuristicPlugin::loadParams(params))
15  return false;
16 
17  params.getParam("dynamics/body/max_acc", max_body_acc_, 0.0);
18  return true;
19 }
20 
21 double DynamicsHeuristic::getHeuristicValue(const State& from, const State& to, const State& /*start*/, const State& /*goal*/) const
22 {
23  if (from == to)
24  return 0.0;
25 
26  if (max_body_acc_ <= 0.0)
27  return 0.0;
28 
29  // check if we can still retard in time
30  const geometry_msgs::Vector3& v = from.getBodyVelocity();
31  double d_min = (v.x*v.x + v.y*v.y + v.z*v.z)/(2.0*max_body_acc_);
32 
33  // if planner has issues finding a solution, increase the scaling of d_min or decrease cell size
34  if (d_min*1.2 > euclidean_distance(from.getX(), from.getY(), from.getZ(), to.getX(), to.getY(), to.getZ()))
35  return max_heuristic_value_;
36 
37  return 0.0;
38 }
39 }
40 
41 #include <pluginlib/class_list_macros.h>
42 PLUGINLIB_EXPORT_CLASS(vigir_footstep_planning::DynamicsHeuristic, vigir_footstep_planning::HeuristicPlugin)
double getHeuristicValue(const State &from, const State &to, const State &start, const State &goal) const override
bool loadParams(const vigir_generic_params::ParameterSet &params=vigir_generic_params::ParameterSet()) override


vigir_footstep_planning_default_plugins
Author(s): Alexander Stumpf
autogenerated on Sun Nov 17 2019 03:30:01