Ask Your Question

how to display a mesh with texture in RViz?

asked 2011-03-05 11:01:03 -0500

blueskin gravatar image

Hello All, All am trying is loading an OBJ model from a file and display/visualize using RViz. Or consider I have a node that publishes a new mesh and corresponding texture data @30Hz. Is there a way to display this 3D mesh with texture in RViz? Thank you for any help.

Best, CV

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-03-06 12:01:30 -0500

adasta gravatar image

updated 2011-03-06 12:11:28 -0500

It is possible to display an arbitrary mesh in Rviz, but you cannot currently display a OBJ mesh. Currently you can display a collada, stl, and Ogre mesh file. You display them using a marker message. You can find out more about displaying meshes with markers by looking at the Mesh Resource marker .

edit flag offensive delete link more

answered 2022-04-02 15:07:10 -0500

You can display OBJ meshes now with the mesh resource on Marker messages. Here are the important bits

from visualization_msgs.msg import Marker

msg = Marker()
msg.mesh_resource = "package://my_package/path/to/my/mesh.obj"
msg.mesh_use_embedded_materials = True   # Need this to use textures for mesh

And then note you can still color the textured mesh by setting msg.color but you can set the RGBA values all to zero if you just want to display the texture. It works, but I find the lighting options unsatisfying: image description

edit flag offensive delete link more

answered 2012-10-26 06:35:28 -0500

Xpecttrum gravatar image

I have the same problem, I am using markers to display a mesh that comes form a .3ds file. The mesh is shown correctly, but without texture.

If I don't set the colors, it appears in black, if I set colors it appear the entire mesh in that color.

I know that the .3ds file carries the color information, is there anyway to show it properly in Rviz?


edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2011-03-05 11:01:03 -0500

Seen: 8,388 times

Last updated: Apr 02