-
Notifications
You must be signed in to change notification settings - Fork 466
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
Visualization markers ignore color and show everything as white #1120
Comments
@gaya- sorry for the regression. That code has been tricky, I'll have a look and see if I can just revert those changes for now and do another release. |
Cross-reference to the answers.ros.org: http://answers.ros.org/question/265425/ros-indigo-rviz-maker-turned-white-after-update/ |
Unfortunately the cad models that created this problem are proprietary so I cannot share them :/ |
I just spent some time trying to reproduce this with Indigo, but I cannot. The behavior in #1084 seems correct to me and seems to still be the case with the latest version of rviz for Indigo. (btw @gaya- exactly which version of rviz are you using?) I'm going to wait until either @gaya- or someone else can provide me with a bag file or simple Python script to reproduce it. |
Hey! I have the very same problem.
Which I believe is the normal code for spawning a mesh as Marker (the position is separately set). Still, it appears white, and it didn't until a month ago. It is white with any .stl model I tried. It is gray (as I want it) sometimes, like when I run it after restarting the pc, but then it goes back to white. This thing is driving me crazy. |
@HenrySleek what version of rviz are you using? Unfortunately your snippet isn't very helpful without the mesh and the rest of the surrounding code. I'll try to use it as a template to test this out. I was testing with dae before. |
Ok, I can reproduce this, but only on Kinetic (Xenial). I can also fix by (re?)applying #1084 to kinetic-devel. I was trying Indigo before, but I think the patch that fixes the issue is already present on the latest version of Indigo: rviz/src/rviz/default_plugin/markers/mesh_resource_marker.cpp Lines 194 to 215 in d9b806d
@gaya-, I'll ask again which version of rviz exactly are you using on Indigo? |
I merged #1129, so if anyone with this problem on Kinetic could try it out that would be great. I'm still looking into Indigo's issues. |
I'm using version 1.11.16. Here is a sample python code with a sample collada mesh: And here's a screenshot of rviz: You run the script like this: Running Ubuntu 14.04, ROS Indigo, GeForce GTX 980 graphics card, NVidia driver, nothing all that special. |
Ok, I've narrowed down the issue. There must be a problem with the code that sets the color initially. @gaya- if you start rviz, start your example, visualize it in rviz (it will be white), then edit your example to change the color or alpha, then run it again (without closing rviz) then it will render correctly. I'm still tracking down the source of logic error, but at least I've narrowed down/reproduced the issue. |
The bug is gone in version 1.11.17 of indigo-devel. |
@wjwwood #!/usr/bin/env python
import rospy
from std_msgs.msg import ColorRGBA
from visualization_msgs.msg import Marker, MarkerArray
from geometry_msgs.msg import Point, Vector3, Quaternion
def createMarker(frame, mtype, m_id, position=Point(0, 0, 0), orientation=Quaternion(0, 0, 0, 1),
scale=Vector3(1, 1, 1), rgba=None):
"""
:rtype: Marker
:return:
"""
marker = Marker()
marker.header.frame_id = frame
marker.type = mtype
marker.id = m_id
marker.action = Marker.MODIFY
marker.pose.position = position
marker.pose.orientation = orientation
marker.scale = scale
if rgba:
r, g, b, a = rgba
r, g, b = r / 256., g / 256., b / 256.
else:
r, g, b, a = 0, 0, 0, 0
marker.color = ColorRGBA(r, g, b, a)
return marker
if __name__ == '__main__':
# node init
rospy.init_node('marker_dae_test')
rate = rospy.Rate(1)
# publishers
pub = rospy.Publisher('markers', MarkerArray, queue_size=1)
# --------------------------------------------------------- Markers -
msg = MarkerArray()
# cube
cube = createMarker('world', Marker.MESH_RESOURCE, 1)
cube.mesh_resource = "package://env_3d/data/nil_link_mesh.dae"
cube.mesh_use_embedded_materials = True
# add markers to list
msg.markers.append(cube)
while not rospy.is_shutdown():
pub.publish(msg)
rate.sleep() And here is the .dae file. Also, when I use another mesh_resource: cube.mesh_resource = "package://rviz/src/test/meshes/pr2-base.dae" Then the texture is correctly displayed. Am I missing something ? |
@exo-core I also noticed that if you use image textures in Blender then Rviz displays it correctly. But everything else that uses classic colored materials doesn't work. (it can be a workaround while waiting for a correct fix) |
@ejalaa12 I also noticed. The textured meshes from the pr2-description package are working fine. |
Either @dhood or I will try to reproduce what you've described as soon as we can. |
+1, have white meshes when textured using basic material in blender (not UV map) |
I think this was fixed a while back by #1132 (it claims to do so), please comment if this is not the case for someone. |
Ah, I already closed/reopened this... Sorry. |
Still an issue. |
Still an issue in ROS kinetic (white meshes for .dae meshes) |
Trying to view this in in Rviz shows only a white box. Interestingly, viewing this in RViz works fine. The minute I edit the PNG file or change anything, it doesn't. |
I've decided to have a look to understand the full issue where the problem comes from by looking at every possible scenario. use_embedded_materials=False (works fine)When use_embedded_materials=True (issue)r,g,b,a = 0,0,0,0Textured materials are used correctly. But `'classical color' materials are white. r,g,b = 0,0,0 ; alpha !=0Textured materials and classical materials are black with alpha transparency r,g,b != 0,0,0; alpha = 0Everything is invisible (because alpha=0) r,g,b,a != 0,0,0,0Textured materials are tinted with r,g,b and have the alpha transparency It's weird that this issue keeps coming back, it has been solved here apparently #752 by creating passes but his solution has disappeared since then from the source code. I tried to write it back, but my knowledge of Ogre is very limited, and I can't figure it out. I've put the files for testing this on a gist that you can find here |
…w everything as white Re-integrate patch from ros-visualization#752 Color tinting for mesh markers Signed-off-by: Xavier BROQUERE <xav.broquere@gmail.com>
Reproduced on Melodic, I re-integrated #752 on top of melodic branch |
I filed a new solution for this issue: #1424. Please verify that this solution is satisfying to you. |
Hi Robert, However, I noticed that there is now a WARN message: "[ WARN] [1568279672.815047353]: Marker '/0': Marker is fully transparent (color.a is 0.0)." when I want to only use embedded color (r=g=b=a=0). Seems that this is introduced by #1275 . #1424 handle this particular usecase with the line 182: "update_color = !(new_message->mesh_use_embedded_materials && r == 0 && g == 0 && b == 0 && a == 0);" but not #1275 Can you see if this usecase can be managed in maker_utils.cpp::checkMarkerMsg to avoid this WARN message ? |
Thanks for this hint. I will add yet another fixup to #1275 to handle this case. |
Thanks :) |
After the last update on Indigo visualization markers started to appear white.
The message is the same as before and has correct color data.
I suspect it was one of the latest commits about collada file visualization.
Do I understand it correctly that the color information from the Collada file has now higher precedence than the visualization marker message color? If so, what is the reasoning behind that?
The text was updated successfully, but these errors were encountered: