ground_contact_step_cost_estimator.cpp
Go to the documentation of this file.
2 
3 #include <angles/angles.h>
4 
5 
6 
8 {
10  : StepCostEstimatorPlugin("ground_contact_step_cost_estimator")
11 {
12 }
13 
14 bool GroundContactStepCostEstimator::loadParams(const vigir_generic_params::ParameterSet& params)
15 {
16  if (!StepCostEstimatorPlugin::loadParams(params))
17  return false;
18 
19  params.getParam("foot_contact_support/minimal_support", min_contact_support);
20  return true;
21 }
22 
23 bool GroundContactStepCostEstimator::getCost(const State& /*left_foot*/, const State& /*right_foot*/, const State& swing_foot, double& cost, double& cost_multiplier, double& risk, double& risk_multiplier) const
24 {
25  cost = 0.0;
26  cost_multiplier = 1.0;
27  risk = 0.0;
28  risk_multiplier = 1.0;
29 
30  if (swing_foot.getGroundContactSupport() < 1.0)
31  {
32  if (swing_foot.getGroundContactSupport() > min_contact_support)
33  cost_multiplier = risk_multiplier = 1.0/swing_foot.getGroundContactSupport();
34  else
35  return false;
36  }
37 
38  return true;
39 }
40 }
41 
42 #include <pluginlib/class_list_macros.h>
43 PLUGINLIB_EXPORT_CLASS(vigir_footstep_planning::GroundContactStepCostEstimator, 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
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