0
$\begingroup$

Rosanswers logo

Hi!

I'm looking into the tutorials on URDF (ROS Indigo), robot_state_publisher etc. In this tutorial it is stated that

roslaunch urdf_tutorial display.launch model:=urdf/01-myfirst.urdf

should start rviz (launch parameters stored inside display.launch) with the selected model. Sadly I'm getting the error that such file cannot be found:

rosuser:~$ roslaunch urdf_tutorial display.launch model:=urdf/01-myfirst.urdf
... logging to /home/rosuser/.ros/log/336d620e-8d02-11e5-b0c5-90fba64806be/roslaunch-latadmin-ros-7550.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 298, in main
    p.start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 260, in start
    self._start_infrastructure()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 209, in _start_infrastructure
    self._load_config()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 124, 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'urdf/01-myfirst.urdf'

I also read the lines below:

This launch file assumes that 01-myfirst.urdf is in the urdf subdirectory of the directory that you type the command in. Otherwise, you should say model:='$(find pkg-name)/urdf/01-myfirst.urdf' where pkg-name is the name of the package that the file is in (single quotes required)

I tried both with an installed version of the package and a fresh download of the package inside my catkin workspace but in both cases I'm getting the same error. I have checked and the urdf folder is there along with the specified file (last line of the following terminal output):

rosuser:/opt/ros/indigo/share/urdf_tutorial$ ls -R
.:
cmake  images  launch  package.xml  urdf  urdf.rviz  urdf.vcg

./cmake:
urdf_tutorialConfig-version.cmake  urdf_tutorialConfig.cmake

./images:
flexible.png  materials.png  multipleshapes.png  myfirst.png  origins.png  visual.png

./launch:
display.launch  gazebo.launch  xacrodisplay.launch

./urdf:
01-myfirst.urdf  02-multipleshapes.urdf  03-origins.urdf  04-materials.urdf  05-visual.urdf  06-flexible.urdf  07-physics.urdf  08-macroed.urdf.xacro  r2d2.xacro

Does anyone have an idea what is going on here? I've looked into the launch file and from what my poor knowledge on the topic tells me is that it should be working.


Originally posted by rbaleksandar on ROS Answers with karma: 299 on 2015-11-17

Post score: 0


Original comments

Comment by gvdhoorn on 2015-11-17:
Please add the exact error message to your original post (use the edit button/link). Also: which version of ROS, how installed, etc.

Comment by rbaleksandar on 2015-11-17:
Done, although the error message doesn't say much (even by looking at the trace) and also I don't get the "how installed" part.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

rosuser:~$ roslaunch urdf_tutorial display.launch model:=urdf/01-myfirst.urdf
[..]
IOError: [Errno 2] No such file or directory: u'urdf/01-myfirst.urdf'

according to this, you are invoking roslaunch from your home directory (~). As the tutorial explains:

This launch file assumes that 01-myfirst.urdf is in the urdf subdirectory of the directory that you type the command in.

While the wording could be a bit better, it essentially tells you that you can only give display.launch a relative path to 01-myfirst.urdf if you are actually in a directory that is the direct parent of the urdf directory.

Your home directory is not the direct parent of the /opt/ros/indigo/share/urdf_tutorial/urdf directory, hence the error.

Either do a roscd urdf_tutorial before trying to launch display.launch or use the alternative way to launch it (change pkg-name to urdf_tutorial):

Otherwise, you should say model:='$(find pkg-name)/urdf/01-myfirst.urdf' where pkg-name is the name of the package that the file is in (single quotes required)

This form should work no matter what your current working directory is.


edit: I've changed the wording of the quoted section of the tutorial to be more clear about relative vs absolute paths to files in the urdf_tutorial package.


Originally posted by gvdhoorn with karma: 86574 on 2015-11-17

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.