ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
lanechangeview.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  * Daniel Heß - initial API and implementation
13  * Matthias Nichting - initial API and implementation
14  ********************************************************************************/
15 
16 #pragma once
17 #include <adore/env/afactory.h>
22 #include <adore/params/afactory.h>
24 
25 namespace adore
26 {
27 namespace env
28 {
29 namespace BorderBased
30 {
34 class [[deprecated("lanechangeview is superseded by threelaneviewdecoupled")]] DependentLane: public adore::view::ALane
35 {
36 private:
41 public:
43  :lfv_(lfv),lcg_(lcg),elt_(elt),cs_(cs){}
44 public: // methods derived from ALane
51  virtual bool isValid() const override
52  {
53  return lcg_->isValid();
54  }
55  virtual double getSMax() const override
56  {
57  return lcg_->getViewingDistance();
58  }
59  virtual double getSMin() const override
60  {
61  return 0.0;
62  }
68  double getProgressOfWidthOpen() const override
69  {
70  return lcg_->m_s_lane_width_open;
71  }
77  double getProgressOfWidthClosed() const override
78  {
79  return lcg_->m_s_lane_width_closed;
80  }
84  virtual const adore::view::TrafficQueue& getOnLaneTraffic() const override
85  {
86  return elt_->getQueue();
87  }
91  virtual const adore::view::ConflictSet& getConflictSet() const override
92  {
93  return *cs_;
94  }
98  [[deprecated("lanechangeview is superseded by threelaneviewdecoupled")]]
99  virtual double getSpeedLimit(double s) override
100  {
101  return 40.0;
102  }
103  [[deprecated("lanechangeview is superseded by threelaneviewdecoupled")]]
104  virtual double getLeftIndicatorHint(double s) override { return 0.0; }
105 
106  [[deprecated("lanechangeview is superseded by threelaneviewdecoupled")]]
107  virtual double getRightIndicatorHint(double s) override { return 0.0; }
112  virtual bool hasSpeedRecommendation(double s) const override
113  {
114  return false;
115  }
119  virtual double getSpeedRecommendation(double s) const override
120  {
121  return 0.0;
122  }
123  virtual double getNavigationCost(double s) override
124  {
125  return 0.0;
126  }
127  virtual void boundNavigationCost(double s0,double s1,double& cmin,double& cmax)
128  {
129  cmin = 0.0;cmax = 0.0;
130  }
134  virtual double getHeading(double s)override
135  {
136  return lfv_->getHeading(s);
137  }
143  virtual double getCurvature(double s, int derivative) override
144  {
145  return lfv_->getCurvature(s,derivative);
146  }
150  virtual double getOffsetOfLeftBorder(double s) override
151  {
152  return lcg_->getOffsetOfLeftBorder(s);
153  }
157  virtual double getOffsetOfRightBorder(double s) override
158  {
159  return lcg_->getOffsetOfRightBorder(s);
160  }
164  virtual void toRelativeCoordinates(double xe,double ye,double& s,double& n) override
165  {
166  lfv_->toRelativeCoordinates(xe,ye,s,n);
167  }
171  virtual void toEucledianCoordinates(double s,double n,double& xe,double& ye,double& ze) override
172  {
173  lfv_->toEucledianCoordinates(s,n,xe,ye,ze);
174  }
175 };
176 
182 {
183 private:
192 public:
200  LaneChangeView(adore::params::AFactory* paramsfactory, LocalRoadMap* localRoadMap,
201  LaneFollowingView* lfv,
203  : lfv_(lfv),lrm_(localRoadMap), elt_(trafficMap),cs_(lfv_->getGeometry()),
204  dl_(lfv_,&lcg_,&elt_,&cs_)
205  {
206  apLCV_ = paramsfactory->getLaneChangeView();
207  }
208 
210  : LaneChangeView(adore::params::ParamsFactoryInstance::get(), localRoadMap, lfv, trafficMap)
211  {
212 
213  // LaneChangeView(adore::params::ParamsFactoryInstance::get(), lfv, trafficMap);
214  }
215 
221  [[deprecated("lanechangeview is superseded by threelaneviewdecoupled")]]
223  {
224  int lfg_adjacency_i_start = 0;
225  lcg_.update(lfv_->getGeometry(), lrm_->getBorderSet(), lrm_->getVehicleState(), lfg_adjacency_i_start,
229  }
231 
232 public: // methods derived from ALaneChangeView
236  virtual adore::view::ALane* getSourceLane()override
237  {
238  return lfv_;
239  }
244  {
245  return &dl_;
246  }
251  {
252  return lcg_.getLCDirection();
253  }
258  virtual double getProgressOfGateOpen() const override
259  {
260  return lcg_.getProgressOfGateOpen();
261  }
266  virtual double getProgressOfGateClosed() const override
267  {
268  return lcg_.getProgressOfGateClosed();
269  }
273  virtual double getOffsetOfStartOuterBorder(double s) override
274  {
276  {
278  }
279  return lfv_->getGeometry()->getOffsetOfLeftBorder(s);
280  }
284  virtual double getOffsetOfSeparatingBorder(double s) override
285  {
287  {
289  }
290  return lfv_->getGeometry()->getOffsetOfLeftBorder(s);
291  //return lcg_.getOffsetOfCenterBorder(s);
292  }
296  virtual double getOffsetOfDestinationOuterBorder(double s) override
297  {
299  {
300  return lcg_.getOffsetOfRightBorder(s);
301  }
302  return lcg_.getOffsetOfLeftBorder(s);
303  }
304  virtual double getNavigationCostDifference() override
305  {
306  return 0.0;
307  }
308 
309 
310 };
311 } // namespace BorderBased
312 } // namespace env
313 } // namespace adore
Definition: conflictset.h:202
void update(BorderSet *borderSet, PrecedenceSet *precedenceSet, adore::env::traffic::EgoLaneTraffic *elt, BAContainer *rightBorders, BAContainer *leftBorders)
Definition: conflictset.h:224
Definition: lanechangeview.h:35
virtual double getSpeedRecommendation(double s) const override
Definition: lanechangeview.h:119
virtual double getCurvature(double s, int derivative) override
Definition: lanechangeview.h:143
virtual double getSMin() const override
Definition: lanechangeview.h:59
double getProgressOfWidthOpen() const override
Get the s-coordinate where the lane reaches the required width.
Definition: lanechangeview.h:68
adore::env::BorderBased::ConflictSet * cs_
Definition: lanechangeview.h:40
double getProgressOfWidthClosed() const override
Get the s-coordinate where the lane stops to have the required width.
Definition: lanechangeview.h:77
virtual double getSpeedLimit(double s) override
Definition: lanechangeview.h:99
adore::env::traffic::EgoLaneTraffic * elt_
Definition: lanechangeview.h:39
virtual double getOffsetOfLeftBorder(double s) override
Definition: lanechangeview.h:150
virtual double getLeftIndicatorHint(double s) override
Definition: lanechangeview.h:104
virtual const adore::view::ConflictSet & getConflictSet() const override
Definition: lanechangeview.h:91
virtual double getHeading(double s) override
Definition: lanechangeview.h:134
LaneChangeGeometry * lcg_
Definition: lanechangeview.h:38
LaneFollowingView * lfv_
Definition: lanechangeview.h:37
DependentLane(LaneFollowingView *lfv, LaneChangeGeometry *lcg, adore::env::traffic::EgoLaneTraffic *elt, adore::env::BorderBased::ConflictSet *cs)
Definition: lanechangeview.h:42
virtual void toEucledianCoordinates(double s, double n, double &xe, double &ye, double &ze) override
Definition: lanechangeview.h:171
virtual bool hasSpeedRecommendation(double s) const override
Definition: lanechangeview.h:112
virtual double getRightIndicatorHint(double s) override
Definition: lanechangeview.h:107
virtual double getSMax() const override
Definition: lanechangeview.h:55
virtual double getOffsetOfRightBorder(double s) override
Definition: lanechangeview.h:157
virtual double getNavigationCost(double s) override
Definition: lanechangeview.h:123
virtual void toRelativeCoordinates(double xe, double ye, double &s, double &n) override
Definition: lanechangeview.h:164
virtual bool isValid() const override
Check whether LaneChangeView is valid.
Definition: lanechangeview.h:51
virtual const adore::view::TrafficQueue & getOnLaneTraffic() const override
Definition: lanechangeview.h:84
virtual void boundNavigationCost(double s0, double s1, double &cmin, double &cmax)
Definition: lanechangeview.h:127
A class with a geometry description of a lane next to the current lane.
Definition: lanechangegeometry.h:38
bool isValid() const
Check whether the LaneChangeGeometry is valid.
Definition: lanechangegeometry.h:86
adore::view::ALaneChangeView::direction getLCDirection() const
Get the direction of the LaneChangeGeometry.
Definition: lanechangegeometry.h:439
double getProgressOfGateOpen() const
Get the s-coordinate where the lane starts to be in direct adjacency to the LaneFollowingGeometry whi...
Definition: lanechangegeometry.h:498
double getOffsetOfRightBorder(double s)
Get the offset of the right border at a certain position.
Definition: lanechangegeometry.h:478
BorderSubSet * getInnerBorders()
Get the sequence of inner Borders.
Definition: lanechangegeometry.h:388
double getProgressOfGateClosed() const
Get the s-coordinate where the lane ends to be in direct adjacency to the LaneFollowingGeometry whith...
Definition: lanechangegeometry.h:507
void update(LaneFollowingGeometry< lfg_a, lfg_b > *lfg, BorderSet *borderSet, adore::env::VehicleMotionState9d *ego, int lfg_adjacency_i_start, adore::view::ALaneChangeView::direction direction, double review_distance, double preview_distance, double adjacency_lower_limit=0.0)
update the road geometry
Definition: lanechangegeometry.h:117
double getViewingDistance() const
Get the viewing distance.
Definition: lanechangegeometry.h:430
double m_s_lane_width_closed
Definition: lanechangegeometry.h:54
double m_s_lane_width_open
Definition: lanechangegeometry.h:53
double getOffsetOfLeftBorder(double s)
Get the offset of the left border at a certain position.
Definition: lanechangegeometry.h:467
BorderSubSet * getOuterBorders()
Get the sequence of outer Borders.
Definition: lanechangegeometry.h:397
LaneChangeView provides traffic related information for an adjacent lane.
Definition: lanechangeview.h:182
LaneFollowingView * lfv_
Definition: lanechangeview.h:184
virtual double getOffsetOfDestinationOuterBorder(double s) override
Definition: lanechangeview.h:296
virtual adore::view::ALaneChangeView::direction getLCDirection() const override
Definition: lanechangeview.h:250
virtual double getOffsetOfSeparatingBorder(double s) override
Definition: lanechangeview.h:284
adore::env::traffic::EgoLaneTraffic elt_
Definition: lanechangeview.h:188
adore::env::BorderBased::ConflictSet cs_
Definition: lanechangeview.h:189
virtual double getOffsetOfStartOuterBorder(double s) override
Definition: lanechangeview.h:273
LaneChangeView(adore::params::AFactory *paramsfactory, LocalRoadMap *localRoadMap, LaneFollowingView *lfv, adore::env::traffic::TrafficMap *trafficMap)
Construct a new LaneChangeView object.
Definition: lanechangeview.h:200
adore::params::APLaneChangeView * apLCV_
Definition: lanechangeview.h:187
LocalRoadMap * lrm_
Definition: lanechangeview.h:186
LaneChangeGeometry lcg_
Definition: lanechangeview.h:185
virtual adore::view::ALane * getTargetLane() override
Definition: lanechangeview.h:243
void update(adore::view::ALaneChangeView::direction direction)
Update the LaneChangeView.
Definition: lanechangeview.h:222
virtual adore::view::ALane * getSourceLane() override
Definition: lanechangeview.h:236
virtual double getProgressOfGateClosed() const override
Definition: lanechangeview.h:266
virtual double getProgressOfGateOpen() const override
Definition: lanechangeview.h:258
virtual double getNavigationCostDifference() override
Definition: lanechangeview.h:304
DependentLane dl_
Definition: lanechangeview.h:190
LaneChangeView(LocalRoadMap *localRoadMap, LaneFollowingView *lfv, adore::env::traffic::TrafficMap *trafficMap)
Definition: lanechangeview.h:209
LaneChangeGeometry * getGeometry()
Definition: lanechangeview.h:230
double getOffsetOfLeftBorder(double s)
Get the offset of the left border at a certain position.
Definition: lanefollowinggeometry.h:722
double getOffsetOfRightBorder(double s)
Get the offset of the right border at a certain position.
Definition: lanefollowinggeometry.h:742
LaneFollowingview provides traffic related information for the current lane.
Definition: lanefollowingview.h:42
virtual double getCurvature(double s, int derivative) override
Definition: lanefollowingview.h:193
TLaneFollowingGeometry * getGeometry()
Definition: lanefollowingview.h:105
virtual double getHeading(double s) override
Definition: lanefollowingview.h:186
virtual void toEucledianCoordinates(double s, double n, double &xe, double &ye, double &ze) override
Definition: lanefollowingview.h:226
virtual void toRelativeCoordinates(double xe, double ye, double &s, double &n) override
Definition: lanefollowingview.h:217
Definition: localroadmap.h:38
PrecedenceSet * getPrecedenceSet()
Get the PrecedenceSet object.
Definition: localroadmap.h:132
BorderSet * getBorderSet()
Get the BorderSet object.
Definition: localroadmap.h:123
VehicleMotionState9d * getVehicleState()
Get the VehicleState.
Definition: localroadmap.h:141
Definition: egolanetraffic.h:34
const adore::view::TrafficQueue & getQueue() const
Get the traffic queue.
Definition: egolanetraffic.h:50
void mapVehiclesOnBorders(adore::view::ALane *lfv, const adore::env::BorderBased::BorderSubSet &borders)
Map vehicles on borders.
Definition: egolanetraffic.h:69
Definition: trafficmap.h:36
abstract factory for adore::params classes
Definition: afactory.h:54
virtual APLaneChangeView * getLaneChangeView() const =0
abstract class containing parameters for a lane change view
Definition: ap_lane_change_view.h:25
virtual double getLookBehind() const =0
virtual double getLookAhead() const =0
Definition: alanechangeview.h:27
direction
Definition: alanechangeview.h:42
@ LEFT
Definition: alanechangeview.h:43
@ RIGHT
Definition: alanechangeview.h:43
Definition: alane.h:28
Definition: conflictset.h:176
std::vector< TrafficObject > TrafficQueue
Definition: trafficobject.h:183
Definition: areaofeffectconverter.h:20