Problem with urdf_tutorial
Hi All,
I am going through the urdf tutorials but have run into a problem. I got to Materials before running into this error:
Traceback (most recent call last):
File "/opt/ros/indigo/share/xacro/xacro.py", line 62, in <module>
xacro.main()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xacro/__init__.py", line 673, in main
f = open(args[0])
IOError: [Errno 2] No such file or directory: 'urdf/04-materials.urdf'
Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/indigo/share/xacro/xacro.py urdf/04-materials.urdf] returned with code [1].
Param xml is <param command="$(find xacro)/xacro.py $(arg model)" name="robot_description"/>
The traceback for the exception was written to the log file
The file does exist and I'm not even using xacro yet. The weirdest part is I was able to get the first 3 files to work (myfirst, multiple, and origins) without this issue, but now they give me the same error and won't run. I've seen a few similar issues here and people say to go through the xml in the xacro file, but as I've said I don't have one. Anyone know why this is happening?
[EDIT] After finding that the master and indigo branches of the urdftutorial package are different on github, I deleted the master and downloaded the indigo version. This got rid of the xacro issue but still tells me that the file doesn't exist. This happens with both `roslaunch urdftutorial display.launch model:=urdf/04-materials.urdffrom the package path as shown in the tutorial and when using
roslaunch urdftutorial display.launch model:='$(find urdftutorial)/urdf/04-materials.urdf'`. The full error message is shown below:
Traceback (most recent call last):
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307, in main
p.start()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start
self._start_infrastructure()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 217, in _start_infrastructure
self._load_config()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 132, in _load_config
roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
loader.load(f, config, verbose=verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 730, in load
self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 702, in _load_launch
self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 646, in _recurse_load
self._param_tag(tag, context, ros_config, verbose=verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
return f(*args, **kwds)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 264, in _param_tag
value = self.param_value(verbose, name, ptype, *vals)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/loader.py", line 463, in param_value
with open(textfile, 'r') as f:
IOError: [Errno 2] No such file or directory: u'/home/ros/catkin_ws/src/urdf_tutorial-indigo/urdf/04-materials.urdf'
Asked by Icehawk101 on 2016-04-21 07:42:38 UTC
Answers
The issue is most likely related to the path that you were using. What directory were you in when the commands used to work? If you happened to be in the base path of the urdf_tutorial
package, then it makes sense that a command like
roslaunch urdf_tutorial display.launch model:=urdf/04-materials.urdf
would work correctly. If you inspect the display.launch file on Indigo, you'll see that the model
arg gets passed directly to the robot_description
parameter. The relative path in the above command will only work if your current working directory is correct. Note that this is discussed in the One Shape section of the tutorial originally linked.
If you instead used a command like
roslaunch urdf_tutorial display.launch model:='$(find urdf_tutorial)/urdf/04-materials.urdf'
the error would disappear.
EDIT
Looking at the changes in the urdf_tutorials package, I noticed that in commit f2db517470 the contents of the display.launch
file changed quite a bit. If you were using a copy of the urdf_tutorials package from GitHub and you were on the master branch, this could explain why you are seeing references to xacro. The newest version of display.launch
uses xacro even when you are just using a regular URDF.
Asked by jarvisschultz on 2016-04-21 11:16:08 UTC
Comments
Hi, I noticed the master/indigo difference after posting this. I have since downloaded the indigo branch. That fixed the xacro problem but not finding the file. I was in the base path of the urdf_tutorial
package and I tried your command, still nothing.
Asked by Icehawk101 on 2016-04-21 11:42:23 UTC
Frankly... the first command is bad practice. The second command is far more robust and easier for people to use. Does that command work? If not, I suggest you edit your question and provide the exact command that you are using to generate your error....
Asked by jarvisschultz on 2016-04-21 12:32:44 UTC
Both commands work fine for me with both versions of display.launch
. It may also be helpful to see the output of things like rospack find urdf_tutorial
to figure out which version you are using. Possibly rospack list-duplicates
could be helpful.
Asked by jarvisschultz on 2016-04-21 12:34:18 UTC
Also notice that the second command has the model
argument value in quotes. That is important... otherwise bash will split the arg value between "find" and "urdf_tutorial"
Asked by jarvisschultz on 2016-04-21 12:35:55 UTC
Comments
In the very last line of the new error message you see it is specifically looking for a file
/home/ros/catkin_ws/src/urdf_tutorial-indigo/urdf/04-materials.urdf
... does that file exist? Does theros
user have permission to read it? Are you running as theros
user?Asked by jarvisschultz on 2016-04-21 13:14:42 UTC
You could try running just xacro on the URDF file and see if that generates different errors. E.g.
/opt/ros/indigo/share/xacro/xacro.py /home/ros/catkin_ws/src/urdf_tutorial-indigo/urdf/04-materials.urdf
Asked by jarvisschultz on 2016-04-21 13:18:33 UTC