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

Particles with THREE Nebula #35

Merged
merged 7 commits into from
Sep 28, 2022
Merged

Particles with THREE Nebula #35

merged 7 commits into from
Sep 28, 2022

Conversation

german-e-mas
Copy link
Collaborator

This PR adds https://three-nebula.org/ in order to handle particles. It also removes SPE.

The only thing that cannot be handled by this library is the color range image, as we cannot interpolate between more than two points for Color behaviour.

Can you ptal @nkoenig ?

@german-e-mas german-e-mas self-assigned this Sep 16, 2022
@nkoenig
Copy link
Contributor

nkoenig commented Sep 22, 2022

What did you use to test this? I'm trying with this world file:

<?xml version='1.0' encoding='utf-8'?>
<sdf version="1.9">
  <world name="test">
    <!--
     <include>
        <uri>https://fuel.ignitionrobotics.org/1.0/hyundai/models/rubicon</uri>
    </include>
    -->
    <scene>
      <sky>
      </sky>
    </scene>

    <model name="snow">
      <static>true</static>
      <link name="link">
        <particle_emitter name="snow_emitter" type="box">
            <emitting>true</emitting>
            <size>75 75 0</size>
            <particle_size>0.1 0.1 0.1</particle_size>
            <lifetime>10</lifetime>
            <min_velocity>2</min_velocity>
            <max_velocity>4</max_velocity>
            <scale_rate>0</scale_rate>
            <rate>100</rate>
            <material>
                <diffuse>0.7 0.7 0.7</diffuse>
                <specular>1.0 1.0 1.0</specular>
                <pbr>
                    <metal>
                      <albedo_map>/home/nkoenig/.ignition/fuel/fuel.ignitionrobotics.org/hyundai/models/rubicon snowy/1/materials/textures/snowflake.png</albedo_map>
                    </metal>
                </pbr>
            </material>
            <color_range_image>/home/nkoenig/.ignition/fuel/fuel.ignitionrobotics.org/hyundai/models/rubicon snowy/1/materials/textures/fogcolors.png</color_range_image>
        </particle_emitter>

      </link>
    </model>
  </world>
</sdf>

and I get the following errors:

core.mjs:7643 ERROR TypeError: Cannot read properties of null (reading 'data')
    at GZ3D.SdfParser.createParticleEmitter (gz3d.min.js:1:1043851)
    at GZ3D.SdfParser.createLink (gz3d.min.js:1:1041927)
    at GZ3D.SdfParser.spawnModelFromSDF (gz3d.min.js:1:1037878)
    at GZ3D.SdfParser.spawnFromObj (gz3d.min.js:1:1036477)
    at visualization.component.ts:241:41
    at Array.forEach (<anonymous>)
    at Object.next (visualization.component.ts:240:26)
    at ConsumerObserver.next (Subscriber.js:91:33)
    at SafeSubscriber._next (Subscriber.js:60:26)
    at SafeSubscriber.next (Subscriber.js:31:18)

@german-e-mas
Copy link
Collaborator Author

What did you use to test this? I'm trying with this world file:

<?xml version='1.0' encoding='utf-8'?>
<sdf version="1.9">
  <world name="test">
    <!--
     <include>
        <uri>https://fuel.ignitionrobotics.org/1.0/hyundai/models/rubicon</uri>
    </include>
    -->
    <scene>
      <sky>
      </sky>
    </scene>

    <model name="snow">
      <static>true</static>
      <link name="link">
        <particle_emitter name="snow_emitter" type="box">
            <emitting>true</emitting>
            <size>75 75 0</size>
            <particle_size>0.1 0.1 0.1</particle_size>
            <lifetime>10</lifetime>
            <min_velocity>2</min_velocity>
            <max_velocity>4</max_velocity>
            <scale_rate>0</scale_rate>
            <rate>100</rate>
            <material>
                <diffuse>0.7 0.7 0.7</diffuse>
                <specular>1.0 1.0 1.0</specular>
                <pbr>
                    <metal>
                      <albedo_map>/home/nkoenig/.ignition/fuel/fuel.ignitionrobotics.org/hyundai/models/rubicon snowy/1/materials/textures/snowflake.png</albedo_map>
                    </metal>
                </pbr>
            </material>
            <color_range_image>/home/nkoenig/.ignition/fuel/fuel.ignitionrobotics.org/hyundai/models/rubicon snowy/1/materials/textures/fogcolors.png</color_range_image>
        </particle_emitter>

      </link>
    </model>
  </world>
</sdf>

and I get the following errors:

core.mjs:7643 ERROR TypeError: Cannot read properties of null (reading 'data')
    at GZ3D.SdfParser.createParticleEmitter (gz3d.min.js:1:1043851)
    at GZ3D.SdfParser.createLink (gz3d.min.js:1:1041927)
    at GZ3D.SdfParser.spawnModelFromSDF (gz3d.min.js:1:1037878)
    at GZ3D.SdfParser.spawnFromObj (gz3d.min.js:1:1036477)
    at visualization.component.ts:241:41
    at Array.forEach (<anonymous>)
    at Object.next (visualization.component.ts:240:26)
    at ConsumerObserver.next (Subscriber.js:91:33)
    at SafeSubscriber._next (Subscriber.js:60:26)
    at SafeSubscriber.next (Subscriber.js:31:18)

Good call. I was connecting with a simulation via websocket. I think there could be inconsistencies between protobuf and sdf values, given that we are trying to read data from a null value. I'll take a look.

@german-e-mas
Copy link
Collaborator Author

german-e-mas commented Sep 27, 2022

I'm having an issue while testing the world directly.

ign gazebo testWorld.sdf 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-developer'
libEGL warning: failed to open /dev/dri/renderD128: Permission denied

And nothing is being rendered on Gazebo. Note that on my test world, I had to change the path of the snow sprites.


EDIT: Running in headless mode worked well.

@german-e-mas
Copy link
Collaborator Author

Thanks @nkoenig . I'll merge this and get ready for a new release.

@german-e-mas german-e-mas merged commit 71eec8d into gzweb2 Sep 28, 2022
@german-e-mas german-e-mas deleted the particles branch September 28, 2022 19:22
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.

2 participants