gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.18k stars 480 forks source link

General guide on building gazebo from source on Windows 11 #3390

Closed WillyTuring closed 2 months ago

WillyTuring commented 2 months ago

Hi you guys,

I am developing our custom UI for interacting with 6 dof robotic arm based on Gazebo in wsl2 on Windows11; the primary part is almost finished, now we want to migrate the application to the native Windows OS, since we have done a few modifications on the gazebo source code, we want to build the application from source as well on Windows rather than using Conda or direct gazebo installation with "vcpkg install --triplet=x64-windows gazebo".

The problem we have encountered is that since the CMakeLists.txt file from "https://github.com/gazebosim/gazebo-classic/tree/gazebo11" is intended for the build up on Unix-like system with such as pkg-config tool etc; we have changed a lot to suit the CMake on Windows, but still run into a lot of dependencies problem like Dart package, profiler, tcmalloc just to name a few.

Now my question is that has anyone who has built it from source on Windows, will it work? Is there any general guidance on how to do that? Any suggestions would be really appreciated, thanks in advance.

WillyTuring commented 2 months ago

Now run the gazebo from vcpkg\installed\x64-windows\bin\gazebo --verbose

I did, the same as before, no change.

talregev commented 2 months ago

Did you add the new paths from vcpkg\installed\x64-windows-release\bin and other?

WillyTuring commented 2 months ago

bin.txt

talregev commented 2 months ago

bin.txt

You need to add the E:\19.gazebo_project\gazebo\installed\x64-windows-release\bin to path. also other folders that found on E:\19.gazebo_project\gazebo\installed\x64-windows-release\

talregev commented 2 months ago

try to look on vcpkg\installed\x86-windows-release\share\gazebo the file setup.bat.

talregev commented 2 months ago

I also remember now. That x64 is not working, only the x86. So you need to do again, for x86. Sorry about that.

WillyTuring commented 2 months ago

I also remember now. That x64 is not working, only the x86. So you need to do again, for x86. Sorry about that.

Ok then, let's revise the configure command and try it again to see how it works.

WillyTuring commented 2 months ago

What's your local time there?

talregev commented 2 months ago

I also want to mention, that you can run it on x86, but the gazebo build with vcpkg is very buggy. Basic stuff will not work as it should. I think most of the problem that it not find the correct dlls, and you need to debug it on your own. I will not have time to help you to do so. So if you are going on this routh, know this. I don't know what the state of gazebo if you compile it with conda. @traversaro can help you with that if you choose.

If you still want to continue the path with vcpkg, you need to start from the vcpkg install phase with x86. It will install everything from scratch.

WillyTuring commented 2 months ago

Well, that's awkward, the reason for trying with vcpkg is because we have modified the source code of the gazebo-classic to suit our need for robot UI in Linux as our original developing environment.

Now that you pointed out, i am really not sure what to do, what's your suggestion about my case? The reason for migrating to Windows is simply because this is more user-friendly OS commercially and also there are a few APIs we used for our application running on windows OS though.

talregev commented 2 months ago

@traversaro what the state of gazebo when you compile it with conda. Can you compile it with modify source code?

WillyTuring commented 2 months ago

I think it's gonna take a good while, guess have to see the final result tomorrow.

But if conda is not supporting building the modified source, wha then, are we stuck? I mean the source code we change mainly revolve around the main UI window, mainly visual related; the actual functional stuff are all done via plugins.

talregev commented 2 months ago

I think it's gonna take a good while, guess have to see the final result tomorrow.

But if conda is not supporting building the modified source, wha then, are we stuck? I mean the source code we change mainly revolve around the main UI window, mainly visual related; the actual functional stuff are all done via plugins.

I am sorry for the long effort you made, I try to help as much as I can. I understand that there was a miscommunication and we run to the "solution" instead just chat and replan. I think the conda gazebo installation can be done from modify source code, but the final answer on that matter only give @traversaro.

You don't stuck, because the vcpkg build from source can build and run gazebo on windows. You just need to work hard that it will run properly on windows. And I can help you to the point when gazebo will run (in a buggy way). Because I did it myself on my pc. Then you will have verbose that you can debug it. and also you can build it with debug and debug it.

talregev commented 2 months ago

vcpkg and conda packages are built from source on Windows, so I can confirm that it is possible to build Gazebo from source on Windows.

In previous comments of @traversaro: https://github.com/gazebosim/gazebo-classic/issues/3390#issuecomment-2265300967

Also point out the file in the ci that gazebo compile with conda: https://github.com/gazebosim/gazebo-classic/blob/e4b4d0fb752c7e43e34ab97d0e01a2a3eaca1ed4/.github/workflows/conda-forge.yml#L97-L102

WillyTuring commented 2 months ago

Not at all, i really appreciate all the help you guys given in the last few days, especially in the format of going forth and back at a quick exchange pace, really like the efficiency.

You don't stuck, because the vcpkg build from source can build and run gazebo on windows. You just need to work hard that it will run properly on windows. And I can help you to the point when gazebo will run (in a buggy way). Because I did it myself on my pc. Then you will have verbose that you can debug it. and also you can build it with debug and debug it.

That's good to know to say the least then.

Actually one sidetrack question about the gazebo community, maybe a little dumb to ask, is this repository maintained currently all by you two?

