ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
informationsetpostprocessing.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  ********************************************************************************/
14 
15 #pragma once
18 
19 namespace adore
20 {
21  namespace fun
22  {
30  template<int N,int D>
32  {
33  public:
35  private:
37  public://
39  {
40  return info_;
41  }
49  template<int K>
50  bool isLongitudinalPlanValid(double t0_offset, double s0_offset,
52  {
53  double trel,t,s,ds;
54  auto& data = longitudinal_plan->getData();
55  for(int i=0;i<data.nc();i++)
56  {
57  trel = data(0,i);
58  t = trel + t0_offset;
59  s = data(1,i) + s0_offset;
60  ds = data(2,i);
61  auto value = longitudinal_plan->f(trel);
62  value(0) = value(0) + s0_offset;
63 
64  for(int der = 0; der<K && der<N; der++)//loop over derivative order
65  {
66  if(!(info_.getLB(0,der,t,s,ds)<=value(der) && value(der)<=info_.getUB(0,der,t,s,ds)))return false;
67  }
68  }
69  return true;
70  }
81  template<int K1,int K2>
82  bool isLateralPlanValid(double t0_offset, double s0_offset,
85  {
86  double trel,t,s,ds;
87  auto& data = longitudinal_plan->getData();
88  for(int i=0;i<data.nc();i++)
89  {
90  trel = data(0,i);
91  t = trel + t0_offset;
92  s = data(1,i) + s0_offset;
93  ds = data(2,i);
94  auto value = lateral_plan->f(trel);
95 
96  for(int der = 0; der<K2 && der<N; der++)//loop over derivative order
97  {
98  if(!(info_.getLB(1,der,t,s,ds)<=value(der) && value(der)<=info_.getUB(1,der,t,s,ds)))return false;
99  }
100  }
101  return true;
102  }
103  };
104  }
105 }
Definition: informationsetpostprocessing.h:32
NominalPlannerInformationSet< N+1, 2 > TInformationSet
Definition: informationsetpostprocessing.h:34
TInformationSet & getInformationSet()
Definition: informationsetpostprocessing.h:38
bool isLateralPlanValid(double t0_offset, double s0_offset, adore::mad::LLinearPiecewiseFunctionM< double, K1 > *longitudinal_plan, adore::mad::LLinearPiecewiseFunctionM< double, K2 > *lateral_plan)
Definition: informationsetpostprocessing.h:82
bool isLongitudinalPlanValid(double t0_offset, double s0_offset, adore::mad::LLinearPiecewiseFunctionM< double, K > *longitudinal_plan)
Definition: informationsetpostprocessing.h:50
TInformationSet info_
Definition: informationsetpostprocessing.h:36
virtual double getLB(int dim, int der, double t, double s, double ds) const override
Definition: anominalplannerinformation.h:190
virtual double getUB(int dim, int der, double t, double s, double ds) const override
Definition: anominalplannerinformation.h:168
Definition: llinearpiecewisefunction.h:139
virtual CT f(DT x) const override
Definition: llinearpiecewisefunction.h:251
adoreMatrix< T, n+1, 0 > & getData()
Definition: llinearpiecewisefunction.h:147
Definition: areaofeffectconverter.h:20