ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
border_observer.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2020 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Robert Markowski - initial API and implementation
13  ********************************************************************************/
14 
15 #pragma once
16 
18 #include "adore/mad/com_patterns.h"
19 #include <list>
20 #include <unordered_map>
21 
22 namespace adore
23 {
24  namespace env
25  {
26  namespace BorderBased
27  {
29  {
30  public:
32  {
33  }
37  void update() override
38  {
39  while (feed_->hasNext())
40  {
41  Border* b = new Border();
42  BorderID oldID;
43  feed_->getNext(*b);
44  auto result = m_byID.find(oldID);
45  if (result!=m_byID.end())//object exists => delete and create new
46  {
47  erase_border(oldID);
48  }
49 
50  insert_border(b);
51  }
52  }
53 
54  void discard_radius_based(double x, double y, double z, double radius) override
55  {
57  getBordersOutsideRegion( x-radius,
58  x+radius,
59  y-radius,
60  y+radius)
61  );
62  }
63 
65  {
66  feed_ = feed;
67  }
68 
69  };
70  }
71  }
72 }
Definition: border_observer.h:29
void addFeed(adore::mad::AFeed< Border > *feed)
Definition: border_observer.h:64
void discard_radius_based(double x, double y, double z, double radius) override
discard data outside of radius
Definition: border_observer.h:54
BorderObserver()
Definition: border_observer.h:31
void update() override
Definition: border_observer.h:37
efficiently store borders in boost R-tree
Definition: borderset.h:99
void removeBorders(const BorderSubSet &subset)
remove all borders in the given set
Definition: borderset.h:593
BorderID2Border m_byID
Definition: borderset.h:109
void insert_border(Border *b, bool force_insert=false)
insert new border into this
Definition: borderset.h:225
void erase_border(const BorderID &oldID)
erase border from this
Definition: borderset.h:269
itRegion2Border getBordersOutsideRegion(double x0, double x1, double y0, double y1)
get all borders outside of region as iterator pair
Definition: borderset.h:464
Definition: com_patterns.h:29
Observer pattern to manage feed data in a storage class.
Definition: com_patterns.h:131
AFeed< Border > * feed_
Definition: com_patterns.h:133
x
Definition: adore_set_goal.py:30
y
Definition: adore_set_goal.py:31
z
Definition: adore_set_goal.py:32
Definition: areaofeffectconverter.h:20
This struct identifies a Border by the coordinates of the starting and the end point.
Definition: borderid.h:31
The border struct contains data of the smallest.
Definition: border.h:62