ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
MAPEMIntersection.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  * Stephan Lapoehn - initial implementation and API
13  ********************************************************************************/
14 
15 #pragma once
16 #include "MAPEMLane.h"
17 
18 namespace adore
19 {
20  namespace sumo_if_ros
21  {
26  {
27  public:
28 
29  unsigned int intersection_id_;
30 
32 
33  float lane_width_;
34 
39  double ref_latitude_;
40 
46 
50  std::vector<MAPEMLane> lanes_;
51 
58  bool operator==(const MAPEMIntersection &other) const
59  {
60  return (other.intersection_id_ == intersection_id_)
61  && (other.lanes_ == lanes_);
62  }
63 
68  virtual bool isEqualShallow(const MAPEMIntersection & other) const
69  {
71  || (other.lanes_.size() != lanes_.size()))
72  return false;
73 
74  auto otherLaneIt = other.lanes_.cbegin();
75 
76  auto laneIt = lanes_.cbegin();
77 
78  for(; laneIt != lanes_.cend() && otherLaneIt != other.lanes_.cend(); ++otherLaneIt, ++laneIt)
79  {
80  if(!laneIt->isEqualShallow(*otherLaneIt))
81  return false;
82  }
83 
84  return true;
85  }
86 
87  };
88  }
89 }
Definition: MAPEMIntersection.h:26
bool operator==(const MAPEMIntersection &other) const
Definition: MAPEMIntersection.h:58
virtual bool isEqualShallow(const MAPEMIntersection &other) const
Definition: MAPEMIntersection.h:68
std::vector< MAPEMLane > lanes_
Definition: MAPEMIntersection.h:50
int lanes_count_
Definition: MAPEMIntersection.h:31
double ref_longitude_
Definition: MAPEMIntersection.h:45
unsigned int intersection_id_
Definition: MAPEMIntersection.h:29
double ref_latitude_
Definition: MAPEMIntersection.h:39
float lane_width_
Definition: MAPEMIntersection.h:33
Definition: areaofeffectconverter.h:20