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

Unable to display Mesh as an interactive marker

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

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

I want to use a mesh as a marker. To do that, I changed basic_controls.py 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 : https://drive.google.com/file/d/0B-PF...

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 : https://drive.google.com/file/d/0B-PF...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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

Comments

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

https://github.com/madratman/visualiz...

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

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

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

Oh sorry, I don't get the error I wrote in the question, but RViz still looks like https://drive.google.com/file/d/0B-PF...

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

Check the filenames carefully, especially dae vs stl.

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

There are both dae and stl files here. https://github.com/madratman/visualiz... I tried stl as well. No change. :\

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

Question Tools

1 follower

Stats

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

Seen: 1,774 times

Last updated: Jul 02 '15