robotology / osqp-eigen

Simple Eigen-C++ wrapper for OSQP library
https://robotology.github.io/osqp-eigen/
BSD 3-Clause "New" or "Revised" License
383 stars 113 forks source link

Problems writing MPC programs using eigen,osqp,osqp-eigen in VS2015 #169

Open DRETQ opened 1 month ago

DRETQ commented 1 month ago

Can anyone tell me what the problem is? 捕获

S-Dafarra commented 1 month ago

Hi @DRETQ, can you describe:

DRETQ commented 1 month ago

@S-Dafarra The version of osqp-eigen is 0.8.1, the version of osqp is 0.6.3,I used the debug x86 local windows debugger command and the compiler is cmake.

S-Dafarra commented 1 month ago

Given the error message, the problem seems similar to https://github.com/robotology/osqp-eigen/issues/162#issuecomment-2135097303

Are you 100% sure you did not accidentally used osqp master branch? Because this error is exactly what you get if you are compiling against osqp master on Windows, see https://github.com/robotology/osqp-eigen/issues/146 and https://github.com/osqp/osqp/issues/576 for the actual issue tracking the problem.

Also, can you report the CMakeCache.txt of both osqp and osqp-eigen to understand if something is going wrong?

One possible attempt is to try using the master version of osqp-eigen given that https://github.com/robotology/osqp-eigen/pull/163 should have fixed the issue.

One final remark, please avoid pasting screenshots of errors, but rather copy and paste them. This would allow others to find the same solution by searching for the same error online, and would allow me to translate errors more easily.

DRETQ commented 1 month ago

CMakeCache(osqp).txt CMakeCache(osqp-eigen).txt Thanks for your reply, what is the master version of osqp-eigen? I apologize for any inconvenience caused by the use of screenshots.

S-Dafarra commented 1 month ago

Could you do

cd E:/LibraryVS15/osqp-master/osqp
git log -1

and post the output?

Thanks for your reply, what is the master version of osqp-eigen?

You can do

cd E:/LibraryVS15/osqp-eigen-master
git checkout master
git pull

and then compile again

DRETQ commented 1 month ago

@S-Dafarra 22 23

S-Dafarra commented 1 month ago

How did you clone (download) the repo?

DRETQ commented 1 month ago

@S-Dafarra Do you mean how do I download osqp,osqp-eigen, I run the command from cmd to download online

S-Dafarra commented 1 month ago

I run the command from cmd to download online

Just to understand, which command?

From https://github.com/robotology/osqp-eigen/issues/169#issuecomment-2235219983 it seems that you don't have git installed

DRETQ commented 1 month ago

@S-Dafarra Commands used when installing osqp is :git clone --recursive -b release-0.6.3 https://github.com/oxfordcontrol/osqp.git. Configuring eigen,osqp,osqp-eigen on vs2015 should be successful because the official example file MPCExample given is able to run successfully.

S-Dafarra commented 1 month ago

Ok, then it seems you have git installed somewhere. Using the same application you used to do git clone, do also the commands I mentioned in https://github.com/robotology/osqp-eigen/issues/169#issuecomment-2233781833

DRETQ commented 1 month ago

@S-Dafarra You mean you want me to use git clone instead of git. Here are the results. 24 25

DRETQ commented 1 month ago

@S-Dafarra I found inconsistencies in reporting errors on vs2015 and vs2022,the osqp,eigen,osqp-eigen configured in it are the same.

S-Dafarra commented 1 month ago

@S-Dafarra You mean you want me to use git clone instead of git.

No, I meant to run the commands I posted above in a terminal where git can be used

DRETQ commented 1 month ago

@S-Dafarra Where can I run git if cmd doesn't work?

S-Dafarra commented 1 month ago

Apologies, I misunderstood the error message of https://github.com/robotology/osqp-eigen/issues/169#issuecomment-2235219983

The problem was not that git was not working. The problem was that the system did not go to the directory where you have osqp-eigen. Can you navigate to the folder where you have cloned osqp-eigen and do

git checkout master
git pull

?

DRETQ commented 1 month ago

Where i have cloned osqp-eigen is E:\LibraryVS15\osqp-eigen-master,isn't it? I don't know what you mean.

S-Dafarra commented 1 month ago

Where i have cloned osqp-eigen is E:\LibraryVS15\osqp-eigen-master,isn't it? I don't know what you mean.

Yes, please navigate to that folder and from within that folder execute the commands

git checkout master
git pull
DRETQ commented 1 month ago

@S-Dafarra Isn't that what I did before, with the same output as above?

S-Dafarra commented 1 month ago

@S-Dafarra Isn't that what I did before, with the same output as above?

No, if you look at https://github.com/robotology/osqp-eigen/issues/169#issuecomment-2235219983 you can see that it remained in the folder C:\Windows\system32. I cannot copy the message since you attached (once more) an image

traversaro commented 1 month ago

In command prompt cd only works inside the active drive. So if the current working directory is C:\Windows\system32 if you do:

cd E:\LibraryVS15\osqp-eigen-master

the current working directory will remain in C:\Windows\system32, as the active drive remains C:.

To go to E:\LibraryVS15\osqp-eigen-master, you need to first make E: the active drive by typing E:, and then call cd E:\LibraryVS15\osqp-eigen-master, i.e. :

C:\Windows\system32>E:
E:>cd E:\LibraryVS15\osqp-eigen-master
E:\LibraryVS15\osqp-eigen-master>

See https://stackoverflow.com/questions/17753986/how-to-change-directory-using-windows-command-line or https://stackoverflow.com/questions/11065421/command-prompt-wont-change-directory-to-another-drive for more info.

DRETQ commented 1 month ago

@S-Dafarra What you mean is that I need to do git log -1, git checkout master, and git pull in osqp and osqp-eigen folders respectively, not in windows system32. 26 27

DRETQ commented 1 month ago

@traversaro Thanks for the reply, I've remembered

S-Dafarra commented 1 month ago

Where is the source code of osqp-eigen? Maybe E:/LibraryVS15/osqp-eigen-master/osqp-eigen-0.8.1?

DRETQ commented 1 month ago

@S-Dafarra 28

S-Dafarra commented 1 month ago

Neither E:/LibraryVS15/osqp-eigen-master/osqp-eigen-0.8.1 is a git repository. Where did you clone the repo?

DRETQ commented 1 month ago

@S-Dafarra When installing osqp-eigen, I didn't choose to use the git hub command directly with the osqp install, but instead downloaded the optional installer from the web.

S-Dafarra commented 1 month ago

@S-Dafarra When installing osqp-eigen, I didn't choose to use the git hub command directly with the osqp install, but instead downloaded the optional installer from the web.

Ok then use git clone to download the repo and try switching to the master branch.

DRETQ commented 1 month ago

@S-Dafarra This is a problem with debug x86 when debugging, it doesn't seem to be a problem if you use debug x64

S-Dafarra commented 1 month ago

@S-Dafarra This is a problem with debug x86 when debugging, it doesn't seem to be a problem if you use debug x64

Ah good catch. To be honest I don't think we test in CI x86 builds, let alone VS2015

DRETQ commented 1 month ago

@S-Dafarra Yes, I've asked before and no one has used it on VS2015. And have a new question, I have defined the sparse hessian matrix as a square matrix in my program, why does the output say this: osqpeigen::data::sethessianmatrix the hessian matrix has to be a n*n size image

traversaro commented 1 month ago

Hello @DRETQ, please:

Thanks!