Closed chenguoxi1987 closed 3 years ago
Hi @chenguoxi1987, can you please specify which value you are referring to? Is it the initial guess?
Hi @chenguoxi1987, can you please specify which value you are referring to? Is it the initial guess?
yes,it's the initial guess how can set the initial guess
You can use these methods: https://github.com/robotology/osqp-eigen/blob/9b0091038cf0fb9099a5d6c55820d6e5846034a7/include/OsqpEigen/Solver.hpp#L207-L215
The primal variables are probably what you are looking for (i.e. the initial guess for the optimization variables). The dual variables instead are the Lagrange multipliers. You can initialize also those if you have them (maybe from a previous run).
You can use these methods:
The primal variables are probably what you are looking for (i.e. the initial guess for the optimization variables). The dual variables instead are the Lagrange multipliers. You can initialize also those if you have them (maybe from a previous run).
i try the setPrimalVariable,but "segmentation fault (core dumped)"
Eigen::Matrix<double,2,1> primavariable; primavariable << 0.5,0.5; solver.setPrimalVariable(primavariable);
Hi @chenguoxi1987, it is pretty hard to figure out what is going wrong from those three lines. Can you provide some more information? Also, if you can share the code that is failing, it may help.
Ho @chenguoxi1987, it is pretty hard to figure out what is going wrong from those three lines. Can you provide some more information? Also, if you can share the code that is failing, it may help.
thank you, I put the "solver.setPrimalVariable" command after the "solver.initSolver", and the problem was colsed。
Ho @chenguoxi1987, it is pretty hard to figure out what is going wrong from those three lines. Can you provide some more information? Also, if you can share the code that is failing, it may help.
thank you, I put the "solver.setPrimalVariable" command after the "solver.initSolver", and the problem was colsed。
Nice catch @chenguoxi1987, indeed this should not happen. I have opened #88 to fix this.
how to set the initial value replacing the defaule default value