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

Support resource files with spaces #197

Merged
merged 5 commits into from
Nov 21, 2020
Merged

Support resource files with spaces #197

merged 5 commits into from
Nov 21, 2020

Conversation

chapulina
Copy link
Contributor

Resolves #160

Tested with gazebosim/gazebo-classic#2877

I rebased @willcbaker's fix and built on top of it.

Test it manually

  1. Download these 2 models into ~/.gazebo/models

  2. Source gazebo/setup.sh according to your installation.

  3. Set env var: GAZEBO_MODEL_PATH=$HOME/.gazebo/models:$GAZEBO_MODEL_PATH

  4. Redeploy to webify local models: npm run deploy --- -m local

  5. Save this world as spaces.world:

    spaces.world

    <?xml version="1.0" ?>
    <sdf version="1.5">
      <world name="default">
        <!-- A global light source -->
        <include>
          <uri>model://sun</uri>
        </include>
        <!-- A ground plane -->
        <include>
          <uri>model://ground_plane</uri>
        </include>
        <include>
          <uri>model://Stop sign with spaces</uri>
        </include>
        <include>
          <pose>3 0 0 0 0 0</pose>
          <uri>model://Cordless drill with spaces</uri>
        </include>
      </world>
    </sdf>
    
    

  6. Start gzserver spaces.world -u

  7. Start GzWeb: npm start

image

Supported file types

  • Models with spaces (Stop sign with spaces / Cordless drill with spaces)
  • Meshes with spaces (cordless drill.dae / cordless drill.stl / stop sign.dae)
  • Material files with spaces (stop sign.material)
  • Textures with spaces referenced from DAE (cordless drill.png)
  • Textures with spaces referenced from Ogre material (StopSign Diffuse.png / StopSign Spec.png)

willcbaker and others added 4 commits November 11, 2020 14:02
Signed-off-by: Louise Poubel <louise@openrobotics.org>
…showing

Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina self-assigned this Nov 16, 2020
@chapulina chapulina requested a review from iche033 November 17, 2020 01:39
@iche033
Copy link
Contributor

iche033 commented Nov 17, 2020

The Stop sign with spaces model on fuel contains references to model://Stop Sign/. After updating the URIs, the models load fine!

I also tested the model with spaces model from gazebosim/gazebo-classic#2877 but that didn't work though. Having that model in the model path and rerunning npm run deploy --- -m local also stopped the Stop sign with spaces textures from showing up.

@chapulina
Copy link
Contributor Author

The Stop sign with spaces model on fuel contains references to model://Stop Sign/.

Woops, nice catch. I updated the model.

I also tested the model with spaces model from gazebosim/gazebo-classic#2877 but that didn't work though.

Yeah I think that model has several things unsupported by GzWeb. One is nested models (#102). But there's also something about that DAE file that GzWeb doesn't like, with spaces or without. I checked that the texture is correctly fetched by the browser, but it isn't displayed. That's why I chose to use DAE files that are known to work with GzWeb here.

Having that model in the model path and rerunning npm run deploy --- -m local also stopped the Stop sign with spaces textures from showing up.

👀 That's weird, I'll take a look.

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina
Copy link
Contributor Author

Having that model in the model path and rerunning npm run deploy --- -m local also stopped the Stop sign with spaces textures from showing up.

The problem was caused by that model having an Ogre material that contains spaces in its name. This was messing up all materials. That should be fixed now: 82ab597

It's unfortunate that a single malformed material can mess up all materials 😕

Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, missing texture issue is fixed for me.

@chapulina chapulina merged commit 47aa854 into gzweb_1.4 Nov 21, 2020
@chapulina chapulina deleted the chapulina/spaces branch November 21, 2020 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants