ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
lane_following_behavior.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 
16 #pragma once
17 
18 #include <adore/fun/afactory.h>
19 #include <adore/params/afactory.h>
22 
23 namespace adore
24 {
25  namespace apps
26  {
33  {
34  private:
43  public:
45  {
47  delete prwriter_;
48  delete reqwriter_;
49  }
51  {
53  prwriter_ = adore::fun::FunFactoryInstance::get()->getPlanningResultWriter();
54  reqwriter_ = adore::fun::FunFactoryInstance::get()->getPlanningRequestWriter();
55  }
60  void run()
61  {
63 
65  bool x0_available = dispatcher_.getInitialState(x0);
66  if(dispatcher_.getStatus()!="")std::cout<<dispatcher_.getStatus()<<std::endl;
67  if(!x0_available)return;
69  request_.initial_state.tStart = x0.getTime();
70  request_.initial_state.tEnd = x0.getTime();
72 
73  reqwriter_->write(request_);//request is published for logging only
74 
77 
78  if(result.combined_maneuver_valid)
79  {
81  }
82  prwriter_->write(result);//result is published for logging and visualization
83  }
84  };
85  }
86 }
Decision making and maneuver planning, which realizes lane following only. Basically a wrapper for tr...
Definition: lane_following_behavior.h:33
adore::fun::SetPointRequestDispatcher dispatcher_
Definition: lane_following_behavior.h:39
virtual ~LaneFollowingBehavior()
Definition: lane_following_behavior.h:44
void run()
select initial state and recompute maneuver
Definition: lane_following_behavior.h:60
adore::params::APTrajectoryGeneration * pTrajectoryGeneration_
Definition: lane_following_behavior.h:35
adore::fun::PlanningRequest request_
Definition: lane_following_behavior.h:36
TrajectoryPlannerLF trajectory_planner_
Definition: lane_following_behavior.h:40
adore::mad::AWriter< adore::fun::PlanningRequest > * reqwriter_
Definition: lane_following_behavior.h:38
LaneFollowingBehavior()
Definition: lane_following_behavior.h:50
adore::mad::AWriter< adore::fun::PlanningResult > * prwriter_
Definition: lane_following_behavior.h:37
Decoupled trajectory planner, which uses TrajectoryPlannerBase to compute and provide a PlanningResul...
Definition: trajectory_planner_lf.h:41
virtual void computeTrajectory(const adore::fun::PlanningRequest &planning_request, adore::fun::PlanningResult &planning_result) override
update data, views and recompute maneuver
Definition: trajectory_planner_lf.h:164
static adore::fun::AFactory * get()
Definition: afactory.h:170
class helps to dispatch SetPointRequest to controller SetPointRequestDispatcher handles selection of ...
Definition: setpointrequest_dispatcher.h:29
std::string getStatus()
Definition: setpointrequest_dispatcher.h:218
bool getInitialState(VehicleMotionState9d &result)
compute and return initial state for next planning iteration The according initial state in odometry ...
Definition: setpointrequest_dispatcher.h:191
void dispatch(SetPointRequest &combined_trajectory, SetPointRequest &nominal_trajectory)
dispatch SetPointRequests computed in localization coordinates The combined trajectory will be conver...
Definition: setpointrequest_dispatcher.h:208
PlanarVehicleState10d x0ref
Definition: setpoint.h:32
double tStart
Definition: setpoint.h:34
double tEnd
Definition: setpoint.h:35
virtual void write(const T &value)=0
virtual APTrajectoryGeneration * getTrajectoryGeneration() const =0
abstract class containing parameters to configure the behaviour of trajectory generation
Definition: ap_trajectory_generation.h:26
virtual double getEmergencyManeuverDelay() const =0
time after which emergency maneuver kicks in
static adore::params::AFactory * get()
Definition: afactory.h:103
x0
Definition: adore_set_goal.py:25
Definition: areaofeffectconverter.h:20
This struct holds the motion state of the vehicle in 9d.
Definition: vehiclemotionstate9d.h:39
Definition: planarvehiclestate10d.h:41
Definition: planning_request.h:22
double t_emergency_start
Definition: planning_request.h:26
SetPoint initial_state
Definition: planning_request.h:27
long long int iteration
Definition: planning_request.h:23
Definition: planning_result.h:29
bool combined_maneuver_valid
Definition: planning_result.h:64
SetPointRequest nominal_maneuver
Definition: planning_result.h:33
SetPointRequest combined_maneuver
Definition: planning_result.h:35