52 const std::array<double, 3>& x_init);
56 void set_x_bounds(std::vector<std::pair<double, double>> x_bounds);
58 void set_x_bounds(
const double x_lower_bound,
const double x_upper_bound);
60 void set_dx_bounds(std::vector<std::pair<double, double>> dx_bounds);
62 void set_dx_bounds(
const double dx_lower_bound,
const double dx_upper_bound);
64 void set_ddx_bounds(std::vector<std::pair<double, double>> ddx_bounds);
67 const double ddx_upper_bound);
74 const double dddx_upper_bound) {
97 void set_x_ref(
const double weight_x_ref, std::vector<double> x_ref);
105 void set_x_ref(std::vector<double> weight_x_ref_vec,
106 std::vector<double> x_ref);
115 std::vector<double> towing_x_ref);
118 std::vector<double> towing_x_ref);
121 const std::array<double, 3>& end_state_ref);
123 virtual bool Optimize(
const int max_iter = 4000);
125 const std::vector<double>&
opt_x()
const {
return x_; }
127 const std::vector<double>&
opt_dx()
const {
return dx_; }
134 std::vector<c_int>* P_indices,
135 std::vector<c_int>* P_indptr) = 0;
140 std::vector<c_int>* A_indices,
141 std::vector<c_int>* A_indptr,
142 std::vector<c_float>* lower_bounds,
143 std::vector<c_float>* upper_bounds);
152 const std::vector<c_float>& upper);
154 template <
typename T>
156 T* data =
new T[vec.size()];
157 memcpy(data, vec.data(),
sizeof(T) * vec.size());
165 std::vector<double>
x_;
std::array< double, 3 > weight_end_state_
bool CheckLowUpperBound(const std::vector< c_float > &lower, const std::vector< c_float > &upper)
void set_x_ref(const double weight_x_ref, std::vector< double > x_ref)
Set the x ref object and the uniform x_ref weighting
const std::vector< double > & opt_x() const
std::vector< double > dx_
std::pair< double, double > dddx_bound_
std::vector< double > x_ref_
void set_dddx_bound(const double dddx_lower_bound, const double dddx_upper_bound)
std::vector< double > weight_x_ref_vec_
std::vector< std::pair< double, double > > x_bounds_
void set_scale_factor(const std::array< double, 3 > &scale_factor)
virtual void CalculateKernel(std::vector< c_float > *P_data, std::vector< c_int > *P_indices, std::vector< c_int > *P_indptr)=0
bool FormulateProblem(OSQPData *data)
T * CopyData(const std::vector< T > &vec)
void set_end_state_ref(const std::array< double, 3 > &weight_end_state, const std::array< double, 3 > &end_state_ref)
virtual void CalculateOffset(std::vector< c_float > *q)=0
void set_dddx_bound(const double dddx_bound)
void set_x_bounds(std::vector< std::pair< double, double > > x_bounds)
virtual bool Optimize(const int max_iter=4000)
std::vector< double > weight_towing_x_ref_vec_
void set_weight_ddx(const double weight_ddx)
void FreeData(OSQPData *data)
std::array< double, 3 > x_init_
void set_dx_bounds(std::vector< std::pair< double, double > > dx_bounds)
const std::vector< double > & opt_dx() const
const std::vector< double > & opt_ddx() const
void set_towing_x_ref(const double weight_towing_x_ref, std::vector< double > towing_x_ref)
Set towing x ref object and piecewised towing_x_ref weightings
void set_weight_x(const double weight_x)
void set_weight_dx(const double weight_dx)
std::vector< std::pair< double, double > > ddx_bounds_
virtual OSQPSettings * SolverDefaultSettings()
std::array< double, 3 > scale_factor_
std::vector< double > ddx_
std::array< double, 3 > end_state_ref_
virtual void CalculateAffineConstraint(std::vector< c_float > *A_data, std::vector< c_int > *A_indices, std::vector< c_int > *A_indptr, std::vector< c_float > *lower_bounds, std::vector< c_float > *upper_bounds)
void set_weight_dddx(const double weight_dddx)
std::vector< std::pair< double, double > > dx_bounds_
std::vector< double > towing_x_ref_
virtual ~PiecewiseJerkProblem()=default
void set_ddx_bounds(std::vector< std::pair< double, double > > ddx_bounds)
Planning module main class.