62 const size_t horizon,
const double ts,
const Eigen::MatrixXd& ego,
63 const Eigen::MatrixXd& xWS,
const Eigen::MatrixXd& uWS,
64 const Eigen::MatrixXd& l_warm_up,
const Eigen::MatrixXd& n_warm_up,
65 const Eigen::MatrixXd& s_warm_up,
const Eigen::MatrixXd& x0,
66 const Eigen::MatrixXd& xf,
const Eigen::MatrixXd& last_time_u,
67 const std::vector<double>& XYbounds,
68 const Eigen::MatrixXi& obstacles_edges_num,
const size_t obstacles_num,
69 const Eigen::MatrixXd& obstacles_A,
const Eigen::MatrixXd& obstacles_b,
75 bool get_nlp_info(
int& n,
int& m,
int& nnz_jac_g,
int& nnz_h_lag,
76 IndexStyleEnum& index_style)
override;
79 bool get_bounds_info(
int n,
double* x_l,
double* x_u,
int m,
double* g_l,
80 double* g_u)
override;
84 double* z_L,
double* z_U,
int m,
bool init_lambda,
85 double* lambda)
override;
88 bool eval_f(
int n,
const double* x,
bool new_x,
double& obj_value)
override;
91 bool eval_grad_f(
int n,
const double* x,
bool new_x,
double* grad_f)
override;
94 bool eval_g(
int n,
const double* x,
bool new_x,
int m,
double* g)
override;
97 bool check_g(
int n,
const double* x,
int m,
const double* g);
103 bool eval_jac_g(
int n,
const double* x,
bool new_x,
int m,
int nele_jac,
104 int* iRow,
int* jCol,
double* values)
override;
107 bool eval_jac_g_ser(
int n,
const double* x,
bool new_x,
int m,
int nele_jac,
108 int* iRow,
int* jCol,
double* values)
override;
115 bool eval_h(
int n,
const double* x,
bool new_x,
double obj_factor,
int m,
116 const double* lambda,
bool new_lambda,
int nele_hess,
int* iRow,
117 int* jCol,
double* values)
override;
123 const double* z_L,
const double* z_U,
int m,
124 const double* g,
const double* lambda,
125 double obj_value,
const Ipopt::IpoptData* ip_data,
126 Ipopt::IpoptCalculatedQuantities* ip_cq)
override;
129 Eigen::MatrixXd* control_result,
130 Eigen::MatrixXd* time_result,
131 Eigen::MatrixXd* dual_l_result,
132 Eigen::MatrixXd* dual_n_result)
const override;
137 void eval_obj(
int n,
const T* x, T* obj_value);
144 void generate_tapes(
int n,
int m,
int* nnz_jac_g,
int* nnz_h_lag);
148 int num_of_variables_ = 0;
149 int num_of_constraints_ = 0;
151 int lambda_horizon_ = 0;
152 int miu_horizon_ = 0;
153 int slack_horizon_ = 0;
156 Eigen::MatrixXd ego_;
157 Eigen::MatrixXd xWS_;
158 Eigen::MatrixXd uWS_;
159 Eigen::MatrixXd l_warm_up_;
160 Eigen::MatrixXd n_warm_up_;
161 Eigen::MatrixXd slack_warm_up_;
164 Eigen::MatrixXd last_time_u_;
165 std::vector<double> XYbounds_;
168 bool enable_constraint_check_;
171 double weight_state_x_ = 0.0;
172 double weight_state_y_ = 0.0;
173 double weight_state_phi_ = 0.0;
174 double weight_state_v_ = 0.0;
175 double weight_input_steer_ = 0.0;
176 double weight_input_a_ = 0.0;
177 double weight_rate_steer_ = 0.0;
178 double weight_rate_a_ = 0.0;
179 double weight_stitching_steer_ = 0.0;
180 double weight_stitching_a_ = 0.0;
181 double weight_first_order_time_ = 0.0;
182 double weight_second_order_time_ = 0.0;
183 double weight_end_state_ = 0.0;
184 double weight_slack_ = 0.0;
188 std::vector<double> g_;
189 double offset_ = 0.0;
190 Eigen::MatrixXi obstacles_edges_num_;
191 int obstacles_num_ = 0;
192 int obstacles_edges_sum_ = 0;
193 double wheelbase_ = 0.0;
195 Eigen::MatrixXd state_result_;
196 Eigen::MatrixXd dual_l_result_;
197 Eigen::MatrixXd dual_n_result_;
198 Eigen::MatrixXd control_result_;
199 Eigen::MatrixXd time_result_;
200 Eigen::MatrixXd slack_result_;
203 Eigen::MatrixXd obstacles_A_;
206 Eigen::MatrixXd obstacles_b_;
209 bool use_fix_time_ =
false;
212 int state_start_index_ = 0;
215 int control_start_index_ = 0;
218 int time_start_index_ = 0;
221 int l_start_index_ = 0;
224 int n_start_index_ = 0;
227 int slack_index_ = 0;
229 double min_safety_distance_ = 0.0;
231 double max_safety_distance_ = 0.0;
233 double max_steer_angle_ = 0.0;
235 double max_speed_forward_ = 0.0;
237 double max_speed_reverse_ = 0.0;
239 double max_acceleration_forward_ = 0.0;
241 double max_acceleration_reverse_ = 0.0;
243 double min_time_sample_scaling_ = 0.0;
245 double max_time_sample_scaling_ = 0.0;
247 double max_steer_rate_ = 0.0;
249 double max_lambda_ = 0.0;
251 double max_miu_ = 0.0;
253 bool enable_jacobian_ad_ =
false;
264 unsigned int* rind_g;
265 unsigned int* cind_g;
267 unsigned int* rind_L;
268 unsigned int* cind_L;
279 const size_t horizon,
const double ts,
const Eigen::MatrixXd& ego,
280 const Eigen::MatrixXd& xWS,
const Eigen::MatrixXd& uWS,
281 const Eigen::MatrixXd& l_warm_up,
const Eigen::MatrixXd& n_warm_up,
282 const Eigen::MatrixXd& s_warm_up,
const Eigen::MatrixXd& x0,
283 const Eigen::MatrixXd& xf,
const Eigen::MatrixXd& last_time_u,
284 const std::vector<double>& XYbounds,
285 const Eigen::MatrixXi& obstacles_edges_num,
const size_t obstacles_num,
286 const Eigen::MatrixXd& obstacles_A,
const Eigen::MatrixXd& obstacles_b,
DistanceApproachIPOPTRelaxEndSlackInterface(const size_t horizon, const double ts, const Eigen::MatrixXd &ego, const Eigen::MatrixXd &xWS, const Eigen::MatrixXd &uWS, const Eigen::MatrixXd &l_warm_up, const Eigen::MatrixXd &n_warm_up, const Eigen::MatrixXd &s_warm_up, const Eigen::MatrixXd &x0, const Eigen::MatrixXd &xf, const Eigen::MatrixXd &last_time_u, const std::vector< double > &XYbounds, const Eigen::MatrixXi &obstacles_edges_num, const size_t obstacles_num, const Eigen::MatrixXd &obstacles_A, const Eigen::MatrixXd &obstacles_b, const DistanceApproachConfig &distance_approach_config)
void finalize_solution(Ipopt::SolverReturn status, int n, const double *x, const double *z_L, const double *z_U, int m, const double *g, const double *lambda, double obj_value, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq) override
This method is called when the algorithm is complete so the TNLP can store/write the solution