ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
prediction_provider.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  * Thomas Lobig - initial implementation and API
13  ********************************************************************************/
14 #pragma once
15 #include <adore/env/afactory.h>
16 #include <adore/params/afactory.h>
17 // #include <adore/fun/afactory.h>
22 
23 namespace adore
24 {
25  namespace apps
26  {
29  // using EnvFactory = adore::env::EnvFactoryInstance;
31  {
32  private:
35 
39 
50  public:
53  {
58  }
59  void run()
60  {
61  roadmap_.update();
63 
64 
87 
110 
112  {
113  case 0:
118  break;
119  case 1:
124  break;
125  case 2:
130  break;
131  }
132 
133  const double dt_rb = pprediction_->get_roadbased_prediction_duration();
134  const double dt_or = pprediction_->get_offroad_prediction_duration();
135 
136  if(tpsetReader_->hasUpdate())
137  {
138  predictionSet_ex_.clear();
139  predictionSet_wc_.clear();
141  for(const auto& participant:participantSet_)
142  {
143  const double v = std::sqrt(participant.getVx()*participant.getVx()+participant.getVy()*participant.getVy());
144  const double area = participant.getWidth()*participant.getLength();
145  if(v<0.1||area>100.0)
146  {
147  predictor_straight_ex_.setTMaxUTC(participant.getObservationTime() + dt_or);
149  predictor_straight_wc_.setTMaxUTC(participant.getObservationTime() + dt_or);
151  }
152  else
153  {
154  predictor_roadbased_ex_.setTMaxUTC(participant.getObservationTime() + dt_rb);
155  predictor_straight_ex_.setTMaxUTC(participant.getObservationTime() + dt_or);
156  predictor_roadbased_wc_.setTMaxUTC(participant.getObservationTime() + dt_rb);
157  predictor_straight_wc_.setTMaxUTC(participant.getObservationTime() + dt_or);
159  {
161  }
163  {
165  }
166  }
167 
168  }
171  }
172  }
173  };
174 
175  }
176 }
Definition: prediction_provider.h:31
adore::env::AFactory::TOCPredictionSetWriter * prediction_writer_ex_
Definition: prediction_provider.h:41
adore::env::OccupancyCylinderPredictionSet predictionSet_wc_
Definition: prediction_provider.h:45
adore::env::OccupancyCylinderPredictionSet predictionSet_ex_
Definition: prediction_provider.h:40
void run()
Definition: prediction_provider.h:59
adore::env::traffic::TrafficMap traffic_map_
Definition: prediction_provider.h:37
adore::env::OCRoadBasedPrediction predictor_roadbased_ex_
Definition: prediction_provider.h:43
adore::env::AFactory::TOCPredictionSetWriter * prediction_writer_wc_
Definition: prediction_provider.h:46
adore::env::traffic::TParticipantSet participantSet_
Definition: prediction_provider.h:34
adore::env::OCStraightLinePrediction predictor_straight_wc_
Definition: prediction_provider.h:47
adore::env::OCStraightLinePrediction predictor_straight_ex_
Definition: prediction_provider.h:42
adore::env::BorderBased::LocalRoadMap roadmap_
Definition: prediction_provider.h:36
adore::params::APPrediction * pprediction_
Definition: prediction_provider.h:38
adore::env::AFactory::TParticipantSetReader * tpsetReader_
Definition: prediction_provider.h:33
adore::env::OCRoadBasedPrediction predictor_roadbased_wc_
Definition: prediction_provider.h:48
PredictionProvider()
Definition: prediction_provider.h:51
virtual TParticipantSetReader * getTrafficParticipantSetReader()=0
virtual TOCPredictionSetWriter * getWorstCaseRawPredictionSetWriter()=0
virtual TOCPredictionSetWriter * getExpectedRawPredictionSetWriter()=0
Definition: localroadmap.h:38
void update(bool matched_lane_proposal_valid=false, BorderID matched_lane_proposal_id=BorderID())
update the local road map
Definition: localroadmap.h:256
Utility class to simplify factory access.
Definition: afactory.h:220
static adore::env::AFactory * get()
Definition: afactory.h:236
Definition: ocroadbasedprediction.h:46
void setAngleErrorMax(double value)
Definition: ocroadbasedprediction.h:78
void setVMax(double value)
Definition: ocroadbasedprediction.h:83
void setAMax(double value)
Definition: ocroadbasedprediction.h:84
void setWidthLB(double value)
Definition: ocroadbasedprediction.h:92
void setAMin(double value)
Definition: ocroadbasedprediction.h:85
void setTimeHeadway(double value)
Definition: ocroadbasedprediction.h:86
void setLonError(double value)
Definition: ocroadbasedprediction.h:82
void setLatError(double value)
Definition: ocroadbasedprediction.h:81
void setWidthUB(double value)
Definition: ocroadbasedprediction.h:91
void setLateralPredictions(bool value)
Definition: ocroadbasedprediction.h:90
void setDelay(double value)
Definition: ocroadbasedprediction.h:88
void setTimeLeeway(double value)
Definition: ocroadbasedprediction.h:87
void setTMaxUTC(double value)
Definition: ocroadbasedprediction.h:79
void setLatPrecision(double value)
Definition: ocroadbasedprediction.h:80
void setLaneWidthPredictions(bool value)
Definition: ocroadbasedprediction.h:89
virtual bool predict(const traffic::Participant &p, OccupancyCylinderPredictionSet &set) const override
Definition: ocroadbasedprediction.h:104
Definition: occupancycylinderprediction.h:62
void setWidthLB(double value)
Definition: occupancycylinderprediction.h:87
void setVMax(double value)
Definition: occupancycylinderprediction.h:81
void setLatError(double value)
Definition: occupancycylinderprediction.h:79
void setLatPrecision(double value)
Definition: occupancycylinderprediction.h:78
void setWidthUB(double value)
Definition: occupancycylinderprediction.h:86
void setTimeLeeway(double value)
Definition: occupancycylinderprediction.h:85
void setTMaxUTC(double value)
Definition: occupancycylinderprediction.h:77
void setAMax(double value)
Definition: occupancycylinderprediction.h:82
virtual bool predict(const traffic::Participant &p, OccupancyCylinderPredictionSet &set) const override
Definition: occupancycylinderprediction.h:90
void setAMin(double value)
Definition: occupancycylinderprediction.h:83
void setLonError(double value)
Definition: occupancycylinderprediction.h:80
void setTimeHeadway(double value)
Definition: occupancycylinderprediction.h:84
Definition: trafficmap.h:36
void update()
Update the TrafficMap.
Definition: trafficmap.h:126
Definition: com_patterns.h:68
virtual void getData(T &value)=0
virtual bool hasUpdate() const =0
Definition: com_patterns.h:97
virtual void write(const T &value)=0
virtual APPrediction * getPrediction() const =0
parameter interface for parameters related to prediction
Definition: ap_prediction.h:28
virtual double get_offroad_expected_acc_ub() const =0
maximum acceleration for normal behavior for objects that can not be matched to road
virtual double get_offroad_expected_acc_lb() const =0
minimum acceleration for normal behavior for objects that can not be matched to road
virtual double get_prediction_width_lb() const =0
returns the minimum width for a prediction
virtual double get_offroad_worstcase_vel_ub() const =0
maximum velocity for worst-case behavior for objects that can not be matched to road
virtual double get_roadbased_lat_error() const =0
assumed maximum lateral detection error for objects that can be matched to road (buffer zone)
virtual double get_offroad_time_headway() const =0
time buffer ahead of an object (objrect predicted to arrive given seconds earlier at a location)
virtual double get_roadbased_worstcase_vel_ub() const =0
maximum velocity for worst-case for objects that can be matched to road
virtual double get_prediction_width_ub() const =0
returns maximum width for a prediction
virtual double get_roadbased_time_leeway() const =0
time buffer behind object (object predicted to leave a location given seconds later)
virtual double get_roadbased_expected_acc_ub() const =0
maximum acceleration for normal behavior for objects that can be matched to road
virtual double get_offroad_worstcase_acc_ub() const =0
maximum acceleration for worst-case behavior for objects that can not be matched to road
virtual double get_roadbased_expected_acc_lb() const =0
minimum acceleration for normal behavior for objects that can be matched to road
virtual double get_roadbased_heading_deviation_ub() const =0
maximum difference between object and road heading for object to be matchable to road
virtual double get_offroad_expected_vel_ub() const =0
maximum velocity for normal behavior for objects that can not be matched to road
virtual double get_roadbased_worstcase_acc_ub() const =0
maximum acceleration for worst-case behavior for objects that can be matched to road
virtual double get_roadbased_lat_precision() const =0
precision of object shape approximation in lateral direction for objects that can be matched to road
virtual double get_roadbased_expected_vel_ub() const =0
maximum velocity for normal behavior for objects that can be matched to road
virtual double get_roadbased_worstcase_acc_ub_delay() const =0
delay after which worstcase_acc_ub is applied
virtual double get_offroad_lat_precision() const =0
precision of object shape approximation in lateral direction for objects that can not be matched to r...
virtual double get_roadbased_lon_error() const =0
assumed maximum longitudinal detectionfor objects that can be matched to road (buffer zone)
virtual int get_setbased_prediction_strategy() const =0
returns prediction strategy: 0 width of object, 1 width of road, 2 width of object-> width of road
virtual double get_offroad_lon_error() const =0
assumed maximum longitudinal detection error for objects that can not be matched to road
virtual double get_roadbased_time_headway() const =0
time buffer ahead of an object (objrect predicted to arrive given seconds earlier at a location)
virtual double get_roadbased_expected_acc_ub_delay() const =0
delay after which expected_acc_ub is applied
virtual double get_offroad_worstcase_acc_lb() const =0
minimum acceleration for worst-case behavior for objects that can not be matched to road
virtual double get_roadbased_prediction_duration() const =0
prediction duration for objects that can be matched to road
virtual double get_offroad_time_leeway() const =0
time buffer behind object (object predicted to leave a location given seconds later)
virtual double get_offroad_lat_error() const =0
assumed maximum lateral detection error for objects that can not be matched to road
virtual double get_offroad_prediction_duration() const =0
prediction duration for objects that can not be matched to road
virtual double get_roadbased_worstcase_acc_lb() const =0
minimum acceleration for worst-case for objects that can be matched to road
Utility class to simplify factory access.
Definition: afactory.h:87
static adore::params::AFactory * get()
Definition: afactory.h:103
adore::env::EnvFactoryInstance EnvFactory
Definition: prediction_filter.h:34
adore::params::ParamsFactoryInstance ParamsFactory
Definition: prediction_filter.h:35
std::vector< Participant > TParticipantSet
Definition: participant.h:164
std::vector< OccupancyCylinderPrediction > OccupancyCylinderPredictionSet
Definition: occupancycylinderprediction.h:40
Definition: areaofeffectconverter.h:20