euclidean_step_cost_estimator.cpp
Go to the documentation of this file.
2 
3 
4 
6 {
8  : StepCostEstimatorPlugin("euclidean_step_cost_estimator")
9 {
10 }
11 
12 bool EuclideanStepCostEstimator::getCost(const State& left_foot, const State& right_foot, const State& swing_foot, double& cost, double& cost_multiplier, double& risk, double& risk_multiplier) const
13 {
14  cost = 0.0;
15  cost_multiplier = 1.0;
16  risk = 0.0;
17  risk_multiplier = 1.0;
18 
19  if (swing_foot == left_foot || swing_foot == right_foot)
20  return true;
21 
22  const State& swing_foot_before = swing_foot.getLeg() == LEFT ? left_foot : right_foot;
23  cost = 0.5*euclidean_distance(swing_foot_before.getX(), swing_foot_before.getY(), swing_foot.getX(), swing_foot.getY());
24 
25  return true;
26 }
27 }
28 
29 #include <pluginlib/class_list_macros.h>
30 PLUGINLIB_EXPORT_CLASS(vigir_footstep_planning::EuclideanStepCostEstimator, vigir_footstep_planning::StepCostEstimatorPlugin)
bool getCost(const State &left_foot, const State &right_foot, const State &swing_foot, double &cost, double &cost_multiplier, double &risk, double &risk_multiplier) const override


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