When I tried to compile an example using the interface, I have the following errors:
FAILED: CMakeFiles/bug23.dir/main.cpp.o
/bin/g++ -DOSQP_SHARED_LIB -isystem /usr/include/eigen3 -isystem /usr/local/include/osqp -DQT_QML_DEBUG -g -std=gnu++17 -fdiagnostics-color=always -Werror=return-type -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Woverloaded-virtual -MD -MT CMakeFiles/bug23.dir/main.cpp.o -MF CMakeFiles/bug23.dir/main.cpp.o.d -o CMakeFiles/bug23.dir/main.cpp.o -c /home/juanjqo/Documents/dqrobotics_tests/cpp/bug23/bug23/main.cpp
In file included from /home/juanjqo/Documents/dqrobotics_tests/cpp/bug23/bug23/main.cpp:6:
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:42:21: error: ‘OSQPData’ was not declared in this scope
42 | std::shared_ptr<OSQPData> data_sptr_;
| ^~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:42:29: error: template argument 1 is invalid
42 | std::shared_ptr<OSQPData> data_sptr_;
| ^
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h: In constructor ‘DQ_robotics::DQ_OSQPSolver::DQ_OSQPSolver()’:
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:73:72: error: invalid use of incomplete type ‘OSQPWorkspace’ {aka ‘struct OSQPWorkspace_’}
73 | work_sptr_ = std::make_shared<OSQPWorkspace>(OSQPWorkspace());
| ^
In file included from /usr/local/include/osqp/osqp.h:8,
from /usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:27:
/usr/local/include/osqp/osqp_api_types.h:175:16: note: forward declaration of ‘OSQPWorkspace’ {aka ‘struct OSQPWorkspace_’}
175 | typedef struct OSQPWorkspace_ OSQPWorkspace;
| ^~~~~~~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:75:43: error: ‘OSQPData’ was not declared in this scope
75 | data_sptr_ = std::make_shared<OSQPData>(OSQPData());
| ^~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h: In member function ‘Eigen::VectorXd DQ_robotics::DQ_OSQPSolver::_solve_osqp_quadratic_program(const Eigen::MatrixXd&, const Eigen::VectorXd&, const Eigen::MatrixXd&, const Eigen::VectorXd&, const Eigen::MatrixXd&, const Eigen::VectorXd&)’:
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:100:9: error: ‘c_float’ was not declared in this scope; did you mean ‘float’?
100 | c_float P_x_array[nnz_P];
| ^~~~~~~
| float
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:101:9: error: ‘c_int’ was not declared in this scope; did you mean ‘u_int’?
101 | c_int P_i_array[nnz_P];
| ^~~~~
| u_int
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:102:17: error: expected ‘;’ before ‘P_p_array’
102 | c_int P_p_array[n_P+1];
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:103:78: error: ‘P_x_array’ was not declared in this scope
103 | std::copy(P_sparse.valuePtr(), P_sparse.valuePtr() +nnz_P, P_x_array);
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:104:78: error: ‘P_i_array’ was not declared in this scope
104 | std::copy(P_sparse.innerIndexPtr(), P_sparse.innerIndexPtr() +nnz_P, P_i_array);
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:105:78: error: ‘P_p_array’ was not declared in this scope
105 | std::copy(P_sparse.outerIndexPtr(), P_sparse.outerIndexPtr() +n_P+1, P_p_array);
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:138:17: error: expected ‘;’ before ‘A_x_array’
138 | c_float A_x_array[nnz_A];
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:139:17: error: expected ‘;’ before ‘A_i_array’
139 | c_int A_i_array[nnz_A];
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:140:17: error: expected ‘;’ before ‘A_p_array’
140 | c_int A_p_array[n_A+1];
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:142:78: error: ‘A_x_array’ was not declared in this scope
142 | std::copy(A_sparse.valuePtr(), A_sparse.valuePtr() +nnz_A, A_x_array);
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:143:78: error: ‘A_i_array’ was not declared in this scope
143 | std::copy(A_sparse.innerIndexPtr(), A_sparse.innerIndexPtr() +nnz_A, A_i_array);
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:144:78: error: ‘A_p_array’ was not declared in this scope
144 | std::copy(A_sparse.outerIndexPtr(), A_sparse.outerIndexPtr() +n_A+1, A_p_array);
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:151:25: error: ‘using std::__shared_ptr_access<OSQPSettings, __gnu_cxx::_S_atomic, false, false>::element_type = struct OSQPSettings’ {aka ‘struct OSQPSettings’} has no member named ‘warm_start’; did you mean ‘warm_starting’?
151 | settings_sptr_->warm_start = 1.0;
| ^~~~~~~~~~
| warm_starting
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:154:19: error: base operand of ‘->’ is not a pointer
154 | data_sptr_->n = n_A;
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:155:19: error: base operand of ‘->’ is not a pointer
155 | data_sptr_->m = m_A;
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:156:19: error: base operand of ‘->’ is not a pointer
156 | data_sptr_->P = csc_matrix(data_sptr_->n, data_sptr_->n, nnz_P, P_x_array, P_i_array , P_p_array);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:156:46: error: base operand of ‘->’ is not a pointer
156 | data_sptr_->P = csc_matrix(data_sptr_->n, data_sptr_->n, nnz_P, P_x_array, P_i_array , P_p_array);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:156:61: error: base operand of ‘->’ is not a pointer
156 | data_sptr_->P = csc_matrix(data_sptr_->n, data_sptr_->n, nnz_P, P_x_array, P_i_array , P_p_array);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:156:25: error: ‘csc_matrix’ was not declared in this scope
156 | data_sptr_->P = csc_matrix(data_sptr_->n, data_sptr_->n, nnz_P, P_x_array, P_i_array , P_p_array);
| ^~~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:157:19: error: base operand of ‘->’ is not a pointer
157 | data_sptr_->q = f_.data();
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:158:19: error: base operand of ‘->’ is not a pointer
158 | data_sptr_->A = csc_matrix(data_sptr_->m, data_sptr_->n, nnz_A, A_x_array, A_i_array , A_p_array);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:158:46: error: base operand of ‘->’ is not a pointer
158 | data_sptr_->A = csc_matrix(data_sptr_->m, data_sptr_->n, nnz_A, A_x_array, A_i_array , A_p_array);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:158:61: error: base operand of ‘->’ is not a pointer
158 | data_sptr_->A = csc_matrix(data_sptr_->m, data_sptr_->n, nnz_A, A_x_array, A_i_array , A_p_array);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:159:19: error: base operand of ‘->’ is not a pointer
159 | data_sptr_->l = lb_.data();
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:160:19: error: base operand of ‘->’ is not a pointer
160 | data_sptr_->u = ub_.data();
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:166:54: error: request for member ‘get’ in ‘((DQ_robotics::DQ_OSQPSolver*)this)->DQ_robotics::DQ_OSQPSolver::data_sptr_’, which is of non-class type ‘int’
166 | auto exitflag = osqp_setup(&work, data_sptr_.get(), settings_sptr_.get());
| ^~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:172:21: error: expected ‘;’ before ‘x_0_array’
172 | c_float x_0_array[data_sptr_->n];
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:173:21: error: expected ‘;’ before ‘y_0_array’
173 | c_float y_0_array[data_sptr_->n];
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:174:58: error: base operand of ‘->’ is not a pointer
174 | std::copy(x_0_.data(), x_0_.data()+data_sptr_->n, x_0_array);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:174:63: error: ‘x_0_array’ was not declared in this scope
174 | std::copy(x_0_.data(), x_0_.data()+data_sptr_->n, x_0_array);
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:175:58: error: base operand of ‘->’ is not a pointer
175 | std::copy(y_0_.data(), y_0_.data()+data_sptr_->n, y_0_array);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:175:63: error: ‘y_0_array’ was not declared in this scope
175 | std::copy(y_0_.data(), y_0_.data()+data_sptr_->n, y_0_array);
| ^~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:176:13: error: ‘osqp_warm_start_x’ was not declared in this scope; did you mean ‘osqp_warm_start’?
176 | osqp_warm_start_x(work, x_0_array);
| ^~~~~~~~~~~~~~~~~
| osqp_warm_start
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:181:20: error: cannot convert ‘OSQPWorkspace*’ {aka ‘OSQPWorkspace_*’} to ‘OSQPSolver*’
181 | osqp_solve(work);
| ^~~~
| |
| OSQPWorkspace* {aka OSQPWorkspace_*}
In file included from /usr/local/include/osqp/osqp.h:9:
/usr/local/include/osqp/osqp_api_functions.h:295:41: note: initializing argument 1 of ‘OSQPInt osqp_solve(OSQPSolver*)’
295 | OSQP_API OSQPInt osqp_solve(OSQPSolver* solver);
| ~~~~~~~~~~~~^~~~~~
/usr/local/include/osqp/osqp_api_types.h:175:16: note: class type ‘OSQPWorkspace’ {aka ‘OSQPWorkspace_’} is incomplete
175 | typedef struct OSQPWorkspace_ OSQPWorkspace;
| ^~~~~~~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:183:41: error: invalid use of incomplete type ‘OSQPWorkspace’ {aka ‘struct OSQPWorkspace_’}
183 | x_0_ = Eigen::Map<VectorXd>(work->solution->x, data_sptr_->n);
| ^~
/usr/local/include/osqp/osqp_api_types.h:175:16: note: forward declaration of ‘OSQPWorkspace’ {aka ‘struct OSQPWorkspace_’}
175 | typedef struct OSQPWorkspace_ OSQPWorkspace;
| ^~~~~~~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:183:66: error: base operand of ‘->’ is not a pointer
183 | x_0_ = Eigen::Map<VectorXd>(work->solution->x, data_sptr_->n);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:184:41: error: invalid use of incomplete type ‘OSQPWorkspace’ {aka ‘struct OSQPWorkspace_’}
184 | y_0_ = Eigen::Map<VectorXd>(work->solution->y, data_sptr_->n);
| ^~
/usr/local/include/osqp/osqp_api_types.h:175:16: note: forward declaration of ‘OSQPWorkspace’ {aka ‘struct OSQPWorkspace_’}
175 | typedef struct OSQPWorkspace_ OSQPWorkspace;
| ^~~~~~~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:184:66: error: base operand of ‘->’ is not a pointer
184 | y_0_ = Eigen::Map<VectorXd>(work->solution->y, data_sptr_->n);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:185:48: error: invalid use of incomplete type ‘OSQPWorkspace’ {aka ‘struct OSQPWorkspace_’}
185 | u_solution_ = Eigen::Map<VectorXd>(work->solution->x, data_sptr_->n);
| ^~
/usr/local/include/osqp/osqp_api_types.h:175:16: note: forward declaration of ‘OSQPWorkspace’ {aka ‘struct OSQPWorkspace_’}
175 | typedef struct OSQPWorkspace_ OSQPWorkspace;
| ^~~~~~~~~~~~~~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:185:73: error: base operand of ‘->’ is not a pointer
185 | u_solution_ = Eigen::Map<VectorXd>(work->solution->x, data_sptr_->n);
| ^~
/usr/local/include/dqrobotics/solvers/DQ_OSQPSolver.h:187:22: error: cannot convert ‘OSQPWorkspace*’ {aka ‘OSQPWorkspace_*’} to ‘OSQPSolver*’
187 | osqp_cleanup(work);
| ^~~~
| |
| OSQPWorkspace* {aka OSQPWorkspace_*}
/usr/local/include/osqp/osqp_api_functions.h:317:43: note: initializing argument 1 of ‘OSQPInt osqp_cleanup(OSQPSolver*)’
317 | OSQP_API OSQPInt osqp_cleanup(OSQPSolver* solver);
| ~~~~~~~~~~~~^~~~~~
/usr/local/include/osqp/osqp_api_types.h:175:16: note: class type ‘OSQPWorkspace’ {aka ‘OSQPWorkspace_’} is incomplete
175 | typedef struct OSQPWorkspace_ OSQPWorkspace;
| ^~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
I need to investigate more.
When I tried to compile an example using the interface, I have the following errors:
I need to investigate more.