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

Unable to display Mesh as an interactive marker

asked 2015-07-02 14:06:57 -0600

updated 2015-07-02 14:11:49 -0600

I want to use a mesh as a marker. To do that, I changed to :

marker.type = Marker.MESH_RESOURCE;
marker.mesh_resource = 'package://HexagonalPrism.STL'

(And added a from visualization_msgs.msg import * at the top as well)

I get the following error

Error retrieving file [package://HexagonalPrism.STL]: Could not parse package:// format into file:// format

RViz screenshot :

The same works fine if I do a simple marker:

marker = visualization_msgs.msg.Marker()
marker.type = visualization_msgs.msg.Marker.MESH_RESOURCE
marker.mesh_resource = 'package://HexagonalPrism.STL'

RViz : screenshot :

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-07-02 14:45:47 -0600

David Lu gravatar image

The file format is 'package://' + name_of_package + '/' + filename_in_package

For example, if you have HexagonalPrism.STL in the package hexbot, the syntax should be 'package://hexbot/HexagonalPrism.STL'. If its in a folder called meshes in that package, 'package://hexbot/meshes/HexagonalPrism.STL'

edit flag offensive delete link more


Thanks for the quick help. But it still doesn't work. Here's the code. Just minor changes from the visualization_tutorials

ratneshmadaan gravatar image ratneshmadaan  ( 2015-07-05 11:40:41 -0600 )edit

You have to be more specific than "doesn't work"

David Lu gravatar image David Lu  ( 2015-07-05 12:19:32 -0600 )edit

Oh sorry, I don't get the error I wrote in the question, but RViz still looks like

ratneshmadaan gravatar image ratneshmadaan  ( 2015-07-05 12:21:43 -0600 )edit

Check the filenames carefully, especially dae vs stl.

David Lu gravatar image David Lu  ( 2015-07-05 12:39:20 -0600 )edit

There are both dae and stl files here. I tried stl as well. No change. :\

ratneshmadaan gravatar image ratneshmadaan  ( 2015-07-05 12:58:06 -0600 )edit

Question Tools

1 follower


Asked: 2015-07-02 14:06:57 -0600

Seen: 1,757 times

Last updated: Jul 02 '15