crossing.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, <copyright holder> <email>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the <organization> nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY <copyright holder> <email> ''AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL <copyright holder> <email> BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  */
28 
29 #ifndef CROSSING_H
30 #define CROSSING_H
31 
32 #include <ros/ros.h>
34 
35 
36 namespace tuw_graph
37 {
38  class Crossing
39  {
40  public:
41 
46  Crossing(const std::vector<Eigen::Vector2d> &_segment_points);
52  bool tryAddSegment(Segment &_seg);
57  Eigen::Vector2d getCenter() const;
61  void setSegmentReference(const std::shared_ptr<std::vector<Segment>> &segs);
62  private:
63  std::vector<Eigen::Vector2d> surroundingPoints_;
64  std::vector<uint32_t> segments_start_;
65  std::vector<uint32_t> segments_end_;
66  Eigen::Vector2d center_;
67  std::shared_ptr<std::vector<Segment>> segmentReference_;
68  };
69 }
70 
71 #endif // PLANNER_NODE_H
Eigen::Vector2d center_
Definition: crossing.h:66
Crossing(const std::vector< Eigen::Vector2d > &_segment_points)
constructor
Definition: crossing.cpp:35
Eigen::Vector2d getCenter() const
returns the center of the crossing (average of all pts)
Definition: crossing.cpp:114
void setSegmentReference(const std::shared_ptr< std::vector< Segment >> &segs)
saves the reference to the vector containing all segments to have access to them to alter other segme...
Definition: crossing.cpp:119
std::shared_ptr< std::vector< Segment > > segmentReference_
Definition: crossing.h:67
std::vector< uint32_t > segments_end_
Definition: crossing.h:65
bool tryAddSegment(Segment &_seg)
tries to add the segment to the crossing and adds the given segment to each segments neighbors in the...
Definition: crossing.cpp:63
std::vector< uint32_t > segments_start_
Definition: crossing.h:64
std::vector< Eigen::Vector2d > surroundingPoints_
Definition: crossing.h:63


tuw_voronoi_graph
Author(s): Benjamin Binder
autogenerated on Mon Jun 10 2019 15:42:44