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

ros3djs not able to display my 3D files

asked 2015-08-21 07:01:11 -0500

rubenvm gravatar image

Hello! I've built a part in solidworks and exported it into a STL file. So I'm trying to display it on the web browser through the package ros3djs ( http://wiki.ros.org/ros3djs/Tutorials... ). When I try to show it, the web console gives me an error, so I have converted into .dae format through the Meshlab software. I'm using the following URDF code:

<?xml version="1.0"?>
<robot name="robottt">
    <link name="base_link">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <geometry>
                <mesh filename="file:///home/ros/catkin_ws/src/robottt/robots/base_link.dae" />
            </geometry>

        </visual>
    </link>
</robot>

I don't know what could be going wrong, the same urdf is well-displayed in rviz. I have tested exchanging the path filename to a pr2_description part, and it does well on the web browser and rviz.

<mesh filename="package://pr2_description/meshes/gripper_v0/l_finger.dae" />

Some errors are shown on the web console, but these are the same in both .dae files, so I think it is not the reason for not showing my model.

I upload my .dae file if you want to test it. https://www.dropbox.com/s/m140qdyeze7...

Any idea? I've been stuck in this for some days. I have also tried lighter .dae files without any success. And also tried to convert it into .dae format through other software such as OpenCollada in Maya, and some online converters.

Thank you very much, I appreciate any help.

Ruben

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-08-21 07:54:46 -0500

rtoris288 gravatar image

updated 2015-08-21 07:55:05 -0500

ros3djs assumes that the mesh resources begin with a package:// URL, not a file URL like in your example. What the library will do is replace package:// with whatever argument you give to path (e.g., https://github.com/RobotWebTools/ros3... ). If you do not provide a path, it will use localhost by default. For example, if a resource is package://robottt/robots/base_link.dae, roslibjs will replace this with http://localhost/robottt/robots/base_link.dae by default. Again, you can change the preface with an optional argument.

Browsers cannot natively access the file system for security reasons, so you will need to host your HTML page and the Collada file on a web server (Apache is easy enough to set up).

edit flag offensive delete link more

Comments

Ohh! Thank you very much! I have been stuck for a few days on this. I really appreciate your help. Thank you again! It's working perfectly now!

rubenvm gravatar image rubenvm  ( 2015-08-21 09:40:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-08-21 07:01:11 -0500

Seen: 712 times

Last updated: Aug 21 '15