Coverage Control Library
Loading...
Searching...
No Matches
typedefs.h
Go to the documentation of this file.
1/*
2 * This file is part of the CoverageControl library
3 *
4 * Author: Saurav Agarwal
5 * Contact: sauravag@seas.upenn.edu, agr.saurav1@gmail.com
6 * Repository: https://github.com/KumarRobotics/CoverageControl
7 *
8 * Copyright (c) 2024, Saurav Agarwal
9 *
10 * The CoverageControl library is free software: you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or (at your
13 * option) any later version.
14 *
15 * The CoverageControl library is distributed in the hope that it will be
16 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18 * Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along with
21 * CoverageControl library. If not, see <https://www.gnu.org/licenses/>.
22 */
23
29#ifndef CPPSRC_CORE_INCLUDE_COVERAGECONTROL_TYPEDEFS_H_
30#define CPPSRC_CORE_INCLUDE_COVERAGECONTROL_TYPEDEFS_H_
31
32#define EIGEN_NO_CUDA // Don't use eigen's cuda facility
33#include <Eigen/Dense> // Eigen is used for maps
34#include <queue>
35#include <vector>
36
37namespace CoverageControl {
38
44typedef Eigen::Vector2d Point2;
45typedef Eigen::Vector2f Point2f;
46typedef Eigen::Vector3d Point3;
47typedef Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
50typedef std::vector<Point2>
57 PointVector poly;
58 float imp = 0;
59 int size = 0;
61 PolygonFeature(PointVector const &p, float const i) : poly{p}, imp{i} {
62 size = poly.size();
63 }
64};
65
69struct Frontier {
70 Point2 pt;
71 double value;
72 Frontier() : pt{Point2()}, value{0} {}
73 Frontier(Point2 const &p, double const &v) : pt{p}, value{v} {}
74};
75
80 bool operator()(Frontier const &left, Frontier const &right) {
81 return left.value > right.value;
82 }
83};
84
85typedef std::priority_queue<Frontier, std::vector<Frontier>, FrontierCompare>
92} /* namespace CoverageControl */
93#endif // CPPSRC_CORE_INCLUDE_COVERAGECONTROL_TYPEDEFS_H_
Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MapType
Definition typedefs.h:48
std::vector< Point2 > PointVector
Definition typedefs.h:51
Eigen::Vector2d Point2
Definition typedefs.h:44
Eigen::Vector2f Point2f
Definition typedefs.h:45
Eigen::Vector3d Point3
Definition typedefs.h:46
std::priority_queue< Frontier, std::vector< Frontier >, FrontierCompare > queue_t
Definition typedefs.h:86
Namespace for the CoverageControl library.
A struct to compare frontiers based on their value.
Definition typedefs.h:79
A struct to store a frontier points and a value.
Definition typedefs.h:69
A struct to store a polygon feature and a uniform importance value.
Definition typedefs.h:56