0
$\begingroup$

Rosanswers logo

hi . i cant load my robot urdf in RViz. i run launch file : roslaunch wrist display.launch

my display.launch is :

 <launch>
 <param name="robot_description" textfile="$(find wrist)/urdf/wrist.urdf" /> 
</launch>

then i run :

rosrun rviz rviz

when i add robotstate in RViz i have this error : how can i fix that ??? please help me .

  [ERROR] [1480582359.533241630]: Could not load model 'file:///home/zakizadeh/catkin_ws3/src/wrist/meshes/m2_1.stl' for link 'm2_1': OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource file:///home/zakizadeh/catkin_ws3/src/wrist/meshes/m2_1.stl in resource group Autodetect or any other group. in ResourceGroupManager::openResource at /build/buildd/ogre-1.8-1.8.1+dfsg/OgreMain/src/OgreResourceGroupManager.cpp (line 756)
[ WARN] [1480582359.533368375]: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource file:///home/zakizadeh/catkin_ws3/src/wrist/meshes/m2_1.stl in resource group Autodetect or any other group. in ResourceGroupManager::openResource at /build/buildd/ogre-1.8-1.8.1+dfsg/OgreMain/src/OgreResourceGroupManager.cpp 

it is my urdf file :

    <?xml version="1.0"?>
<robot name="wrist">
  <link name="base_link">
    <inertial>
      <origin xyz="-0.0155222222222222 0.0506514619883041 -0.0711837607475986" rpy="0 0 0" />
      <mass value="0.161357633901786" />
      <inertia ixx="0" ixy="0" ixz="0" iyy="0"  iyz="0" izz="0" />
    </inertial>
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <mesh filename="file:///home/zakizadeh/catkin_ws3/src/wrist/meshes/base_link.stl" />
      </geometry>
      <material  name="">
        <color  rgba="0.941176470588235 0.674509803921569 0.117647058823529 1" />
      </material>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>

        <mesh filename="file:///home/zakizadeh/catkin_ws3/src/wrist/meshes/base_link.stl" />
      </geometry>
    </collision>
  </link>
  <link name="m2_1">
    <inertial>
      <origin xyz="1.73472347597681E-18 3.46944695195361E-18 -0.0748894348894349" rpy="0 0 0" />
      <mass value="0.0767176926006627" />
      <inertia  ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0" />
    </inertial>
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <mesh  filename="file:///home/zakizadeh/catkin_ws3/src/wrist/meshes/m2_1.stl" />
      </geometry>
      <material  name="">
        <color rgba="0.941176470588235 0.674509803921569 0.117647058823529 1" />
      </material>
    </visual>
    <collision>
      <origin  xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <mesh filename="file:///home/zakizadeh/catkin_ws3/src/wrist/meshes/m2_1.stl" />
      </geometry>
    </collision>
  </link>
  <joint name="m2_1"  type="continuous">
    <origin xyz="-0.0155222222222222 0.0225000000000004 0.0416514619883041" rpy="3.14159265358979 0 0" />
    <parent link="base_link" />
    <child link="m2_1" />
    <axis xyz="0 0 -1" />
  </joint>
</robot>

Originally posted by zakizadeh on ROS Answers with karma: 217 on 2016-12-01

Post score: 0


Original comments

Comment by gvdhoorn on 2016-12-01:
I've changed the title of your question to better reflect what the actual problem is.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The error simply tells you that there is no file m2_1.stl in /home/zakizadeh/catkin_ws3/src/wrist/meshes, so RViz cannot find it.

Check that you got the filename correct and that it's in the directory that you specified. What is the output of:

ls -al /home/zakizadeh/catkin_ws3/src/wrist/meshes/m2_1.stl

Note: most people run Linux with a case-sensitive file system. This means that m2_1.stl != m2_1.STL.


Edit: I'd recommend not using absolute paths, but instead using package:// for paths in urdfs. In your case: <mesh filename="package://wrist/meshes/.." />.


Originally posted by gvdhoorn with karma: 86574 on 2016-12-01

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by zakizadeh on 2016-12-01:
thanks a lot ! i can load urdf in rviz while have same error !!!

Comment by gvdhoorn on 2016-12-01:
So did you resolve the issue? Or are you still having the same error?

Comment by zakizadeh on 2016-12-01:
i still have same error but this time urdf loading correctly !!

Comment by gvdhoorn on 2016-12-01:
well, what is the output of ls -al /home/zakizadeh/catkin_ws3/src/wrist/meshes/m2_1.stl? Does the file actually exist?

Comment by zakizadeh on 2016-12-01:
problem is solved . thanks a lot .

Comment by gvdhoorn on 2016-12-02:
Please tell us what you did to solve the problem. That way future readers might be able to avoid the same / similar problems.

Comment by trashperson on 2020-01-16:
It was after all this error pointed out by gvdhoorn, thanks a bunch. I changed the $(find package) to //package and it worked. sorta dumb and unexpected, weird flex but ok

Comment by Teo Cardoso on 2020-03-29:
I had the same problem and I solved it in the same way. Replace $(find package) to package:// In the URDF file.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.