44 static const int N = 3;
45 static const int R = 1;
110 double dt_int = Tend/(K*P);
120 qpOASES::Options options;
122 options.printLevel = qpOASES::PL_NONE;
128 qpOASES::Options options;
130 options.printLevel = qpOASES::PL_NONE;
143 progress_solver_.
x0()(1) =
adore::mad::bound(
info_.
getLB(0,1,
t0,
s0,
ds0),
ds0,
info_.
getUB(0,1,
t0,
s0,
ds0));
144 progress_solver_.
x0()(2) =
adore::mad::bound(
info_.
getLB(0,2,
t0,
s0,
ds0),
dds0,
info_.
getUB(0,2,
t0,
s0,
ds0));
146 double s_estimate =
s0;
162 ds_estimate_i = ds_estimate_j;
163 ds_estimate_j += dds_max * (tj-ti);
164 ds_max =
info_.
getUB(0,1,tj,s_estimate,ds_estimate_i);
165 ds_estimate_j = (
std::min)(ds_estimate_j,ds_max);
168 ds_estimate_j = (
std::min)(ds_estimate_j,ds_reference);
172 ds_reference = ds_estimate_j;
176 s_estimate += (ds_estimate_j+ds_estimate_i)*0.5 * (tj-ti);
179 s_estimate = (
std::min)(s_estimate,s_reference);
183 s_reference = s_estimate;
207 for(
int j=K-1;j>0;j-- )
224 offset_solver_.
x0()(1) =
adore::mad::bound(
info_.
getLB(1,1,
t0,
s0,
ds0),
dn0,
info_.
getUB(1,1,
t0,
s0,
ds0));
225 offset_solver_.
x0()(2) =
adore::mad::bound(
info_.
getLB(1,2,
t0,
s0,
ds0),
ddn0,
info_.
getUB(1,2,
t0,
s0,
ds0));
227 double tj,tj_rel,s,ds;
354 return "rc transformation failed";
356 return "longitudinal planning failed";
358 return "lateral preparation failed";
360 return "lateral planning failed";
362 return "feed forward computation failed";
364 return "unknown error";
376 bool log_transformation =
false;
384 if(log_transformation)
386 std::cout<<
"roadCoordinates:"<<std::endl;
387 std::cout<<
"s0="<<rc.s0<<std::endl;
388 std::cout<<
"s1="<<rc.s1<<std::endl;
389 std::cout<<
"s2="<<rc.s2<<std::endl;
390 std::cout<<
"n0="<<rc.n0<<std::endl;
391 std::cout<<
"n1="<<rc.n1<<std::endl;
392 std::cout<<
"n2="<<rc.n2<<std::endl;
393 std::cout<<
"transformation error:"<<std::endl;
394 std::cout<<
"eX="<<initial_state.
getX()-x_test.
getX()<<std::endl;
395 std::cout<<
"eY="<<initial_state.
getY()-x_test.
getY()<<std::endl;
396 std::cout<<
"ePSI="<<initial_state.
getPSI()-x_test.
getPSI()<<std::endl;
397 std::cout<<
"evx="<<initial_state.
getvx()-x_test.
getvx()<<std::endl;
398 std::cout<<
"evy="<<initial_state.
getvy()-x_test.
getvy()<<std::endl;
399 std::cout<<
"eOmega="<<initial_state.
getOmega()-x_test.
getOmega()<<std::endl;
400 std::cout<<
"eDelta="<<initial_state.
getDelta()-x_test.
getDelta()<<std::endl;
401 std::cout<<
"eAx="<<initial_state.
getAx()-x_test.
getAx()<<std::endl;
432 catch(
const std::exception& e)
434 std::cerr << e.what() << std::endl;
452 double t_end_new = t_start + 0.1;
453 double t_step = 0.01;
455 double a_stop = 0.001;
458 && t_end_new<t_end-t_step )t_end_new+=t_step;
Definition: anominalplanner.h:28
Definition: decoupled_lflc_planner.h:42
adore::params::APLateralPlanner * aplat_
Definition: decoupled_lflc_planner.h:64
TOffsetSolver offset_solver_
Definition: decoupled_lflc_planner.h:55
double t0
Definition: decoupled_lflc_planner.h:59
double s0
Definition: decoupled_lflc_planner.h:56
double getPlanningHorizon() const
Definition: decoupled_lflc_planner.h:327
double psi0
Definition: decoupled_lflc_planner.h:58
adore::params::APVehicle * apvehicle_
Definition: decoupled_lflc_planner.h:66
void prepare_progress_computation()
Definition: decoupled_lflc_planner.h:140
SetPointRequest spr_
Definition: decoupled_lflc_planner.h:67
bool valid_
the result as a set-point request
Definition: decoupled_lflc_planner.h:68
RoadCoordinateConverter roadCoordinates_
end time of plan, defines planning horizon as [0,T_end_]
Definition: decoupled_lflc_planner.h:62
TInformationSet info_
Definition: decoupled_lflc_planner.h:52
void init_offset_default_cost()
Definition: decoupled_lflc_planner.h:89
static const int R
Definition: decoupled_lflc_planner.h:45
double T_[K+1]
Definition: decoupled_lflc_planner.h:60
void update_offset_parameters()
Definition: decoupled_lflc_planner.h:290
void init_progress_default_cost()
Definition: decoupled_lflc_planner.h:71
virtual const SetPointRequest * getSetPointRequest() const override
Definition: decoupled_lflc_planner.h:491
DecoupledLFLCPlanner(adore::view::ALane *lfv, adore::params::APLongitudinalPlanner *aplon, adore::params::APLateralPlanner *aplat, adore::params::APVehicle *apvehicle, adore::params::APTrajectoryGeneration *aptrajectory)
Definition: decoupled_lflc_planner.h:310
TProgressSolver & getProgressSolver()
Definition: decoupled_lflc_planner.h:335
static const int N
Definition: decoupled_lflc_planner.h:44
std::string getStatus()
Definition: decoupled_lflc_planner.h:348
virtual double getCPUTime() const override
Definition: decoupled_lflc_planner.h:498
virtual bool hasValidPlan() const override
Definition: decoupled_lflc_planner.h:484
void update_progress_parameters()
Definition: decoupled_lflc_planner.h:271
adore::mad::LQ_OC_single_shooting< N, R, K, P > TProgressSolver
Definition: decoupled_lflc_planner.h:48
void initialize(double Tend)
Definition: decoupled_lflc_planner.h:107
double dn0
Definition: decoupled_lflc_planner.h:57
TInformationSet & getInformationSet()
Definition: decoupled_lflc_planner.h:331
double ddn0
Definition: decoupled_lflc_planner.h:57
TOffsetSolver & getOffsetSolver()
Definition: decoupled_lflc_planner.h:339
adore::params::APTrajectoryGeneration * aptraj_
Definition: decoupled_lflc_planner.h:65
double dds0
Definition: decoupled_lflc_planner.h:56
adore::mad::LQ_OC_single_shooting< N, R, K, P > TOffsetSolver
Definition: decoupled_lflc_planner.h:49
double ds0
Definition: decoupled_lflc_planner.h:56
NominalPlannerInformationSet< N+1, 2 > TInformationSet
Definition: decoupled_lflc_planner.h:50
TProgressSolver progress_solver_
Definition: decoupled_lflc_planner.h:54
double n0
Definition: decoupled_lflc_planner.h:57
double T_end_
time steps, incl. 0 at 0
Definition: decoupled_lflc_planner.h:61
void setPlanningHorizon(double Tend)
Definition: decoupled_lflc_planner.h:323
double omega0
Definition: decoupled_lflc_planner.h:58
void prepare_offset_computation()
Definition: decoupled_lflc_planner.h:221
int step_
Definition: decoupled_lflc_planner.h:69
adore::params::APLongitudinalPlanner * aplon_
Definition: decoupled_lflc_planner.h:63
bool update_guard(double &target, double value)
Definition: decoupled_lflc_planner.h:262
RoadCoordinateConverter & getRoadCoordinateConverter()
Definition: decoupled_lflc_planner.h:343
virtual void compute(const VehicleMotionState9d &initial_state) override
Definition: decoupled_lflc_planner.h:372
Definition: roadcoordinates.h:46
adoreMatrix< double, 0, 0 > toVehicleStateTrajectory(adore::mad::AScalarToN< double, 4 > *lon_trajectory_rc, adore::mad::AScalarToN< double, 4 > *lat_trajectory_rc, const adoreMatrix< double, 1, 0 > &integration_time, double s0, double psi0, double omega0)
Definition: roadcoordinates.h:263
void updateParameters(adore::params::APVehicle *p, adore::params::APTrajectoryGeneration *tp)
Definition: roadcoordinates.h:135
void toVehicleState(const RoadCoordinates &r, double psi, double omega, PlanarVehicleState10d &x, bool log=false)
Definition: roadcoordinates.h:202
RoadCoordinates toRoadCoordinates(const PlanarVehicleState10d &x, bool log=false)
Definition: roadcoordinates.h:156
bool isValid()
Definition: roadcoordinates.h:128
Definition: setpointrequest.h:35
void setStartTime(double new_t0)
Definition: setpointrequest.h:86
void append(const adoreMatrix< double, 1, 0 > &T, const adoreMatrix< double, 0, 0 > &X, int N, int maneuverID=0)
Definition: setpointrequest.h:63
std::vector< SetPoint > setPoints
Definition: setpointrequest.h:38
virtual CT f(DT x) const override
Definition: llinearpiecewisefunction.h:251
virtual T fi(DT x, int row) const override
Definition: llinearpiecewisefunction.h:391
virtual DT limitLo() const override
Definition: llinearpiecewisefunction.h:264
virtual DT limitHi() const override
Definition: llinearpiecewisefunction.h:259
Definition: lq_oc_single_shooting.h:61
bool isSolved() const
Definition: lq_oc_single_shooting.h:635
void setMaxCPUTime(real_t value)
Definition: lq_oc_single_shooting.h:729
t_wx & wx()
Definition: lq_oc_single_shooting.h:706
t_Bd & Bd_p()
Definition: lq_oc_single_shooting.h:703
t_Ad & Ad()
Definition: lq_oc_single_shooting.h:700
qpOASES::QProblem * getQProblem()
Definition: lq_oc_single_shooting.h:728
t_lbx & lbx()
Definition: lq_oc_single_shooting.h:713
t_y & y()
Definition: lq_oc_single_shooting.h:720
void setSystemChanged(bool value)
Definition: lq_oc_single_shooting.h:680
t_ubu_hard & ubu_hard()
Definition: lq_oc_single_shooting.h:716
t_uset & uset()
Definition: lq_oc_single_shooting.h:721
t_Bd & Bd()
Definition: lq_oc_single_shooting.h:701
t_lbu_hard & lbu_hard()
Definition: lq_oc_single_shooting.h:715
void compute()
Definition: lq_oc_single_shooting.h:606
t_ubx & ubx()
Definition: lq_oc_single_shooting.h:714
t_wx_end & wx_end()
Definition: lq_oc_single_shooting.h:708
t_geps & geps()
Definition: lq_oc_single_shooting.h:711
t_Ad & Ad_p()
Definition: lq_oc_single_shooting.h:702
t_ubeps & ubeps()
Definition: lq_oc_single_shooting.h:717
t_resultfun & result_fun()
Definition: lq_oc_single_shooting.h:704
t_x0 & x0()
Definition: lq_oc_single_shooting.h:719
void setEndTime(double Tend)
Definition: lq_oc_single_shooting.h:684
t_wu & wu()
Definition: lq_oc_single_shooting.h:707
bool isFeasible() const
Definition: lq_oc_single_shooting.h:628
abstract class containing parameters related to configuring the lateral planner
Definition: ap_lateral_planner.h:26
virtual double getWeightEndAcc() const =0
getWeightEndAcc returns cost function weight for quadratic acceleration term at end point
virtual double getSlackAcc() const =0
getSlackAcc returns maximum slack of soft-constraints for acceleration
virtual double getSlackVel() const =0
getSlackVel returns maximum slack of soft-constraints for velocity
virtual double getSlackPos() const =0
getSlackPos returns maximum slack of soft-constraints for position
virtual double getWeightAcc() const =0
getWeightAcc returns cost function weight for quadratic acceleration term
virtual double getWeightVel() const =0
getWeightVel returns cost function weight for quadratic velocity error term
virtual double getWeightEndVel() const =0
getWeightEndVel returns cost function weight for quadratic velocity error term at end point
virtual double getWeightPos() const =0
getWeightPos returns cost function weight for quadratic position error term
virtual double getWeightEndPos() const =0
getWeightEndPos returns cost function weight for quadratic position error term at end point
virtual double getWeightJerk() const =0
getWeightJerk returns cost function weight for quadratic jerk term
abstract class containing parameters related to configuring the longitudinal planner
Definition: ap_longitudinal_planner.h:26
virtual double getSlackVel() const =0
getSlackVel returns maximum slack of soft-constraints for velocity
virtual double getComfortAccUB() const =0
getAccUB returns longitudinal acceleration upper bound
virtual double getWeightPos() const =0
getWeightPos returns cost function weight for quadratic position error term
virtual double getWeightEndPos() const =0
getWeightEndPos returns cost function weight for quadratic position error term at end point
virtual double getWeightVel() const =0
getWeightVel returns cost function weight for quadratic velocity error term
virtual double getWeightJerk() const =0
getWeightJerk returns cost function weight for quadratic jerk term
virtual double getSlackPos() const =0
getSlackPos returns maximum slack of soft-constraints for position
virtual double getWeightEndAcc() const =0
getWeightEndAcc returns cost function weight for quadratic acceleration term at end point
virtual double getSlackAcc() const =0
getSlackAcc returns maximum slack of soft-constraints for acceleration
virtual double getWeightEndVel() const =0
getWeightEndVel returns cost function weight for quadratic velocity error term at end point
virtual double getWeightAcc() const =0
getWeightAcc returns cost function weight for quadratic acceleration term
abstract class containing parameters to configure the behaviour of trajectory generation
Definition: ap_trajectory_generation.h:26
virtual double getZDIntegrationStep() const =0
zero dynamics step size
virtual int getSetPointCount() const =0
number of set points in set-point request
virtual double getZDIntegrationLength() const =0
zero dynamics integration length
abstract class for vehicle configuration related paremeters
Definition: ap_vehicle.h:29
adoreMatrix< T, 1, 0 > sequence(T x0, T dx, T xend)
Definition: adoremath.h:51
adoreMatrix< T, 1, n > linspace(T x0, T x1)
Definition: adoremath.h:91
T bound(T lb, T value, T ub)
Definition: adoremath.h:569
T min(T a, T b, T c, T d)
Definition: adoremath.h:663
Definition: areaofeffectconverter.h:20
This struct holds the motion state of the vehicle in 9d.
Definition: vehiclemotionstate9d.h:39
double getX() const
Get the x-coordinate.
Definition: vehiclemotionstate9d.h:54
double getvx() const
Get the longitudinal velocity.
Definition: vehiclemotionstate9d.h:78
double getOmega() const
Get the yaw rate.
Definition: vehiclemotionstate9d.h:90
double getY() const
Get the y-coordinate.
Definition: vehiclemotionstate9d.h:60
double getPSI() const
Get the heading.
Definition: vehiclemotionstate9d.h:72
double getAx() const
Get the longitudinal acceleration.
Definition: vehiclemotionstate9d.h:96
double getvy() const
Get the lateral velocity.
Definition: vehiclemotionstate9d.h:84
double getDelta() const
Get the steering angle.
Definition: vehiclemotionstate9d.h:102
double getTime() const
Get the time.
Definition: vehiclemotionstate9d.h:48
Definition: planarvehiclestate10d.h:41
double getvx() const
Definition: planarvehiclestate10d.h:65
double getX() const
Definition: planarvehiclestate10d.h:62
double getDelta() const
Definition: planarvehiclestate10d.h:69
double getPSI() const
Definition: planarvehiclestate10d.h:64
double getvy() const
Definition: planarvehiclestate10d.h:66
double getOmega() const
Definition: planarvehiclestate10d.h:67
double getY() const
Definition: planarvehiclestate10d.h:63
double getAx() const
Definition: planarvehiclestate10d.h:68