0
$\begingroup$

Rosanswers logo

Hello everyone I am new to ROS and using Ros indigo with UBUNTU trusty I tried to make a urdf with my own stl and tried to run in rviz(latest version), but it showed the following error. I am posting the error and aunch file below. kindly help.

The error is :

UnboundLocalError: local variable 'slider' referenced before assignment
[joint_state_publisher-2] process has died [pid 3003, exit code 1, cmd /opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/xeon74/.ros/log/9a85b020-9749-11e6-b2c4-1cc1de334fec/joint_state_publisher-2.log].
log file: /home/xeon74/.ros/log/9a85b020-9749-11e6-b2c4-1cc1de334fec/joint_state_publisher-2*.log
[ERROR] [1477025310.997172887]: Error retrieving file [file:///home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl]: Couldn't open file /home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl
[ERROR] [1477025311.011398727]: Could not load model 'file:///home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl' for link 'base_link': OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource file:///home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.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)
[ERROR] [1477025311.011543180]: Could not load model 'file:///home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl' for link 'base_link': OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource file:///home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.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)

and my Launch file is :

<launch>
    <arg name="model" />
    <!-- Parsing xacro and setting robot_description parameter -->
    <param name="robot_description" textfile="$(find my_robot)/urdf/my_urdf.urdf" />
    <!-- Setting gui parameter to true for display joint slider -->
    <param name="use_gui" value="true"/>
    <!-- Starting Joint state publisher node which will publish the joint values -->
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
    <!-- Starting robot state publish which will publish tf -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
    <!-- Launch visualization in rviz -->
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find my_robot)/urdf.rviz" required="true" />
</launch>

Edit: Thanx for reply, I checked the file system and found the file ls -la /home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl . Also I have installed joint_state_publisher from ros.wiki site under the complete package installation. May the error is due to the .STL and .stl formats. Kindly suggest a way to correct this problems.


Edit2: Here's the output of the command

ls -la /home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl
-rw-rw-r-- 1 xeon74 xeon74 23784 Oct 20 17:59 /home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl

regarding the confusion between .stl and .STL , I was saying since Linux works under case sensitive environment , so will there be any problem using .STL instead of .stl ???


Edit3: Sorry for the wait. I was on vacation. I actually figured out the problem . Actually the problem was due to the loading of the single link in rviz without any joints and in the launch file I launched the joint state controller. Due to that , it was showing error. But after i put some joints in it , it was working fine.


Originally posted by Pulkit123 on ROS Answers with karma: 171 on 2016-10-20

Post score: 1


Original comments

Comment by gvdhoorn on 2016-10-22:
Could you please edit your question next time when you have additional information? Please use answers only to answer the question. Comments for other discussion.

Comment by cangjiaxuan on 2016-11-05:
Hi, I meet similar problem like you. I draw a model file using sketchup, and convert it to stl using mashlab. This model file can be displayed in gazebo but get this "UnboundLocalError: local variable 'slider' referenced before assignment" error when loading in rviz.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

[ERROR] [1477025310.997172887]: Error retrieving file [file:///home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl]: Couldn't open file /home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl
[ERROR] [1477025311.011398727]: Could not load model 'file:///home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl' for link 'base_link': OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource file:///home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.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)

The error basically tells you that RViz cannot find the file /home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl. Two things to make sure:

  1. is there actually a file called base_3.stl inside the /home/xeon74/my_bot/src/my_robot/mesh/stl directory?
  2. does the user that starts RViz have read permissions for base_3.stl?

In both cases the output of ls -la /home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl should provide us with that information, so please add the output of that command to your question (edit it).

note: in most cases, Linux runs on top of a case-sensitive file system, which means that file.STL is not the same as file.stl. Make sure base_3.stl is not actually base_3.STL. This is a common problem with urdfs and meshes created under Windows, and then copied to your Linux installation.


I would actually be more worried about this error:

UnboundLocalError: local variable 'slider' referenced before assignment
[joint_state_publisher-2] process has died [pid 3003, exit code 1, cmd /opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/xeon74/.ros/log/9a85b020-9749-11e6-b2c4-1cc1de334fec/joint_state_publisher-2.log].

This points to a rather strange error inside the joint_state_publisher. Can you tell us how you installed joint_state_publisher: did you use the deb packages, or did you built things from sources?


Edit:

I checked the file system and found the file ls -la /home/xeon74/my_bot/src/my_robot/mesh/stl/base_3.stl.

So, where is the output of that command? Please add it to your original question, by editing it.

Also I have installed joint_state_publisher from ros.wiki site under the complete package installation.

Ok. Then please report the joint_state_publisher part of the error over at ros/robot_model/issues.

May the error is due to the .STL and .stl formats.

I'm not sure what you mean by this. .stl and .STL are both file extensions commonly used by STL files. Are you saying that you have a .STL file but not the .stl file?

Additionally, please include a fragment of your urdf which loads the meshes (ie: the <geometry><mesh filename="package://../base_3.stl"/></geometry> lines).


Edit2:

regarding the confusion between .stl and .STL , I was saying since Linux works under case sensitive environment , so will there be any problem using .STL instead of .stl ???

As I wrote earlier: if your files are actually using .STL (upper case), but your urdf specifies .stl (lower case) then it will not work. But from the output of ls -al .. it would appear that the file actually exists, so I'm doubtful that is the problem here. Unless you know something we don't.


Edit3:

But after i put some joints in it , it was working fine.

Are you referring to the joint_state_publisher problem (local variable 'slider' referenced before assignment), or the mesh loading issue?


Originally posted by gvdhoorn with karma: 86574 on 2016-10-21

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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