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

Can't load mesh from package

asked 2022-06-12 14:57:33 -0600

xavier12358 gravatar image

updated 2022-06-13 04:54:00 -0600

I try to load in my xacro file a dae from relative path of on of my package:

<model name='tag0'>
  <pose frame=''>-0.125 0.1 0 0 1.57 0</pose>
  <static>1</static>
  <link name='body'>
    <visual name='tag0'>
      <geometry>
        <mesh file="package://model_gazebo/meshes/Marker0.dae" />
      </geometry>
    </visual>
    <self_collide>0</self_collide>
    <enable_wind>0</enable_wind>
    <kinematic>0</kinematic>
  </link>
</model>

When I use the dae 's absolute path, it works properly, but with the package way to load, there are no errors but the mesh file is not loaded.

How could I integrate my dae according to the package folder

Edit: Here is the tree structure of my project:

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-12 15:26:07 -0600

ljaniec gravatar image

There you can see that it should be:

<mesh filename="package://urdf_tutorial/meshes/l_finger_tip.dae"/>

Can you try changing this to filename in your case?

edit flag offensive delete link more

Comments

Thank you for the answer. Unfortunately, I still have the same trouble. The relative path seems to be correct but the mesh file doesn't appear.

xavier12358 gravatar image xavier12358  ( 2022-06-13 01:41:28 -0600 )edit

Just to be sure - do you have a ROS package named model_gazebo in your workspace?

ljaniec gravatar image ljaniec  ( 2022-06-13 01:55:35 -0600 )edit

No I don't. How to install it ?

xavier12358 gravatar image xavier12358  ( 2022-06-13 02:02:39 -0600 )edit

Please note: the snippet @xavier12358 shows is SDF, not URDF.

gvdhoorn gravatar image gvdhoorn  ( 2022-06-13 02:46:43 -0600 )edit

@gvdhoom what do you mean? In my case, I use it in my world file.

xavier12358 gravatar image xavier12358  ( 2022-06-13 03:01:25 -0600 )edit

Ok, I think I understand now - if you use an absolute path to your file, you don't need to have a ROS package with the mesh files etc. so everything works, but when you want to use a relative path to your package, you need to have it prepared in your workspace package. A good example would be this repository: https://github.com/neobotix/neo_simul... and it's models/robots folders. Another option you can try to check out are the end notes in the "Try it for yourself" section there:

  • Find and download a new mesh on 3D Warehouse. Make sure the mesh is in the Collada (.dae) format.

  • Put the mesh in the ~/.gazebo/models/my_robot/meshes, creating the meshes subdirectory if necessary

  • Use your new mesh on the robot, either as a replacement for the chassis, or as an additional <visual>.

ljaniec gravatar image ljaniec  ( 2022-06-13 03:54:30 -0600 )edit

I have already a package prepare but it does'nt seems to work. I have edit my post to explain my folder tree architecture.

xavier12358 gravatar image xavier12358  ( 2022-06-13 04:54:29 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-06-12 14:57:33 -0600

Seen: 1,238 times

Last updated: Jun 13 '22