travel_time_heuristic.cpp
Go to the documentation of this file.
2 
3 
4 
6 {
8  : HeuristicPlugin("travel_time_heuristic")
9 {
10 }
11 
12 bool TravelTimeHeuristic::loadParams(const vigir_generic_params::ParameterSet& params)
13 {
14  if (!HeuristicPlugin::loadParams(params))
15  return false;
16 
17  params.getParam("max_step_dist/x", max_step_dist_x_inv_);
19  params.getParam("max_step_dist/y", max_step_dist_y_inv_);
21 
22  params.getParam("travel_time_cost_estimator/sway/parabol_a", a_sway_inv_, 0.0);
24  params.getParam("travel_time_cost_estimator/sway/parabol_b", b_sway_inv_, 0.0);
26  params.getParam("travel_time_cost_estimator/sway/const_time", const_sway_time_, 0.0);
27 
28  params.getParam("travel_time_cost_estimator/swing/parabol_a", a_swing_inv_, 0.0);
30  params.getParam("travel_time_cost_estimator/swing/parabol_b", b_swing_inv_, 0.0);
32  params.getParam("travel_time_cost_estimator/swing/const_time", const_swing_time_, 0.0);
33 
34  return true;
35 }
36 
37 double TravelTimeHeuristic::getHeuristicValue(const State& from, const State& to, const State& /*start*/, const State& /*goal*/) const
38 {
39  if (from == to)
40  return 0.0;
41 
42  // expected steps
43  tf::Transform step = from.getPose().inverse() * to.getPose();
44  double expected_steps_x = std::abs(step.getOrigin().x()) * max_step_dist_x_inv_;
45  double expected_steps_y = std::abs(step.getOrigin().y()) * max_step_dist_y_inv_;
46  double expected_steps = std::max(expected_steps_x, expected_steps_y);
47 
48 
49  //double sway_duration = parabol(sway.getOrigin().x(), sway.getOrigin().y(), a_sway_inv, b_sway_inv) + const_sway_time;
50  double step_duration = parabol(step.getOrigin().x()/expected_steps, step.getOrigin().y()/expected_steps, a_swing_inv_, b_swing_inv_) + const_swing_time_;
51 
52  //ROS_INFO_THROTTLE(1.0, "%f %f, ETA: %f", expected_steps_x, expected_steps_y, expected_steps * min_duration_per_step);
53 
54  //double expected_steps = euclidean_distance(from.getX(), from.getY(), from.getZ(), to.getX(), to.getY(), to.getZ()) * max_step_dist_x_inv;
55 
56  return expected_steps * (step_duration + const_sway_time_);
57 }
58 }
59 
60 #include <pluginlib/class_list_macros.h>
61 PLUGINLIB_EXPORT_CLASS(vigir_footstep_planning::TravelTimeHeuristic, vigir_footstep_planning::HeuristicPlugin)
bool loadParams(const vigir_generic_params::ParameterSet &params=vigir_generic_params::ParameterSet()) override
double getHeuristicValue(const State &from, const State &to, const State &start, const State &goal) const override


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