Closed Bzdss6 closed 3 months ago
Which version of eigen, osqp and osqp-eigen are you using?
Can you provide the full code that is creating the problem? Without knowing what is the mpc_solver.hessian
variable, it is not possible to understand what is going on.
The osqp version is 0.6.3 and the osqp-eigen version is 0.7.0. Could it be that the osqp-eigen version is too old?
Related codes:
Eigen::SparseMatrix<double> hessian; Eigen::Matrix<double, 120, 120> dense_hessian; ...; hessian = dense_hessian.sparseView();
`
The middle is the dense_hessian assignment
Hi @Bzdss6, could you please provide a self-contained application so I can try to replicate it on my PC?
Thank you!
I've solved it, the reason for the error was that this library had a definition with the same name as my other code, thank you very much!
The call code is as follows
solver.data()->setHessianMatrix(mpc_solver.hessian); solver.updateHessianMatrix(mpc_solver.hessian);
The following error is given when compiling:
In file included from /usr/include/eigen3/Eigen/Core:469:0, from /usr/include/eigen3/Eigen/Dense:1, from /home/wangdachui/catkin_ws/src/unitree_guide/unitree_guide/include/common/mathTypes.h:7, from /home/wangdachui/catkin_ws/src/unitree_guide/unitree_guide/include/control/BalanceCtrl.h:7, from /home/wangdachui/catkin_ws/src/unitree_guide/unitree_guide/src/control/BalanceCtrl.cpp:4: /usr/include/eigen3/Eigen/src/Core/TriangularMatrix.h: In instantiation of ‘class Eigen::TriangularView<const Eigen::SparseMatrix<double, 0, int>, 2>’: /usr/local/include/OsqpEigen/Data.tpp:38:13: required from ‘bool OsqpEigen::Data::setHessianMatrix(const Eigen::SparseCompressedBase<Derived>&) [with Derived = Eigen::SparseMatrix<double, 0, int>]’ /home/wangdachui/catkin_ws/src/unitree_guide/unitree_guide/src/control/BalanceCtrl.cpp:445:63: required from here /usr/include/eigen3/Eigen/src/Core/TriangularMatrix.h:283:17: error: no members matching ‘Eigen::TriangularView<const Eigen::SparseMatrix<double, 0, int>, 2>::Base {aka Eigen::TriangularViewImpl<const Eigen::SparseMatrix<double, 0, int>, 2, Eigen::Sparse>}::solve’ in ‘Eigen::TriangularView<const Eigen::SparseMatrix<double, 0, int>, 2>::Base {aka class Eigen::TriangularViewImpl<const Eigen::SparseMatrix<double, 0, int>, 2, Eigen::Sparse>}’ using Base::solve;