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 <Eigen/Geometry>
28#include <list>
29#include <string>
30#include <tuple>
31
33
35{
36public:
39 float cost_min,
40 float cost_max,
41 float dist_min,
42 float dist_max);
44
45 virtual bool compute(void) noexcept;
46 virtual float cost_factor(const fawkes::NavGraphNode &from,
47 const fawkes::NavGraphNode &to) noexcept;
48
49private:
50 NavGraphClustersThread * parent_;
51 float cost_min_;
52 float cost_max_;
53 float cost_span_;
54 float dist_min_;
55 float dist_max_;
56 float dist_span_;
57 bool valid_;
58 std::list<std::tuple<std::string, std::string, Eigen::Vector2f>> blocked_;
59 Eigen::Vector2f pose_;
60};
61
62#endif
Constraint apply linearly scaled costs based on the distance.
virtual bool compute(void) noexcept
Perform compuations before graph search and to indicate re-planning.
virtual ~NavGraphClustersDistanceCostConstraint()
Virtual empty destructor.
NavGraphClustersDistanceCostConstraint(const char *name, NavGraphClustersThread *parent, float cost_min, float cost_max, float dist_min, float dist_max)
Constructor.
virtual float cost_factor(const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to) noexcept
Get cost factor for given edge.
Block navgraph paths based on laser clusters.
Constraint that can be queried for an edge cost factor.
std::string name()
Get name of constraint.
Topological graph node.
Definition: navgraph_node.h:36