Fawkes API  Fawkes Development Version
clusters_distance_cost_constraint.h
1 /***************************************************************************
2  * clusters_static_cost_constraint.h - distance-based cost factor for
3  * blocked edges
4  *
5  * Created: Sat Jul 19 21:17:20 2014
6  * Copyright 2014 Tim Niemueller
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef __NAVGRAPH_CLUSTERS_CLUSTERS_DISTANCE_COST_CONSTRAINT_H_
23 #define __NAVGRAPH_CLUSTERS_CLUSTERS_DISTANCE_COST_CONSTRAINT_H_
24 
25 #include <navgraph/constraints/edge_cost_constraint.h>
26 
27 #include <list>
28 #include <tuple>
29 #include <string>
30 #include <Eigen/Geometry>
31 
33 
35 {
36  public:
38  float cost_min, float cost_max,
39  float dist_min, float dist_max);
41 
42  virtual bool compute(void) throw();
43  virtual float cost_factor(const fawkes::NavGraphNode &from,
44  const fawkes::NavGraphNode &to) throw();
45 
46  private:
47  NavGraphClustersThread *parent_;
48  float cost_min_;
49  float cost_max_;
50  float cost_span_;
51  float dist_min_;
52  float dist_max_;
53  float dist_span_;
54  bool valid_;
55  std::list<std::tuple<std::string, std::string, Eigen::Vector2f>> blocked_;
56  Eigen::Vector2f pose_;
57 
58 };
59 
60 #endif
virtual ~NavGraphClustersDistanceCostConstraint()
Virtual empty destructor.
Constraint that can be queried for an edge cost factor.
Block navgraph paths based on laser clusters.
NavGraphClustersDistanceCostConstraint(const char *name, NavGraphClustersThread *parent, float cost_min, float cost_max, float dist_min, float dist_max)
Constructor.
Constraint apply linearly scaled costs based on the distance.
virtual bool compute(void)
Perform compuations before graph search and to indicate re-planning.
virtual float cost_factor(const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to)
Get cost factor for given edge.
Topological graph node.
Definition: navgraph_node.h:38
std::string name()
Get name of constraint.