ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
lanechangeconstraintsandreferences.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  * Matthias Nichting - initial API and implementation
13  ********************************************************************************/
14 
15 
16 #pragma once
21 #include <adore/mad/adoremath.h>
22 #include <adore/view/agap.h>
23 
24 namespace adore
25 {
26 namespace fun
27 {
28 
30  {
34  undefined
35  };
40  {
41  private:
45  double width_;
51  public:
55  ConstraintDirection direction)
56  :lcv_(lcv),pv_(pv),plat_(plat),direction_(direction),gap_(nullptr){}
57 
58  void setGap(adore::view::AGap* gap){gap_=gap;}
59 
60  virtual double getValue(double t,double s,double ds)const override
61  {
62  double dl,dr,dc,d;
63  if(!lcv_->getSourceLane()->isValid())return 0;
64  if(gap_==nullptr ||!lcv_->getTargetLane()->isValid())
65  {
68  }
69  else
70  {
71  auto state = gap_->getState(s,t);
73  if( s < lcv_->getProgressOfGateOpen()) state = adore::view::AGap::OPENING;
75  switch( state )
76  {
78  {
80  {
83  }
84  else
85  {
88  }
89  }
90  break;
92  {
94  {
97  }
98  else
99  {
102  }
103  }
104  break;
106  {
109  }
110  break;
111  }
112  }
113  dc = (dl+dr)*0.5;//center
114  d = dl-dr;
115  //TODO: this part has been inserted for debugging
116  {
117  if(direction_==LB)
118  {
119  return dr + hard_safety_distance_ + width_*0.5;
120  }
121  else
122  {
123  return dl - hard_safety_distance_ - width_*0.5;
124  }
125  }
126 
127 
128  //not enough room to enforce hard safety distance->singular solution
129  if(d < 2.0*hard_safety_distance_ + width_)
130  {
131  return dc;
132  }
133  //not enough room to enforce min_control_space and hard_safety_distance -> enforce hard_safety_distance
134  else if(d < 2.0*soft_safety_distance_ + width_ + min_control_space_)
135  {
136  if(direction_==LB)
137  {
138  return dr + hard_safety_distance_ + width_*0.5;
139  }
140  else
141  {
142  return dl - hard_safety_distance_ - width_*0.5;
143  }
144  }
145  //enough room to enforce soft_safety_distance and min_control_space
146  else
147  {
148  if(direction_==LB)
149  {
150  return dr + soft_safety_distance_ + width_*0.5;
151  }
152  else
153  {
154  return dl - soft_safety_distance_ - width_*0.5;
155  }
156  }
157  }
158  virtual void update(double t0,double s0,double ds0) override
159  {
160  width_ = pv_->get_bodyWidth();
164 
165  //for lane change: operate only with hard safety distance
166  // soft_safety_distance_ = hard_safety_distance_;
167  }
169  {
170  return direction_;
171  }
172  virtual int getDimension() override
173  {
174  return 1;
175  }
176  virtual int getDerivative() override
177  {
178  return 0;
179  }
180  };
181 
182 
189  {
190  private:
197  double width_;
198  double s_front_t0_;
199  double v_front_t0_;
200  double sgap_;
201  double t0_;
202  public:
204  :lcv_(lcv),pveh_(pv),plat_(plat),pgen_(pgen),ptac_(ptac),gap_(nullptr),sgap_(0.0){}
205  void setGap(adore::view::AGap* gap){gap_=gap;}
206 
208  {
209  if (gap_!=nullptr && lcv_->getSourceLane()->isValid() && lcv_->getTargetLane()->isValid())
210  {
211  switch (gap_->getState(s,t))
212  {
215  break;
218  break;
220  if (s> s_front_t0_ + (t-t0_) * v_front_t0_)
223  break;
224  default:
225  throw std::runtime_error("unknown gap state in LaneChangePhaseExtimator");
226  break;
227  }
228  }
230  }
231 
232  virtual bool getValueIfAvailable(double t, double s, double ds,double & ref)const override
233  {
234  return false;
235  }
236  virtual void update(double t0,double s0,double ds0)override
237  {
240 
241 
242 
243  //amin_ = ptac_->getAssumedNominalAccelerationMinimum();
244  double to_front = pveh_->get_a() + pveh_->get_b() + pveh_->get_c() - pgen_->get_rho();
246  s_front_t0_ = 1.0e6;//initialize unbounded
247  v_front_t0_ = 0.0;
248  t0_ = t0;
249  for(auto& object:q)
250  {
251  double object_v0 = object.getCurrentSpeed();
252  double delay = t0_ - object.getObservationTime();
253  double object_s0 = object.getCurrentProgress() - object.getLength()*0.5 - to_front + delay * object_v0;
254  if(object_s0>s0)
255  {
256  //in contrast to other constraint variant, the time gap is removed here, as the breaking curve is directly considered
257  double buffer = sgap_;
258  s_front_t0_ = object_s0 - buffer ;
259  v_front_t0_ = object_v0;
260  break;
261  }
262  }
263  }
264  virtual int getDimension() override
265  {
266  return 0;
267  }
268  virtual int getDerivative() override
269  {
270  return 0;
271  }
272  };
273 
278  {
279  private:
284  double width_;
290  public:
292  LaneChangePhaseEstimator* phaseEstimator,
295  ConstraintDirection direction)
296  :lcv_(lcv),phaseEstimator_(phaseEstimator),pv_(pv),plat_(plat),direction_(direction),gap_(nullptr){}
297 
298  void setGap(adore::view::AGap* gap){gap_=gap;}
299 
300  virtual double getValue(double t,double s,double ds)const override
301  {
302  double dl,dr,dc,d;
303  if(!lcv_->getSourceLane()->isValid())return 0;
304  if(gap_==nullptr ||!lcv_->getTargetLane()->isValid() || phaseEstimator_ == nullptr)
305  {
308  }
309  else
310  {
311  auto phase = phaseEstimator_->getLaneChangePhase(t,s);
312  switch( phase )
313  {
315  {
318  }
319  break;
321  {
323  {
326  }
327  else
328  {
331  }
332  }
333  break;
335  {
338  }
339  break;
340  }
341  }
342  dc = (dl+dr)*0.5;//center
343  d = dl-dr;
344  //TODO: this part has been inserted for debugging
345  {
346  if(direction_==LB)
347  {
348  return dr + hard_safety_distance_ + width_*0.5;
349  }
350  else
351  {
352  return dl - hard_safety_distance_ - width_*0.5;
353  }
354  }
355 
356 
357  //not enough room to enforce hard safety distance->singular solution
358  if(d < 2.0*hard_safety_distance_ + width_)
359  {
360  return dc;
361  }
362  //not enough room to enforce min_control_space and hard_safety_distance -> enforce hard_safety_distance
363  else if(d < 2.0*soft_safety_distance_ + width_ + min_control_space_)
364  {
365  if(direction_==LB)
366  {
367  return dr + hard_safety_distance_ + width_*0.5;
368  }
369  else
370  {
371  return dl - hard_safety_distance_ - width_*0.5;
372  }
373  }
374  //enough room to enforce soft_safety_distance and min_control_space
375  else
376  {
377  if(direction_==LB)
378  {
379  return dr + soft_safety_distance_ + width_*0.5;
380  }
381  else
382  {
383  return dl - soft_safety_distance_ - width_*0.5;
384  }
385  }
386  }
387  virtual void update(double t0,double s0,double ds0) override
388  {
389  width_ = pv_->get_bodyWidth();
393 
394  //for lane change: operate only with hard safety distance
395  // soft_safety_distance_ = hard_safety_distance_;
396  }
398  {
399  return direction_;
400  }
401  virtual int getDimension() override
402  {
403  return 1;
404  }
405  virtual int getDerivative() override
406  {
407  return 0;
408  }
409  };
410 
411 
417  {
418  private:
421  public:
423  LaneChangePhaseEstimator* phaseEstimator,
424  const adore::params::APVehicle* pveh,
427  :phaseEstimator_(phaseEstimator)
428  {
429  fpv = new FollowPrecedingVehicle_BreakingCurve(lane,pveh,ptac,pgen);
430  }
432  {
433  delete fpv;
434  }
435  virtual double getValue(double t,double s,double ds)const override
436  {
438  {
439  return 1.0e6;
440  }
441  return fpv->getValue(t,s,ds);
442  }
443  virtual void update(double t0,double s0,double ds0) override
444  {
445  fpv->update(t0,s0,ds0);
446  }
448  {
449  return UB;
450  }
451  virtual int getDimension() override
452  {
453  return 0;
454  }
455  virtual int getDerivative() override
456  {
457  return 0;
458  }
459  };
460 
461 
462 
463 
468  {
469  private:
473  double width_;
478  public:
482  ConstraintDirection direction)
483  :lcv_(lcv),pv_(pv),plat_(plat),direction_(direction){}
484 
485 
486  virtual double getValue(double t,double s,double ds)const override
487  {
488  double dl,dr,dc,d;
489  if(!lcv_->getSourceLane()->isValid()||!lcv_->getTargetLane()->isValid())return 0;
490  bool in_gate = lcv_->getProgressOfGateOpen()<s && s<lcv_->getProgressOfGateClosed();
492  {
493  if(in_gate)
494  {
497  }
498  else
499  {
501  }
503  }
504  else
505  {
507  if(in_gate)
508  {
511  }
512  else
513  {
515  }
516  }
517  dc = (dl+dr)*0.5;//center
518  d = dl-dr;
519 
520 
521  //not enough room to enforce hard safety distance->singular solution
522  if(d < 2.0*hard_safety_distance_ + width_)
523  {
524  return dc;
525  }
526  //not enough room to enforce min_control_space and hard_safety_distance -> enforce hard_safety_distance
527  else if(d < 2.0*soft_safety_distance_ + width_ + min_control_space_)
528  {
529  if(direction_==LB)
530  {
531  return dr + hard_safety_distance_ + width_*0.5;
532  }
533  else
534  {
535  return dl - hard_safety_distance_ - width_*0.5;
536  }
537  }
538  //enough room to enforce soft_safety_distance and min_control_space
539  else
540  {
541  if(direction_==LB)
542  {
543  return dr + soft_safety_distance_ + width_*0.5;
544  }
545  else
546  {
547  return dl - soft_safety_distance_ - width_*0.5;
548  }
549  }
550  }
551  virtual void update(double t0,double s0,double ds0) override
552  {
553  width_ = pv_->get_bodyWidth();
557  //for lane merge: operate only with hard safety distance
559  }
561  {
562  return direction_;
563  }
564  virtual int getDimension() override
565  {
566  return 1;
567  }
568  virtual int getDerivative() override
569  {
570  return 0;
571  }
572  };
573 
574 
579  {
580  private:
585  double width_;
589  double d_;
590  double i_grid_;//grid step index
591  public:
593  :lcv_(lcv),pv_(pv),plat_(plat),i_grid_(i_grid),gap_(nullptr){d_ = 0.2;}
594  void setGap(adore::view::AGap* gap){gap_=gap;}
595 
596  virtual bool getValueIfAvailable(double t, double s, double ds,double & ref)const override
597  {
598  ref = 0.0;
599  if(gap_!=nullptr && lcv_->getTargetLane()->isValid())
600  {
601  auto state = gap_->getState(s,t);
602  state = adore::view::AGap::OPEN;
603  if( s < lcv_->getProgressOfGateOpen()) state = adore::view::AGap::OPENING;
605  double dl,dr,dlc,drc;
606  switch( state )
607  {
609  {
611  {
616  }
617  else
618  {
623  }
624  }
625  break;
627  {
629  {
634  }
635  else
636  {
641  }
642  }
643  break;
645  {
647  {
652  }
653  else
654  {
659  }
660  }
661  break;
662  }
663  const double dc = (dl+dr)*0.5;
664  ref = dc + i_grid_ * d_;
665  if(dlc<ref && ref<drc)ref = dc;//constraints invalid, use center
666  else if(dlc<ref)ref = dlc;
667  else if(ref<drc)ref = drc;
668  }
669  return true;
670  }
671  virtual void update(double t0,double s0,double ds0)override
672  {
673  width_ = pv_->get_bodyWidth();
678  }
679  virtual int getDimension() override
680  {
681  return 1;
682  }
683  virtual int getDerivative() override
684  {
685  return 0;
686  }
687  };
688 
693  {
694  private:
696  public:
698 
699  virtual bool getValueIfAvailable(double t, double s, double ds,double & ref)const override
700  {
701  if(lcv_->getTargetLane()->isValid())
702  {
703  ref = 0.5 * lcv_->getOffsetOfSeparatingBorder(s)
704  + 0.5 * lcv_->getOffsetOfStartOuterBorder(s);
705  return true;
706  }
707  return false;
708  }
709  virtual void update(double t0,double s0,double ds0)override
710  {
711  }
712  virtual int getDimension() override
713  {
714  return 1;
715  }
716  virtual int getDerivative() override
717  {
718  return 0;
719  }
720  };
721 
726  {
727  private:
729  public:
731 
732  virtual bool getValueIfAvailable(double t, double s, double ds,double & ref)const override
733  {
734  if(lcv_->getTargetLane()->isValid())
735  {
736  ref = 0.5 * lcv_->getOffsetOfSeparatingBorder(s)
738  return true;
739  }
740  return false;
741  }
742  virtual void update(double t0,double s0,double ds0)override
743  {
744  }
745  virtual int getDimension() override
746  {
747  return 1;
748  }
749  virtual int getDerivative() override
750  {
751  return 0;
752  }
753  };
754 
759 {
760 private:
766  double s_front_t0_;
767  double v_front_t0_;
768  double s_lead_t0_;
769  double v_lead_t0_;
770  double s_chase_t0_;
771  double v_chase_t0_;
772  double t0_;
773  double s_;
774  enum gapState
775  {
778  gapClosed
779  };
780 
781 public:
784  const adore::params::APVehicle *pveh,
787  : lfv_(lfv), lcv_(lcv), ptac_(ptac), pveh_(pveh), pgen_(pgen) { s_ = 0.0; }
788  gapState getGapState(double t) const
789  {
790  if (s_front_t0_ > 1.0e5 || s_chase_t0_ < -1.0e5 || getFrontBound(t) >= getChaseBound(t))
791  {
792  return gapOpen;
793  }
794  else if (getFrontBound(t + 10.0) >= getChaseBound(t + 10.0))
795  {
796  return gapOpening;
797  }
798  return gapClosed;
799  }
800  virtual double getUB(int dim, int der, double t, double s, double ds) const override
801  {
802  if (dim == 0 && der == 0)
803  {
804  switch (getGapState(t))
805  {
806  case gapClosed:
807  return getLeadBound(t);
808  case gapOpen:
809  return std::min(getFrontBound(t), getLeadBound(t));
810  case gapOpening:
811  return getFrontBound(t);
812  }
813  }
814  else if (dim == 1 && der == 0)
815  {
816  double half_width = 0.5 * pveh_->get_bodyWidth();
817  switch (getGapState(t))
818  {
819  case gapClosed:
820  {
822  return -half_width + lcv_->getOffsetOfDestinationOuterBorder(s);
823  return -half_width + lcv_->getOffsetOfSeparatingBorder(s);
824  }
825  case gapOpen:
826  {
828  {
829  if (s > getChaseBound(t))
830  return -half_width + lcv_->getOffsetOfDestinationOuterBorder(s);
831  return -half_width + lcv_->getOffsetOfSeparatingBorder(s);
832  }
833  return -half_width + lcv_->getOffsetOfStartOuterBorder(s);
834  }
835  case gapOpening:
836  {
838  return -half_width + lcv_->getOffsetOfSeparatingBorder(s);
839  return -half_width + lcv_->getOffsetOfStartOuterBorder(s);
840  }
841  }
842  }
843  return 1.0e6;
844  }
845  virtual double getLB(int dim, int der, double t, double s, double ds) const override
846  {
847  if (dim == 0 && der == 0)
848  {
849  switch (getGapState(t))
850  {
851  case gapOpen:
852  return -1.0e6;
853  case gapClosed:
854  return getChaseBound(t);
855  case gapOpening:
856  return -1.0e6;
857  }
858  }
859  else if (dim == 1 && der == 0)
860  {
861  double half_width = 0.5 * pveh_->get_bodyWidth();
862  switch (getGapState(t))
863  {
864  case gapClosed:
865  {
867  return half_width + lcv_->getOffsetOfSeparatingBorder(s);
868  return half_width + lcv_->getOffsetOfDestinationOuterBorder(s);
869  }
870  case gapOpen:
871  {
873  return half_width + lcv_->getOffsetOfStartOuterBorder(s);
874  if (s > getChaseBound(t))
875  return half_width + lcv_->getOffsetOfDestinationOuterBorder(s);
876  return half_width + lcv_->getOffsetOfSeparatingBorder(s);
877  }
878  case gapOpening:
879  {
881  return half_width + lcv_->getOffsetOfStartOuterBorder(s);
882  return half_width + lcv_->getOffsetOfSeparatingBorder(s);
883  }
884  }
885  }
886  return -1.0e6;
887  }
888  virtual bool getReferenceIfAvailable(int dim, int der, double t, double s, double ds, double &ref) const override
889  {
890  if (dim == 0 && der == 0)
891  {
892  switch (getGapState(t))
893  {
894  case gapOpen:
895  ref = getFrontBound(t);
896  return true;
897  case gapOpening: // fix -Wswitch
898  // TODO investigate if not setting ref is actually a bug
899  return false;
900  case gapClosed:
901  ref = getLeadBound(t);
902  return true;
903  }
904  return false;
905  }
906  if (dim == 1 && der == 0)
907  {
908  switch (getGapState(t))
909  {
910  case gapOpen:
911  {
912  if (s > getChaseBound(t))
913  {
915  }
916  else
917  {
918  double d = lcv_->getOffsetOfSeparatingBorder(s);
919  d = d > 0 ? d - 0.5 * pveh_->get_bodyWidth() : d + 0.5 * pveh_->get_bodyWidth();
920  ref = 0.5 * d;
921  }
922  return true;
923  }
924  case gapOpening:
925  {
926  double d = lcv_->getOffsetOfSeparatingBorder(s);
927  d = d > 0 ? d - 0.5 * pveh_->get_bodyWidth() : d + 0.5 * pveh_->get_bodyWidth();
928  ref = 0.5 * d;
929  return true;
930  }
931  case gapClosed:
932  {
934  return true;
935  }
936  }
937  return false;
938  }
939  return false;
940  }
941  virtual void update(double t0, double s0, double ds0) override
942  {
943  t0_ = t0;
944  double to_rear = pveh_->get_d() + pgen_->get_rho();
945  double to_front = pveh_->get_a() + pveh_->get_b() + pveh_->get_c() - pgen_->get_rho();
946  const adore::view::TrafficQueue &traffic_original_lane = lfv_->getOnLaneTraffic();
947  const adore::view::TrafficQueue &traffic_target_lane = lcv_->getTargetLane()->getOnLaneTraffic();
948  // front constraint
949  s_front_t0_ = 1.0e6; //initialize unbounded
950  v_front_t0_ = 0.0;
951  for (auto &object : traffic_original_lane)
952  {
953  double object_v0 = object.getCurrentSpeed();
954  double delay = t0_ - object.getObservationTime();
955  double object_s0 = object.getCurrentProgress() - object.getLength() * 0.5 - to_front + delay * object_v0;
956  if (object_s0 > s0)
957  {
958  double buffer = object_v0 * ptac_->getFrontTimeGap() + ptac_->getFrontSGap();
959  s_front_t0_ = object_s0 - buffer;
960  v_front_t0_ = object_v0;
961  break;
962  }
963  }
964  // lead constraint
965  s_lead_t0_ = 1.0e6; // initialize unbounded
966  v_lead_t0_ = 0.0;
967  double s_lead_coord = 1.0e6; // var for calculating new s_ coordinate
968  auto object_it = traffic_target_lane.begin();
969  for (; object_it != traffic_target_lane.end(); ++object_it)
970  {
971  double object_v0 = object_it->getCurrentSpeed();
972  double delay = t0_ - object_it->getObservationTime();
973  double object_s0 = object_it->getCurrentProgress() - object_it->getLength() * 0.5 - to_front + delay * object_v0;
974  if (object_s0 > s_)
975  {
976  double buffer = object_v0 * ptac_->getFrontTimeGap() + ptac_->getFrontSGap();
977  s_lead_t0_ = object_s0 - buffer;
978  v_lead_t0_ = object_v0;
979  s_lead_coord = object_s0;
980  break;
981  }
982  }
983  // chase constraint
984  s_chase_t0_ = -1.0e6; //initialize unbounded
985  v_chase_t0_ = 0.0;
986  double s_chase_coord = -1.0e6; // var for calculating new s_ coordinate
987  if (object_it != traffic_target_lane.begin())
988  {
989  std::advance(object_it, -1);
990  double object_v0 = object_it->getCurrentSpeed();
991  double delay = t0_ - object_it->getObservationTime();
992  double object_s0 = object_it->getCurrentProgress() + object_it->getLength() * 0.5 + to_rear + delay * object_v0;
993  double buffer = object_v0 * ptac_->getRearTimeGap() + ptac_->getRearSGap();
994  s_chase_t0_ = object_s0 + buffer;
995  v_chase_t0_ = object_v0;
996  s_chase_coord = object_s0;
997  }
998  // update the s coordinate so that it will be approximately in de middle of the gap in t + 0.1
999  if (s_chase_t0_ > -1.0e5 && s_lead_t0_ < 1.0e5) // chase and lead exist
1000  {
1001  s_ = 0.5 * (s_chase_coord + 0.1 * v_chase_t0_ + s_lead_coord + 0.1 * v_lead_t0_);
1002  }
1003  else if (s_chase_t0_ > -1.0e5) // chase exists, lead not
1004  {
1005  s_ = 0.5 * (s_chase_coord + 0.1 * v_chase_t0_ + s0 + 0.1 * ds0);
1006  }
1007  else if (s_lead_t0_ < 1.0e5) // lead exists, chase not
1008  {
1009  s_ = 0.5 * (s_lead_t0_ + 0.1 * v_lead_t0_ + s0 + 0.1 * ds0);
1010  }
1011  else // neither lead nor chase exists
1012  {
1013  s_ = s0 + 0.1 * ds0;
1014  }
1015  }
1016  double getFrontBound(double t) const
1017  {
1018  return s_front_t0_ + v_front_t0_ * (t - t0_);
1019  }
1020  double getLeadBound(double t) const
1021  {
1022  return s_lead_t0_ + v_lead_t0_ * (t - t0_);
1023  }
1024  double getChaseBound(double t) const
1025  {
1026  return s_chase_t0_ + v_chase_t0_ * (t - t0_);
1027  }
1028  double getGapCoordinate() const
1029  {
1030  return s_;
1031  }
1032  void setGapCoordinate(double s)
1033  {
1034  s_ = s;
1035  }
1036 };
1037 
1038 } // namespace fun
1039 } // namespace adore
Definition: anominalplanner.h:52
ConstraintDirection
Definition: anominalplanner.h:55
@ LB
Definition: anominalplanner.h:56
@ UB
Definition: anominalplanner.h:56
Definition: anominalplannerinformation.h:27
Definition: anominalplanner.h:96
Definition: lanechangeconstraintsandreferences.h:278
virtual int getDimension() override
Definition: lanechangeconstraintsandreferences.h:401
adore::params::APLateralPlanner * plat_
Definition: lanechangeconstraintsandreferences.h:283
double width_
Definition: lanechangeconstraintsandreferences.h:284
double hard_safety_distance_
Definition: lanechangeconstraintsandreferences.h:285
LaneChangePhaseEstimator * phaseEstimator_
Definition: lanechangeconstraintsandreferences.h:281
adore::view::ALaneChangeView * lcv_
Definition: lanechangeconstraintsandreferences.h:280
double soft_safety_distance_
Definition: lanechangeconstraintsandreferences.h:286
virtual void update(double t0, double s0, double ds0) override
Definition: lanechangeconstraintsandreferences.h:387
ConstraintDirection direction_
Definition: lanechangeconstraintsandreferences.h:288
AdvancedLateralOffsetConstraintLC(adore::view::ALaneChangeView *lcv, LaneChangePhaseEstimator *phaseEstimator, adore::params::APVehicle *pv, adore::params::APLateralPlanner *plat, ConstraintDirection direction)
Definition: lanechangeconstraintsandreferences.h:291
void setGap(adore::view::AGap *gap)
Definition: lanechangeconstraintsandreferences.h:298
double min_control_space_
Definition: lanechangeconstraintsandreferences.h:287
adore::view::AGap * gap_
Definition: lanechangeconstraintsandreferences.h:289
virtual double getValue(double t, double s, double ds) const override
Definition: lanechangeconstraintsandreferences.h:300
adore::params::APVehicle * pv_
Definition: lanechangeconstraintsandreferences.h:282
virtual int getDerivative() override
Definition: lanechangeconstraintsandreferences.h:405
virtual ConstraintDirection getDirection() override
Definition: lanechangeconstraintsandreferences.h:397
Definition: lanechangeconstraintsandreferences.h:693
virtual int getDimension() override
Definition: lanechangeconstraintsandreferences.h:712
virtual void update(double t0, double s0, double ds0) override
Definition: lanechangeconstraintsandreferences.h:709
adore::view::ALaneChangeView * lcv_
Definition: lanechangeconstraintsandreferences.h:695
CancelMergeReference(adore::view::ALaneChangeView *lcv)
Definition: lanechangeconstraintsandreferences.h:697
virtual bool getValueIfAvailable(double t, double s, double ds, double &ref) const override
Definition: lanechangeconstraintsandreferences.h:699
virtual int getDerivative() override
Definition: lanechangeconstraintsandreferences.h:716
Definition: lanechangeconstraintsandreferences.h:726
ContinueLCReference(adore::view::ALaneChangeView *lcv)
Definition: lanechangeconstraintsandreferences.h:730
adore::view::ALaneChangeView * lcv_
Definition: lanechangeconstraintsandreferences.h:728
virtual void update(double t0, double s0, double ds0) override
Definition: lanechangeconstraintsandreferences.h:742
virtual bool getValueIfAvailable(double t, double s, double ds, double &ref) const override
Definition: lanechangeconstraintsandreferences.h:732
virtual int getDerivative() override
Definition: lanechangeconstraintsandreferences.h:749
virtual int getDimension() override
Definition: lanechangeconstraintsandreferences.h:745
Definition: lanechangeconstraintsandreferences.h:417
virtual int getDerivative() override
Definition: lanechangeconstraintsandreferences.h:455
virtual ConstraintDirection getDirection() override
Definition: lanechangeconstraintsandreferences.h:447
virtual int getDimension() override
Definition: lanechangeconstraintsandreferences.h:451
FollowPrecedingVehicleOnLaneToBeLeft_BrakingCurve(adore::view::ALane *lane, LaneChangePhaseEstimator *phaseEstimator, const adore::params::APVehicle *pveh, const adore::params::APTacticalPlanner *ptac, const adore::params::APTrajectoryGeneration *pgen)
Definition: lanechangeconstraintsandreferences.h:422
fun::FollowPrecedingVehicle_BreakingCurve * fpv
Definition: lanechangeconstraintsandreferences.h:419
~FollowPrecedingVehicleOnLaneToBeLeft_BrakingCurve()
Definition: lanechangeconstraintsandreferences.h:431
virtual double getValue(double t, double s, double ds) const override
Definition: lanechangeconstraintsandreferences.h:435
virtual void update(double t0, double s0, double ds0) override
Definition: lanechangeconstraintsandreferences.h:443
LaneChangePhaseEstimator * phaseEstimator_
Definition: lanechangeconstraintsandreferences.h:420
Definition: basicconstraintsandreferences.h:917
virtual double getValue(double t, double s, double ds) const override
Definition: basicconstraintsandreferences.h:934
virtual void update(double t0, double s0, double ds0) override
Definition: basicconstraintsandreferences.h:940
Definition: lanechangeconstraintsandreferences.h:579
double d_
Definition: lanechangeconstraintsandreferences.h:589
double width_
Definition: lanechangeconstraintsandreferences.h:585
adore::view::AGap * gap_
Definition: lanechangeconstraintsandreferences.h:584
double i_grid_
lateral grid scale
Definition: lanechangeconstraintsandreferences.h:590
double hard_safety_distance_
Definition: lanechangeconstraintsandreferences.h:586
virtual void update(double t0, double s0, double ds0) override
Definition: lanechangeconstraintsandreferences.h:671
double soft_safety_distance_
Definition: lanechangeconstraintsandreferences.h:587
virtual int getDerivative() override
Definition: lanechangeconstraintsandreferences.h:683
LaneChangeIntoGapReference(adore::view::ALaneChangeView *lcv, adore::params::APVehicle *pv, adore::params::APLateralPlanner *plat, double i_grid=0.0)
Definition: lanechangeconstraintsandreferences.h:592
virtual int getDimension() override
Definition: lanechangeconstraintsandreferences.h:679
double min_control_space_
Definition: lanechangeconstraintsandreferences.h:588
adore::params::APLateralPlanner * plat_
Definition: lanechangeconstraintsandreferences.h:583
void setGap(adore::view::AGap *gap)
Definition: lanechangeconstraintsandreferences.h:594
adore::view::ALaneChangeView * lcv_
Definition: lanechangeconstraintsandreferences.h:581
adore::params::APVehicle * pv_
Definition: lanechangeconstraintsandreferences.h:582
virtual bool getValueIfAvailable(double t, double s, double ds, double &ref) const override
Definition: lanechangeconstraintsandreferences.h:596
Definition: lanechangeconstraintsandreferences.h:189
double t0_
Definition: lanechangeconstraintsandreferences.h:201
virtual void update(double t0, double s0, double ds0) override
Definition: lanechangeconstraintsandreferences.h:236
adore::view::ALaneChangeView * lcv_
Definition: lanechangeconstraintsandreferences.h:191
adore::params::APTacticalPlanner * ptac_
Definition: lanechangeconstraintsandreferences.h:195
LaneChangePhaseEstimator(adore::view::ALaneChangeView *lcv, adore::params::APVehicle *pv, adore::params::APLateralPlanner *plat, adore::params::APTrajectoryGeneration *pgen, adore::params::APTacticalPlanner *ptac)
Definition: lanechangeconstraintsandreferences.h:203
void setGap(adore::view::AGap *gap)
Definition: lanechangeconstraintsandreferences.h:205
adore::params::APTrajectoryGeneration * pgen_
Definition: lanechangeconstraintsandreferences.h:194
adore::params::APLateralPlanner * plat_
Definition: lanechangeconstraintsandreferences.h:193
adore::params::APVehicle * pveh_
Definition: lanechangeconstraintsandreferences.h:192
double sgap_
Definition: lanechangeconstraintsandreferences.h:200
double width_
Definition: lanechangeconstraintsandreferences.h:197
double v_front_t0_
Definition: lanechangeconstraintsandreferences.h:199
double s_front_t0_
Definition: lanechangeconstraintsandreferences.h:198
adore::view::AGap * gap_
Definition: lanechangeconstraintsandreferences.h:196
virtual int getDerivative() override
Definition: lanechangeconstraintsandreferences.h:268
LaneChangePhase getLaneChangePhase(double t, double s)
Definition: lanechangeconstraintsandreferences.h:207
virtual int getDimension() override
Definition: lanechangeconstraintsandreferences.h:264
virtual bool getValueIfAvailable(double t, double s, double ds, double &ref) const override
Definition: lanechangeconstraintsandreferences.h:232
Definition: lanechangeconstraintsandreferences.h:40
virtual int getDerivative() override
Definition: lanechangeconstraintsandreferences.h:176
double hard_safety_distance_
Definition: lanechangeconstraintsandreferences.h:46
adore::view::AGap * gap_
Definition: lanechangeconstraintsandreferences.h:50
ConstraintDirection direction_
Definition: lanechangeconstraintsandreferences.h:49
adore::params::APVehicle * pv_
Definition: lanechangeconstraintsandreferences.h:43
void setGap(adore::view::AGap *gap)
Definition: lanechangeconstraintsandreferences.h:58
adore::params::APLateralPlanner * plat_
Definition: lanechangeconstraintsandreferences.h:44
LateralOffsetConstraintLC(adore::view::ALaneChangeView *lcv, adore::params::APVehicle *pv, adore::params::APLateralPlanner *plat, ConstraintDirection direction)
Definition: lanechangeconstraintsandreferences.h:52
adore::view::ALaneChangeView * lcv_
Definition: lanechangeconstraintsandreferences.h:42
virtual double getValue(double t, double s, double ds) const override
Definition: lanechangeconstraintsandreferences.h:60
double width_
Definition: lanechangeconstraintsandreferences.h:45
double soft_safety_distance_
Definition: lanechangeconstraintsandreferences.h:47
virtual int getDimension() override
Definition: lanechangeconstraintsandreferences.h:172
virtual void update(double t0, double s0, double ds0) override
Definition: lanechangeconstraintsandreferences.h:158
double min_control_space_
Definition: lanechangeconstraintsandreferences.h:48
virtual ConstraintDirection getDirection() override
Definition: lanechangeconstraintsandreferences.h:168
Definition: lanechangeconstraintsandreferences.h:468
virtual int getDimension() override
Definition: lanechangeconstraintsandreferences.h:564
adore::view::ALaneChangeView * lcv_
Definition: lanechangeconstraintsandreferences.h:470
virtual int getDerivative() override
Definition: lanechangeconstraintsandreferences.h:568
virtual void update(double t0, double s0, double ds0) override
Definition: lanechangeconstraintsandreferences.h:551
ConstraintDirection direction_
Definition: lanechangeconstraintsandreferences.h:477
virtual double getValue(double t, double s, double ds) const override
Definition: lanechangeconstraintsandreferences.h:486
adore::params::APVehicle * pv_
Definition: lanechangeconstraintsandreferences.h:471
double soft_safety_distance_
Definition: lanechangeconstraintsandreferences.h:475
double hard_safety_distance_
Definition: lanechangeconstraintsandreferences.h:474
LateralOffsetConstraintLM(adore::view::ALaneChangeView *lcv, adore::params::APVehicle *pv, adore::params::APLateralPlanner *plat, ConstraintDirection direction)
Definition: lanechangeconstraintsandreferences.h:479
virtual ConstraintDirection getDirection() override
Definition: lanechangeconstraintsandreferences.h:560
adore::params::APLateralPlanner * plat_
Definition: lanechangeconstraintsandreferences.h:472
double width_
Definition: lanechangeconstraintsandreferences.h:473
double min_control_space_
Definition: lanechangeconstraintsandreferences.h:476
Definition: lanechangeconstraintsandreferences.h:759
adore::view::ALaneChangeView * lcv_
Definition: lanechangeconstraintsandreferences.h:762
double s_front_t0_
Definition: lanechangeconstraintsandreferences.h:766
virtual double getUB(int dim, int der, double t, double s, double ds) const override
getUB returns the upper bound for the offset's der's derivative in dimension dim
Definition: lanechangeconstraintsandreferences.h:800
double s_
Definition: lanechangeconstraintsandreferences.h:773
double v_lead_t0_
Definition: lanechangeconstraintsandreferences.h:769
virtual void update(double t0, double s0, double ds0) override
update update all constraints and references
Definition: lanechangeconstraintsandreferences.h:941
const adore::params::APVehicle * pveh_
Definition: lanechangeconstraintsandreferences.h:764
void setGapCoordinate(double s)
Definition: lanechangeconstraintsandreferences.h:1032
double getFrontBound(double t) const
Definition: lanechangeconstraintsandreferences.h:1016
virtual double getLB(int dim, int der, double t, double s, double ds) const override
getLB returns the lower bound for the offset's der's derivative in dimension dim
Definition: lanechangeconstraintsandreferences.h:845
double s_chase_t0_
Definition: lanechangeconstraintsandreferences.h:770
virtual bool getReferenceIfAvailable(int dim, int der, double t, double s, double ds, double &ref) const override
getReferenceIfAvailable returns true if the reference for the dimension and derivative is available a...
Definition: lanechangeconstraintsandreferences.h:888
double getChaseBound(double t) const
Definition: lanechangeconstraintsandreferences.h:1024
double getGapCoordinate() const
Definition: lanechangeconstraintsandreferences.h:1028
adore::view::ALane * lfv_
Definition: lanechangeconstraintsandreferences.h:761
const adore::params::APTacticalPlanner * ptac_
Definition: lanechangeconstraintsandreferences.h:763
gapState getGapState(double t) const
Definition: lanechangeconstraintsandreferences.h:788
StdGapConstraintAndReference(adore::view::ALane *lfv, adore::view::ALaneChangeView *lcv, const adore::params::APVehicle *pveh, const adore::params::APTacticalPlanner *ptac, const adore::params::APTrajectoryGeneration *pgen)
Definition: lanechangeconstraintsandreferences.h:782
double s_lead_t0_
Definition: lanechangeconstraintsandreferences.h:768
double t0_
Definition: lanechangeconstraintsandreferences.h:772
double v_front_t0_
Definition: lanechangeconstraintsandreferences.h:767
double getLeadBound(double t) const
Definition: lanechangeconstraintsandreferences.h:1020
const adore::params::APTrajectoryGeneration * pgen_
Definition: lanechangeconstraintsandreferences.h:765
gapState
Definition: lanechangeconstraintsandreferences.h:775
@ gapClosed
Definition: lanechangeconstraintsandreferences.h:778
@ gapOpen
Definition: lanechangeconstraintsandreferences.h:776
@ gapOpening
Definition: lanechangeconstraintsandreferences.h:777
double v_chase_t0_
Definition: lanechangeconstraintsandreferences.h:771
abstract class containing parameters related to configuring the lateral planner
Definition: ap_lateral_planner.h:26
virtual double getMinimumLateralControlSpace() const =0
getMinimumLateralControlSpace returns the minimum desired lateral control space: If vehicle has more ...
virtual double getLateralGridScale() const =0
getLateralGridScale returns the size of a grid step d for lateral variations of a maneuver: maneuver ...
virtual double getHardSafetyDistanceToLaneBoundary() const =0
getHardSafetyDistanceToLaneBoundary returns the minimum distance between lane boundary and vehicle si...
virtual double getSoftSafetyDistanceToLaneBoundary() const =0
getSoftSafetyDistanceToLaneBoundary returns the minimum distance between lane boundary and vehicle si...
abstract classs containing parameters to configure aspects and constraints of the tactical planner
Definition: ap_tactical_planner.h:25
virtual double getFrontSGap() const =0
virtual double getRearSGap() const =0
virtual double getRearTimeGap() const =0
virtual double getFrontTimeGap() const =0
abstract class containing parameters to configure the behaviour of trajectory generation
Definition: ap_trajectory_generation.h:26
virtual double get_rho() const =0
cor to planning point: movement of planning point shall planned by the trajectory planner
abstract class for vehicle configuration related paremeters
Definition: ap_vehicle.h:29
virtual double get_b() const =0
rear axle to cog
virtual double get_bodyWidth() const =0
virtual double get_d() const =0
rear border to rear axle
virtual double get_a() const =0
cog to front axle
virtual double get_c() const =0
front axle to front border
defines a gap in traffic, into which a merge may be planned
Definition: agap.h:25
@ OPEN
Definition: agap.h:30
@ CLOSED
Definition: agap.h:31
@ OPENING
Definition: agap.h:29
virtual EGapState getState(double s, double t)=0
get the state of the gap at a certain time, depending on ego position
Definition: alanechangeview.h:27
virtual direction getLCDirection() const =0
virtual double getProgressOfGateOpen() const =0
virtual double getOffsetOfDestinationOuterBorder(double s)=0
@ LEFT
Definition: alanechangeview.h:43
virtual ALane * getTargetLane()=0
virtual double getProgressOfGateClosed() const =0
virtual double getOffsetOfSeparatingBorder(double s)=0
virtual double getOffsetOfStartOuterBorder(double s)=0
virtual ALane * getSourceLane()=0
Definition: alane.h:28
virtual const TrafficQueue & getOnLaneTraffic() const =0
virtual double getOffsetOfRightBorder(double s)=0
virtual bool isValid() const =0
virtual double getOffsetOfLeftBorder(double s)=0
LaneChangePhase
Definition: lanechangeconstraintsandreferences.h:30
@ undefined
Definition: lanechangeconstraintsandreferences.h:34
@ transition
Definition: lanechangeconstraintsandreferences.h:32
@ postTransition
Definition: lanechangeconstraintsandreferences.h:33
@ preTransition
Definition: lanechangeconstraintsandreferences.h:31
T min(T a, T b, T c, T d)
Definition: adoremath.h:663
std::vector< TrafficObject > TrafficQueue
Definition: trafficobject.h:183
Definition: areaofeffectconverter.h:20