Gazebo | Ignition | Community
Ask Your Question
0

Apply normal map shader

asked 2018-10-18 03:21:00 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I noticed in the SDF specification one can add a <shader> tag with type normal_map_tangentspace to a <material> tag. But when I try to load my world file in gazebo 9 (also tried it in 7), the last output I get in the console is waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting.... It will wait forever.

I also made sure that the gazebo_model_path is set up correctly in my package.xml, so the texture file specified in the <normal_map> child tag should get found. It works at least for meshes and material scripts. Here is a snippet from my world file:

    <model name="model">
        <link name="link">               
            <visual name="visual">
                <geometry>
                    <mesh>
                        <uri>model://mesh.dae</uri>
                    </mesh>
                </geometry>
                <material>
                    <shader type="normal_map_tangentspace">
                        <normal_map>model://materials/textures/Normal.png</normal_map>
                    </shader>
                    <script>
                        <uri>model://materials/scripts</uri>
                        <name>Material</name>
                    </script>
                </material>
            </visual>
        </link>
    </model>

Does anyone have experience with this and knows what I'm missing?

Thanks in advance, David

edit retag flag offensive close merge delete

Comments

That console message seems to be coming from ROS and not related to Gazebo's rendering.

chapulina gravatar imagechapulina ( 2018-10-18 12:37:12 -0600 )edit

Also, I'd double-check that you're referring to the correct resource locations, usually you'd have the model name after `model://`

chapulina gravatar imagechapulina ( 2018-10-18 12:38:12 -0600 )edit

I'm pretty confident that the path is correct. I've tested it by using it in the mesh uri as well. The mesh got found after I copied it to the same location as my normal map image. And I double checked its name a 1000 times. I had the hope that the last output would give someone a hint where gazebo or ROS seem to encounter a problem. Sadly I have no other feedback, since there is no exception being thrown or anything. It just works fine as soon I comment out the <shader> tag in my world file.

D4KU gravatar imageD4KU ( 2018-10-22 07:59:07 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-12-20 11:33:50 -0600

D4KU gravatar image

I figured it out. I copied 'normal_map_tangentspace' from the SDF specification, but it's a typo. It must say 'normal_map_tangent_space'. That little thing has cost me hours...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-10-18 03:21:00 -0600

Seen: 1,397 times

Last updated: Dec 20 '18