26 #include "osqp/osqp.h" 38 const std::vector<std::pair<double, double>>& ref_points) {
39 ref_points_ = ref_points;
43 bounds_around_refs_ = bounds_around_refs;
47 weight_fem_pos_deviation_ = weight_fem_pos_deviation;
51 weight_path_length_ = weight_path_length;
55 weight_ref_deviation_ = weight_ref_deviation;
65 scaled_termination_ = scaled_termination;
72 const std::vector<double>&
opt_x()
const {
return x_; }
74 const std::vector<double>&
opt_y()
const {
return y_; }
77 void CalculateKernel(std::vector<c_float>* P_data,
78 std::vector<c_int>* P_indices,
79 std::vector<c_int>* P_indptr);
81 void CalculateOffset(std::vector<c_float>* q);
83 void CalculateAffineConstraint(std::vector<c_float>* A_data,
84 std::vector<c_int>* A_indices,
85 std::vector<c_int>* A_indptr,
86 std::vector<c_float>* lower_bounds,
87 std::vector<c_float>* upper_bounds);
89 void SetPrimalWarmStart(std::vector<c_float>* primal_warm_start);
91 bool OptimizeWithOsqp(
92 const size_t kernel_dim,
const size_t num_affine_constraint,
93 std::vector<c_float>* P_data, std::vector<c_int>* P_indices,
94 std::vector<c_int>* P_indptr, std::vector<c_float>* A_data,
95 std::vector<c_int>* A_indices, std::vector<c_int>* A_indptr,
96 std::vector<c_float>* lower_bounds, std::vector<c_float>* upper_bounds,
97 std::vector<c_float>* q, std::vector<c_float>* primal_warm_start,
98 OSQPData* data, OSQPWorkspace** work, OSQPSettings* settings);
102 std::vector<std::pair<double, double>> ref_points_;
103 std::vector<double> bounds_around_refs_;
106 double weight_fem_pos_deviation_ = 1.0e5;
107 double weight_path_length_ = 1.0;
108 double weight_ref_deviation_ = 1.0;
111 int max_iter_ = 4000;
112 double time_limit_ = 0.0;
113 bool verbose_ =
false;
114 bool scaled_termination_ =
true;
115 bool warm_start_ =
true;
118 int num_of_points_ = 0;
119 int num_of_variables_ = 0;
120 int num_of_constraints_ = 0;
123 std::vector<double> x_;
124 std::vector<double> y_;
void set_bounds_around_refs(const std::vector< double > &bounds_around_refs)
Definition: fem_pos_deviation_osqp_interface.h:42
void set_ref_points(const std::vector< std::pair< double, double >> &ref_points)
Definition: fem_pos_deviation_osqp_interface.h:37
FemPosDeviationOsqpInterface()=default
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
void set_weight_ref_deviation(const double weight_ref_deviation)
Definition: fem_pos_deviation_osqp_interface.h:54
void set_weight_path_length(const double weight_path_length)
Definition: fem_pos_deviation_osqp_interface.h:50
Planning module main class. It processes GPS and IMU as input, to generate planning info...
const std::vector< double > & opt_y() const
Definition: fem_pos_deviation_osqp_interface.h:74
void set_verbose(const bool verbose)
Definition: fem_pos_deviation_osqp_interface.h:62
void set_max_iter(const int max_iter)
Definition: fem_pos_deviation_osqp_interface.h:58
Definition: fem_pos_deviation_osqp_interface.h:31
void set_scaled_termination(const bool scaled_termination)
Definition: fem_pos_deviation_osqp_interface.h:64
const std::vector< double > & opt_x() const
Definition: fem_pos_deviation_osqp_interface.h:72
void set_weight_fem_pos_deviation(const double weight_fem_pos_deviation)
Definition: fem_pos_deviation_osqp_interface.h:46
void set_warm_start(const bool warm_start)
Definition: fem_pos_deviation_osqp_interface.h:68
void set_time_limit(const double time_limit)
Definition: fem_pos_deviation_osqp_interface.h:60
virtual ~FemPosDeviationOsqpInterface()=default