ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
MAPEMLane.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 
17 #include <bitset>
18 #include <vector>
19 #include "../coordinate.h"
20 
21 namespace adore
22 {
23  namespace sumo_if_ros
24  {
25  class MAPEMLane
26  {
27  public:
28 
34  {
38  enum Maneuvers
39  {
43 
44  // Needs to be last
46  };
47 
48  typedef std::bitset<NumManeuvers> AllowedManeuvers;
49 
51 
53 
54  unsigned int lane_id;
55 
56  unsigned int signal_group_id;
57 
58  bool operator==(const ConnectingLane & other) const
59  {
60  return (other.lane_id == lane_id)
61  && (other.signal_group_id == signal_group_id)
63  }
64  };
65 
67  {
68  VEHICLE, // motor vehicle lanes
69  CROSSWALK, // pedestrian crosswalks
70  BIKELANE, // bike lanes
71  SIDEWALK, // pedestrian sidewalk paths
72  MEDIAN, // medians and channelization
73  STRIPING, // roadway markings
74  TRACKEDVEHICLE, // trains and trolleys
75  PARKING, // parking and stopping lanes
76  };
77 
82  {
85  BOTH
86  };
87 
88 
90 
91  unsigned int lane_id_;
92 
94 
95  std::vector<adore::sumo_if_ros::Coordinate> v_nodes_;
96 
98 
99  std::vector<ConnectingLane> v_connector_lanes_id_;
100 
102 
103  bool operator==(const MAPEMLane & other) const
104  {
105  return (other.lane_id_ == lane_id_)
107  && (other.v_nodes_ == v_nodes_);
108  }
109 
115  virtual bool isEqualShallow(const MAPEMLane & other) const
116  {
117  if (other.lane_id_ != lane_id_)
118  return false;
119 
120  // Compare lanes
121  const std::size_t lanesSize = v_connector_lanes_id_.size();
122  const std::size_t otherLanesSize = other.v_connector_lanes_id_.size();
123  if (lanesSize != otherLanesSize)
124  return false;
125  // First lanes unequal?
126  if (lanesSize && !(*v_connector_lanes_id_.cbegin() == *other.v_connector_lanes_id_.cbegin()))
127  return false;
128 
129  // Compare nodes
130  const std::size_t nodesSize = v_nodes_.size();
131  const std::size_t otherNodesSize = other.v_nodes_.size();
132  if (nodesSize != otherNodesSize)
133  return false;
134  // First nodes unequal?
135  if (nodesSize && !(*v_nodes_.cbegin() == *other.v_nodes_.cbegin()))
136  return false;
137 
138  return true;
139  }
140  };
141 
142  }
143 }
Definition: MAPEMLane.h:26
unsigned int lane_id_
Definition: MAPEMLane.h:91
LaneTypesAttributes lanetype_attribute_
Definition: MAPEMLane.h:89
bool operator==(const MAPEMLane &other) const
Definition: MAPEMLane.h:103
DirectionalUse directional_use_
Definition: MAPEMLane.h:101
int nodes_count_
Definition: MAPEMLane.h:93
virtual bool isEqualShallow(const MAPEMLane &other) const
Definition: MAPEMLane.h:115
int connected_lanes_count_
Definition: MAPEMLane.h:97
DirectionalUse
Definition: MAPEMLane.h:82
@ BOTH
Definition: MAPEMLane.h:85
@ EGRESS
Definition: MAPEMLane.h:84
@ INGRESS
Definition: MAPEMLane.h:83
std::vector< ConnectingLane > v_connector_lanes_id_
Definition: MAPEMLane.h:99
LaneTypesAttributes
Definition: MAPEMLane.h:67
@ MEDIAN
Definition: MAPEMLane.h:72
@ CROSSWALK
Definition: MAPEMLane.h:69
@ STRIPING
Definition: MAPEMLane.h:73
@ SIDEWALK
Definition: MAPEMLane.h:71
@ PARKING
Definition: MAPEMLane.h:75
@ VEHICLE
Definition: MAPEMLane.h:68
@ TRACKEDVEHICLE
Definition: MAPEMLane.h:74
@ BIKELANE
Definition: MAPEMLane.h:70
std::vector< adore::sumo_if_ros::Coordinate > v_nodes_
Definition: MAPEMLane.h:95
Definition: areaofeffectconverter.h:20
std::bitset< NumManeuvers > AllowedManeuvers
Definition: MAPEMLane.h:48
bool operator==(const ConnectingLane &other) const
Definition: MAPEMLane.h:58
@ NumManeuvers
Definition: MAPEMLane.h:45
@ ManeuverStraight
Definition: MAPEMLane.h:41
@ ManeuverRight
Definition: MAPEMLane.h:40
@ ManeuverLeft
Definition: MAPEMLane.h:42
unsigned int lane_id
Definition: MAPEMLane.h:54
int maneuver_count
Definition: MAPEMLane.h:52
AllowedManeuvers allowed_maneuvers_on_connection
Definition: MAPEMLane.h:50
unsigned int signal_group_id
Definition: MAPEMLane.h:56