talregev commented 2 months ago

I am not the maintainer. @traversaro is one of the maintainers and there is couple more.

WillyTuring commented 2 months ago

Kudos to you and all those people, i have little knowledge about the open source community, as far as i concern, a lot of them are actually taking it as a full-time job, right? On the one hand i am feeling really fortunate to have those people like you around whom we can seek help from; on the other hand, i can not fully grasp the motivation of those people, why would they contribute this much to the open-source community rather than utilize it commercially?

talregev commented 2 months ago

I can speak for myself. For me it an hobby. I do it when I like it, and the projects I like and move forward the things I want. I gain joy, is interesting for me, and also improve my skills, and I gain knowledge and experience like that.

WillyTuring commented 2 months ago

Finally got it build successfully, what buggy experiences did you have previously can you share one or two as an example?

I can speak for myself. For me it an hobby. I do it when I like it, and the projects I like and move forward the things I want. I gain joy, is interesting for me, and also improve my skills, and I gain knowledge and experience like that.

azeey commented 2 months ago

Actually one sidetrack question about the gazebo community, maybe a little dumb to ask, is this repository maintained currently all by you two?

Gazebo-classic is scheduled to be EOL in 2025-01-29, so we're doing minimal maintenance. All new development is happening on modern gazebo at https://github.com/gazebosim/gz-sim

talregev commented 2 months ago

@WillyTuring Did you manage to run it? I cannot add things

image

WillyTuring commented 2 months ago

@WillyTuring Did you manage to run it? I cannot add things

image

Haven't tried this yet, as i was migrating and modifying the code; will try it out later today and let you know.

WillyTuring commented 2 months ago

@talregev image Did you have this same issue? Couldn't find the correct model file?

talregev commented 2 months ago

Yes. you should debug it with --verbose I cannot help you any farther. I am glad that you succeeded to do it with vcpkg. You can try to build it with conda like in the ci. (mamba). I hope @traversaro can tell more about this state before you try. If it run and work correctly on windows. Also like @azeey mention there is a new gazebo. This version End Of Life is on 29.1.2025.

WillyTuring commented 2 months ago

I don’t think gz-sim is Windows-ready yet. I am not familiar with Conda package tool, i am still migrating the plugins as for now, we will see how it goes. Thanks so much, really appreciate your help.

发自我的iPhone

------------------ Original ------------------ From: talregev @.> Date: Fri, Aug 9, 2024 3:08 PM To: gazebosim/gazebo-classic @.> Cc: WillyTuring @.>, Mention @.> Subject: Re: [gazebosim/gazebo-classic] General guide on building gazebo fromsource on Windows 11 (Issue #3390)

Yes. you should debug it with --verbose I cannot help you any farther. I am glad that you succeeded to do it with vcpkg. You can try to build it with conda like in the ci. (mamba). I hope @traversaro can tell more about this state before you try. If it run and work correctly on windows. Also like @azeey mention there is a new gazebo. This version End Of Life is on 29.1.2025.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

traversaro commented 2 months ago

I hope @traversaro can tell more about this state before you try. If it run and work correctly on windows.

Yes, with conda-forge dependencies Gazebo Classic works fine, I am not aware of any outstanding bug and many persons in my lab use it. You can also build Gazebo Classic from source, following the instructions in this CI job: https://github.com/gazebosim/gazebo-classic/blob/gazebo11/.github/workflows/conda-forge.yml .

I don’t think gz-sim is Windows-ready yet.

As long as you launch separately gz sim -s (server) and gz sim -g (client) gz sim works fine on Windows, see https://github.com/gazebosim/gz-sim/pull/2382 . However, to be honest I do not have enough Windows users of gz sim in my lab to say that it has been extensive tested.

WillyTuring commented 2 months ago

@talregev Hi, have you solved the issue of adding the model to gazebo-classic in windows?

talregev commented 2 months ago

No. I will not have time to solve it. I recommend for you try the conda way. If you need help with conda, you can post it here.

WillyTuring commented 2 months ago

No. I will not have time to solve it. I recommend for you try the conda way. If you need help with conda, you can post it here.

Have you tried with Conda approach before? is everything fine?

WillyTuring commented 2 months ago

image Here is my situation, no error reports. Been stuck in this state for a while now...

talregev commented 2 months ago

I hope @traversaro can tell more about this state before you try. If it run and work correctly on windows.

Yes, with conda-forge dependencies Gazebo Classic works fine, I am not aware of any outstanding bug and many persons in my lab use it. You can also build Gazebo Classic from source, following the instructions in this CI job: https://github.com/gazebosim/gazebo-classic/blob/gazebo11/.github/workflows/conda-forge.yml .

I don’t think gz-sim is Windows-ready yet.

As long as you launch separately gz sim -s (server) and gz sim -g (client) gz sim works fine on Windows, see gazebosim/gz-sim#2382 . However, to be honest I do not have enough Windows users of gz sim in my lab to say that it has been extensive tested.

@WillyTuring I didn't try, but I quote @traversaro that have experience with conda approch in his lab.

WillyTuring commented 2 months ago

image

Trying to load up the GUI plugin, we just hang in the Advertise() method call, @talregev any idea why might give me some hint?