-
Notifications
You must be signed in to change notification settings - Fork 276
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
wideanglecamera crashes gazebo #2002
Comments
are you able to run the wide angle camera by itself? I can reproduce the issue. I think the problem is that the waves model uses shaders that only work in ogre2 and the wide angle camera is currently only available in ogre1. For me I can run wide angle camera in ogre1 fine but not together with models that use shaders (e.g. waves, deformable sphere). In fact, this example world crashes with ogre
The underlying problem here is that shaders are not working in ogre1. Those models use glsl version 330. Maybe we just need to convert them to versions compatible with ogre1, e.g. 150 |
Yes I was able to run only the wide angle camera but I was also able to run only the waves with ogre1. It's when I put them together that the sim crashes. |
Want to double check on this. The gui could still be using ogre2 (and only the camera sensor on the server backend is using ogre1). Can you try running with
hmm weird, ogre1 should support camera sensors. Try launching the camera_sensor.sdf demo world and see if it also crashes? |
When I run
It does more or less the same thing when I try to run the example world wideanglecamera :/
But you were right for that, thanks ! I thought that |
ok it looks like ogre render engine does not work on your system but ogre2 does. Unfortunately wide angle camera is not yet available in ogre2. The ogre log may have some info on what went wrong, you can find it in |
Here it the log :
|
The ogre log does not reveal any errors. I thought it would then be Qt issue but it seems like Qt + ogre2 works fine for you. It's not ideal but you may have to go with ogre2 and use a normal camera + large horizontal FOV. |
Yeah that's what I did, at least users understand that is supposed to be a wide angle camera. Anyway, Thank you very much for your help and your time ! Do I close this issue as not planned or do I let it open ? |
ok I'll close this issue. By the way, wide angle camera support for ogre2 will be available in the next version of Gazebo (Harmonic) which will be released in Sept. Related PR: gazebosim/gz-rendering#733 |
I am running into this exact issue. It is a shaders issue and running the waves plugin or the command you suggested give the same Looking at the syntax changes between 330 and 150 I can't find incompatibility in the waves shader files. The ones I am using are here: https://github.com/srmainwaring/wave_sim_vrx In another forum someone wrote that the error message means that "It says that Ogre is trying to write more constants that the shader has" https://forums.ogre3d.org/viewtopic.php?t=24961&start=425 Any ideas? |
The waves model uses the shader param system. In the model.sdf file, you'll see blocks like <param>
<shader>vertex</shader>
<name>Nwaves</name>
<type>int</type>
<value>3</value>
</param>
<param>
<shader>vertex</shader>
<name>rescale</name>
<type>float</type>
<value>0.5</value>
</param>
<param>
<shader>vertex</shader>
<name>bumpScale</name>
<type>float_array</type>
<value>25 25</value>
</param>
These are for setting variables defined in the shader script. So in the above example, we expect variables like I'm assuming you took the shaders from here. Looking at the shaders there, you can probably just remove One special case is
and change the variable in vertex shader from |
Hi @iche033, thanks for the quick response. I am fairly new to all this so thanks for the detailed explanation. The project I am trying to run is the one found here: This is the model.sdf file for the waves in the project (can be found under vrx_gz/models/coast_waves/model.sdf):
How do I know which ones are not used in the glsl 150 version? I tried commenting them all out but the error still occurred.
In the same coast_waves directory of the project I cannot find a script file for the waves, am I looking in the wrong place? EDIT: Just opened the model.config file, didn't realize I'm talking to the author :)
|
ok I see. VRX is using a different system to render the waves so my previous instructions are less relevant. I did some tests. To have waves working in ogre 1.x, you'll need these changes from gazebosim/gz-rendering#908. In that pull request, I ported the vertex and fragment shaders to glsl version 150 so I think you should be able to use those and replace the ones in VRX. This will only get the the waves working with VRX though. There could be other things in VRX that don't work properly in ogre 1.x. |
Unfortunately, replacing the respective fragment and vertex files from the ones in the pull request did not seem to fix the issue. It still has the exact same error. I can verify it is only the waves causing the issues since removing the shaders lines from the coast waves sdf file allows the rest of the environment to load in without issues (just of course there are no waves anymore). I did see the changes in the ogre src code and was wondering if I need to make those as well maybe? But I am not sure how. |
Environment
Ubuntu 22.04
Gazebo Garden, binary
Rendering plugin: ogre
Generally, mention all circumstances that might affect rendering capabilities:
Rendering system info:
my code :
Another bug that I have and which is perhaps linked : if I switch to ogre1 my simple camera sensor stop to work too and the sim will also crash. But everything works fine with ogre2.
Description
Steps to reproduce
Output
The text was updated successfully, but these errors were encountered: