ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Rviz Marker Triangle List: bad shader

asked 2016-10-28 06:52:59 -0500

m4nh gravatar image

updated 2016-10-29 04:33:44 -0500

gvdhoorn gravatar image

Why if i create a Mesh triangle-by-triangle by using visualization_msgs::Marker (type=TRIANGLE_LIST) the shader doesn't take into account normals ? Surface shader is not working. See attached image:

image description

edit retag flag offensive close merge delete

Comments

Does it look like that from all angles? Sometimes the order of the points will determine the normal face, i.e. clockwise will give you a normal in one direction and counterclockwise will give you a normal in the opposite direction.

William gravatar image William  ( 2016-10-28 14:45:41 -0500 )edit

Yes! It looks like flat from every vantage point. Reversing order of triangle makes all mesh go away.

m4nh gravatar image m4nh  ( 2016-10-29 04:02:34 -0500 )edit

RViz will not show any material / texture if there is no valid transform from whatever Fixed Frame is set to and the value you have set in the header.frame_id field. Could you include a snippet of how you setup your Marker msg? And describe the rest of your TF tree?

gvdhoorn gravatar image gvdhoorn  ( 2016-10-29 04:32:36 -0500 )edit

In this example is just a simple node with no TF tree behind. I just set frame_id as "world" and set "world" as base frame in Rviz.. so i think is an Identity transform... could this be the problem?

m4nh gravatar image m4nh  ( 2016-10-29 06:17:42 -0500 )edit

If RViz is set to use world as the Fixed Frame, then things should be ok. Make sure RViz doesn't complain about anything.

gvdhoorn gravatar image gvdhoorn  ( 2016-10-29 07:44:19 -0500 )edit

This looks like how a mesh shows up when it doesn't have any transforms. e.g. a RobotModel with no state publisher or tf publisher behind it

OzzieTheHead gravatar image OzzieTheHead  ( 2021-08-11 12:36:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-10-29 09:07:07 -0500

m4nh gravatar image

The issue is resolved by removing colors per each vertex! If you resize marker.colors array to the same size of marker.points array (and choose some color for each vertex) the color of rendered faces is forced to ignore light and shader. Leave colors array void and change only the marker.color parameter to paint your mesh.

edit flag offensive delete link more

Comments

hm. Is that as this is/was intended @William?

gvdhoorn gravatar image gvdhoorn  ( 2016-10-29 09:21:09 -0500 )edit

I don't know. So you're saying the per color vertex is broken?

William gravatar image William  ( 2016-10-29 15:01:03 -0500 )edit

the result of "per color vertex" method is the one shown in the attached figure

m4nh gravatar image m4nh  ( 2016-10-29 15:17:23 -0500 )edit

Could you perhaps add a MWE to your question, or make one available on github? That would make reproducing this a lot easier.

gvdhoorn gravatar image gvdhoorn  ( 2016-10-30 03:29:01 -0500 )edit

@gvdhoorn this is the example node: https://dl.dropboxusercontent.com/u/1... there is an external parameter per_vertex_color (bool) to activate/deactivate the malfunctioning.

m4nh gravatar image m4nh  ( 2016-10-30 08:35:47 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2016-10-28 06:52:59 -0500

Seen: 1,372 times

Last updated: Oct 29 '16