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.