ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
plot_predictions_minimal.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 implementation
13  ********************************************************************************/
14 
15 #pragma once
19 #include <adore/env/afactory.h>
20 #include <plotlablib/afigurestub.h>
21 #include <plotlablib/plcommands.h>
22 #include <unordered_set>
23 #include <string>
24 
25 
26 namespace adore
27 {
28  namespace apps
29  {
35  {
36  private:
38 
39  std::unordered_set<std::string> plot_tags_old_worstcase_;
40  std::unordered_set<std::string> plot_tags_current_worstcase_;
41 
42  std::unordered_set<std::string> plot_tags_old_expected_;
43  std::unordered_set<std::string> plot_tags_current_expected_;
44 
45  std::unordered_set<std::string> plot_tags_old_desired_;
46  std::unordered_set<std::string> plot_tags_current_desired_;
47 
48  std::unordered_set<std::string> plot_tags_old_static_;
49  std::unordered_set<std::string> plot_tags_current_static_;
50 
52  unsigned long long counter_;
54  std::string prefix_;
55 
60 
65 
68  double fov_width_;
69  double fov_height_;
70  // int urlPreset_;
71  double t_;
73 
75 
76  public:
77  // FancyBird(DLR_TS::PlotLab::AFigureStub* figure,adore::params::APVehicle* pvehicle, adore::params::APMapProvider* pmap,std::string prefix,const adore::PLOT::FancyBirdConfig & config, const adore::PLOT::GeoTilesConfig geoTiles_config)
79  {
80  counter_=0;
82  figure_ = figure;
83  prefix_ = prefix;
84  t_ = 0;
85  t_prediction_max_ = config_.t_prediction_max; // TODO: reconsidder where to get this max from, currently a plot property
86  fov_width_ = 640.0;
87  fov_height_ = 480.0;
88  config_ = config;
89 
94  }
95 
97  {
98  // geoTiles_->~GeoTiles();
99  }
100 
101  void run()
102  {
103 
105  {
107  t_ = position_.getTime();
108  }
109 
110  /* Worst Case Prediction Feed */
112  {
115 
116  std::stringstream tag;
117  tag << prefix_ << "/wcp";
120 
121  for(auto s:plot_tags_old_worstcase_)
122  {
124  {
125  figure_->erase(s);
126  }
127  }
128  }
129 
130  // /* Expected Prediction Feed */
132  {
135 
136  std::stringstream tag;
137  tag << prefix_ << "/ecp";
140 
141  for(auto s:plot_tags_old_expected_)
142  {
144  {
145  figure_->erase(s);
146  }
147  }
148  }
149 
150  // /* Desired Prediction Feed */
152  {
155 
156  std::stringstream tag;
157  tag << prefix_ << "/dcp";
160 
161  for(auto s:plot_tags_old_desired_)
162  {
164  {
165  figure_->erase(s);
166  }
167  }
168  }
169 
170  // /* static obstacles Feed */
172  {
175 
176  std::stringstream tag;
177  tag << prefix_ << "/sop";
180 
181  for(auto s:plot_tags_old_static_)
182  {
184  {
185  figure_->erase(s);
186  }
187  }
188  }
189 
190  }
191 
192 
193  };
194  }
195 }
Definition: afigurestub.h:24
virtual void erase(std::string hashtag)=0
Definition: prediction_config.h:24
prediction_config static_
Definition: prediction_config.h:74
prediction_config expected_
Definition: prediction_config.h:71
prediction_config desired_
Definition: prediction_config.h:70
prediction_config worst_case_
Definition: prediction_config.h:72
double t_prediction_max
Definition: prediction_config.h:76
a plot module for handling prediction plots
Definition: plot_predictions_minimal.h:35
std::unordered_set< std::string > plot_tags_old_expected_
Definition: plot_predictions_minimal.h:42
std::unordered_set< std::string > plot_tags_current_static_
Definition: plot_predictions_minimal.h:49
int plotCount_
Definition: plot_predictions_minimal.h:66
~PlotPredictionsMinimal()
Definition: plot_predictions_minimal.h:96
adore::env::OccupancyCylinderPredictionSet worst_case_predictions_
Definition: plot_predictions_minimal.h:56
PlotPredictionsMinimal(DLR_TS::PlotLab::AFigureStub *figure, std::string prefix, const adore::PLOT::PredictionConfig &config)
Definition: plot_predictions_minimal.h:78
adore::env::AFactory::TOCPredictionSetReader * staticObstaclesReader_
Definition: plot_predictions_minimal.h:64
adore::mad::AReader< adore::env::VehicleMotionState9d > * positionReader_
Definition: plot_predictions_minimal.h:37
std::unordered_set< std::string > plot_tags_old_static_
Definition: plot_predictions_minimal.h:48
double t_
Definition: plot_predictions_minimal.h:71
std::unordered_set< std::string > plot_tags_old_desired_
Definition: plot_predictions_minimal.h:45
unsigned long long counter_
Definition: plot_predictions_minimal.h:52
adore::env::VehicleMotionState9d position_
Definition: plot_predictions_minimal.h:53
std::unordered_set< std::string > plot_tags_current_expected_
Definition: plot_predictions_minimal.h:43
adore::PLOT::PredictionConfig config_
Definition: plot_predictions_minimal.h:74
int eraseCount_
Definition: plot_predictions_minimal.h:67
DLR_TS::PlotLab::AFigureStub * figure_
Definition: plot_predictions_minimal.h:51
std::unordered_set< std::string > plot_tags_current_desired_
Definition: plot_predictions_minimal.h:46
double t_prediction_max_
Definition: plot_predictions_minimal.h:72
adore::env::OccupancyCylinderPredictionSet desired_predictions_
Definition: plot_predictions_minimal.h:58
double fov_height_
Definition: plot_predictions_minimal.h:69
std::unordered_set< std::string > plot_tags_current_worstcase_
Definition: plot_predictions_minimal.h:40
adore::env::AFactory::TOCPredictionSetReader * expected_prediction_reader_
Definition: plot_predictions_minimal.h:63
std::unordered_set< std::string > plot_tags_old_worstcase_
Definition: plot_predictions_minimal.h:39
adore::env::AFactory::TOCPredictionSetReader * worst_case_prediction_reader_
Definition: plot_predictions_minimal.h:61
adore::env::OccupancyCylinderPredictionSet static_obstacles_
Definition: plot_predictions_minimal.h:59
double fov_width_
Definition: plot_predictions_minimal.h:68
adore::env::AFactory::TOCPredictionSetReader * desired_prediction_reader_
Definition: plot_predictions_minimal.h:62
void run()
Definition: plot_predictions_minimal.h:101
std::string prefix_
Definition: plot_predictions_minimal.h:54
adore::env::OccupancyCylinderPredictionSet expected_predictions_
Definition: plot_predictions_minimal.h:57
virtual TOCPredictionSetReader * getExpectedPredictionSetReader()=0
virtual TOCPredictionSetReader * getStaticObstaclesPredictionSetReader()=0
virtual TVehicleMotionStateReader * getVehicleMotionStateReader()=0
virtual TOCPredictionSetReader * getWorstCasePredictionSetReader()=0
virtual TOCPredictionSetReader * getDesiredPredictionSetReader()=0
static adore::env::AFactory * get()
Definition: afactory.h:236
virtual void getData(T &value)=0
virtual bool hasUpdate() const =0
void plotPredictionSet(adore::env::OccupancyCylinderPredictionSet set, double t, double t_max, PLOT::PredictionConfig::prediction_config config, std::string subtopic, DLR_TS::PlotLab::AFigureStub *figure, std::unordered_set< std::string > &plot_tags)
Definition: plot_prediction.h:191
void plotPredictionSetMinimal(adore::env::OccupancyCylinderPredictionSet set, double dz, PLOT::PredictionConfig::prediction_config config, std::string subtopic, DLR_TS::PlotLab::AFigureStub *figure, std::unordered_set< std::string > &plot_tags)
Definition: plot_prediction.h:206
std::vector< OccupancyCylinderPrediction > OccupancyCylinderPredictionSet
Definition: occupancycylinderprediction.h:40
Definition: areaofeffectconverter.h:20
bool active_
Definition: prediction_config.h:47
This struct holds the motion state of the vehicle in 9d.
Definition: vehiclemotionstate9d.h:39
double getTime() const
Get the time.
Definition: vehiclemotionstate9d.h:48