Main Page
Namespaces
Classes
Files
File List
File Members
src
heuristics
dynamics_heuristic.cpp
Go to the documentation of this file.
1
#include <
vigir_footstep_planning_default_plugins/heuristics/dynamics_heuristic.h
>
2
3
4
5
namespace
vigir_footstep_planning
6
{
7
DynamicsHeuristic::DynamicsHeuristic
()
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)
vigir_footstep_planning::DynamicsHeuristic::getHeuristicValue
double getHeuristicValue(const State &from, const State &to, const State &start, const State &goal) const override
Definition:
dynamics_heuristic.cpp:21
dynamics_heuristic.h
vigir_footstep_planning::DynamicsHeuristic::DynamicsHeuristic
DynamicsHeuristic()
Definition:
dynamics_heuristic.cpp:7
vigir_footstep_planning::DynamicsHeuristic::max_body_acc_
double max_body_acc_
Definition:
dynamics_heuristic.h:52
vigir_footstep_planning
Definition:
dynamics_heuristic.h:39
vigir_footstep_planning::DynamicsHeuristic
Definition:
dynamics_heuristic.h:41
vigir_footstep_planning::DynamicsHeuristic::loadParams
bool loadParams(const vigir_generic_params::ParameterSet ¶ms=vigir_generic_params::ParameterSet()) override
Definition:
dynamics_heuristic.cpp:12
vigir_footstep_planning_default_plugins
Author(s): Alexander Stumpf
autogenerated on Sun Nov 17 2019 03:30:01