Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download Fuel models on the background #1260

Open
chapulina opened this issue Dec 20, 2021 · 2 comments · May be fixed by #1669
Open

Download Fuel models on the background #1260

chapulina opened this issue Dec 20, 2021 · 2 comments · May be fixed by #1669
Assignees
Labels
enhancement New feature or request OOBE 📦✨ Out-of-box experience

Comments

@chapulina
Copy link
Contributor

When opening a world with models that have not been downloaded, there can be a long delay before the GUI opens.
It's also not possible to close gazebo while it's doing the initial download of models.

Desired behavior

While models are loading, the user should be able to interact with the window and close it if wanted.

Alternatives considered

I guess we could not open the window until the models are loaded, but that may be more confusing for users.

Implementation suggestion

  • Download models in a separate thread
  • Display models as they're downloaded
  • Cancel loading if a signal is received
  • Display status to user of what models are being loaded and what are missing
  • Once we have a splash screen (Splash screen support gz-gui#336), we can use it to display this information
@chapulina chapulina added the enhancement New feature or request label Dec 20, 2021
@osrf-triage osrf-triage added this to Inbox in Core development Dec 20, 2021
@chapulina chapulina moved this from Inbox to To do in Core development Dec 20, 2021
@chapulina chapulina added the OOBE 📦✨ Out-of-box experience label Dec 20, 2021
@chapulina chapulina moved this from To do to In progress in Core development Mar 25, 2022
@ahcorde
Copy link
Contributor

ahcorde commented Apr 8, 2022

I have been working in this issue but I have some blockers. This is the branch of the current implementation https://github.com/ignitionrobotics/ign-gazebo/tree/ahcorde/download_background

  • When I call Root::Load()

https://github.com/ignitionrobotics/ign-gazebo/blob/0e255a076c9063356c301e9d70118263051b3307/src/Server.cc#L168

I need to "fail" this call when there is a include tag because I launch a thread for each one of the include tag.

https://github.com/ignitionrobotics/ign-gazebo/blob/0e255a076c9063356c301e9d70118263051b3307/src/ServerPrivate.cc#L558-L561

The callback method will return an empty string making the Load method to fail, but when the thread has downloaded the resources are included. This is not problematic at all (we can filter the error in the load method), but when a include fails then I loose the pose and name, which are inside the include tag. But the model is not included because I force to fail to create the thread.

First question I don't know how to recover this data, is there any way to get this values ? the only idea that came to my mund is reloading the file again

This gif shows how models are downloaded in the background but without the right position and naming.

download_background


The other issue is about SDFs that define a geometry with an URI, this is still blocking the GUI. Like this one

 <model name="Radio">
      <pose>3 -1.5 0 0 0 0</pose>
      <static>true</static>
      <link name="link">
        <collision name="collision">
          <geometry>
            <mesh>
              <uri>https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Radio/4/files/meshes/Radio.dae</uri>
            </mesh>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <mesh>
              <uri>https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Radio/4/files/meshes/Radio.dae</uri>
            </mesh>
          </geometry>
        </visual>
      </link>
    </model>

The model is downloaded in the same thread but for some reason this is blocking the runner

Question: I'm not really sure who might be blocking the runner. any thoughts?


This feature might include some changes in sdformat or/and fuel, Do you have any thoughts ?
@chapulina @scpeters @azeey

@scpeters
Copy link
Member

scpeters commented May 3, 2022

when a include fails then I loose the pose and name, which are inside the include tag. But the model is not included because I force to fail to create the thread.

First question I don't know how to recover this data, is there any way to get this values ? the only idea that came to my mund is reloading the file again

This reminds me of the PreserveIncludes option in PrintConfig.hh (used in various libsdformat APIs for printing to strings) and also the ToElementUseIncludeTag option in OutputConfig.hh from gazebosim/sdformat#918 that is used to configure the ToElement() APIs.

  • When I call Root::Load()

https://github.com/ignitionrobotics/ign-gazebo/blob/0e255a076c9063356c301e9d70118263051b3307/src/Server.cc#L168

I need to "fail" this call when there is a include tag because I launch a thread for each one of the include tag.

The callback method will return an empty string making the Load method to fail, but when the thread has downloaded the resources are included. This is not problematic at all (we can filter the error in the load method), but when a include fails then I loose the pose and name, which are inside the include tag. But the model is not included because I force to fail to create the thread.

I don't really understand all that is happening here

@j-rivero j-rivero removed this from In progress in Core development May 6, 2022
@nkoenig nkoenig linked a pull request Aug 26, 2022 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request OOBE 📦✨ Out-of-box experience
Projects
None yet
3 participants