ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
terminal_controller.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
19 #include <adore/mad/adoremath.h>
22 
23 namespace adore
24 {
25  namespace fun
26  {
33  {
34  private:
37  public:
51  {
52  double cpsi = std::cos(term.getPSI());
53  double spsi = std::sin(term.getPSI());
54  double dx = cpsi*(x.getX()-term.getX())+spsi*(x.getY()-term.getY());
55  double dy =-spsi*(x.getX()-term.getX())+cpsi*(x.getY()-term.getY());
56  double cpsiego = std::cos(x.getPSI());
57  double spsiego = std::sin(x.getPSI());
58  double dpsix = cpsi*cpsiego+spsi*spsiego;
59  double dpsiy =-spsi*cpsiego+cpsi*spsiego;
60  double dpsi = std::atan2(dpsiy,dpsix);
61  if(dx<0.0)
62  {
63  double a = 0.5*x.getvx()*x.getvx()/dx;
65  }
66  else
67  {
69  }
70  if(x.getvx()>0.1)
71  {
72  //@TODO: use a point different from the COR
74  }
75  else
76  {
77  u.setSteeringAngle(0.0);
78  }
79  }
80  };
81  }
82 }
Definition: motioncommand.h:26
void setAcceleration(double acceleration)
Definition: motioncommand.h:51
void setSteeringAngle(double steeringAngle)
Definition: motioncommand.h:41
Definition: terminal_controller.h:33
adore::params::APVehicle * ap_v_
Definition: terminal_controller.h:36
void compute_control_input(const VehicleMotionState9d &x, const TerminalRequest &term, MotionCommand &u)
Definition: terminal_controller.h:50
adore::params::APEmergencyOperation * ap_em_
Definition: terminal_controller.h:35
TerminalController(adore::params::APEmergencyOperation *ap_em, adore::params::APVehicle *ap_v)
Definition: terminal_controller.h:43
Definition: terminalrequest.h:27
double getPSI() const
Definition: terminalrequest.h:42
double getY() const
Definition: terminalrequest.h:41
double getX() const
Definition: terminalrequest.h:40
abstract class containing parameters concerning emergency operation behaviour
Definition: ap_emergency_operation.h:25
virtual double getDeltaMin() const =0
virtual double getamin() const =0
virtual double getKpsi() const =0
virtual double getKy() const =0
virtual double getDeltaMax() const =0
abstract class for vehicle configuration related paremeters
Definition: ap_vehicle.h:29
interval< T > atan2(interval< T > y, interval< T > x)
Definition: intervalarithmetic.h:234
interval< T > cos(interval< T > x)
Definition: intervalarithmetic.h:225
T bound(T lb, T value, T ub)
Definition: adoremath.h:569
interval< T > sin(interval< T > x)
Definition: intervalarithmetic.h:204
adoreMatrix< T, N, M > max(adoreMatrix< T, N, M > a, const adoreMatrix< T, N, M > &b)
Definition: adoremath.h:686
x
Definition: adore_set_goal.py:30
Definition: areaofeffectconverter.h:20
This struct holds the motion state of the vehicle in 9d.
Definition: vehiclemotionstate9d.h:39